Rule 1101 specifies that the opening 'program-stmt' is optional. This
class handles the special case when it is not supplied and thus
matches on:
<main-program> =
[ <specification-part> ]
[ <execution-part> ]
[ <internal-subprogram-part> ]
<end-program-stmt>
C1102 The program-name may be included in the end-program-stmt
only if the optional program-stmt is used and, if included, shall
be identical to the program-name specified in the
program-stmt.
In this class an end program name is not allowed due to C1102.
Definition at line 10074 of file Fortran2003.py.
def fparser.two.Fortran2003.Main_Program0.match |
( |
|
reader | ) |
|
|
static |
Attempts to match the content in the reader with a program that is
missing the optional opening program-stmt (R1101). If the match
is successful, a symbol table named "fparser2:main_program" is
also created.
:param reader: Content to check for match
:type reader: str or instance of :py:class:`FortranReaderBase`
:return: 2-tuple of (list of matched classes, None) or None \
if no match is found.
:rtype: (list of matched classes, None) or NoneType
Definition at line 10105 of file Fortran2003.py.
10107 Attempts to match the content in the reader with a program that is 10108 missing the optional opening program-stmt (R1101). If the match 10109 is successful, a symbol table named "fparser2:main_program" is 10112 :param reader: Content to check for match 10113 :type reader: str or instance of :py:class:`FortranReaderBase` 10115 :return: 2-tuple of (list of matched classes, None) or None \ 10116 if no match is found. 10117 :rtype: (list of matched classes, None) or NoneType 10123 table_name =
"fparser2:main_program" 10124 SYMBOL_TABLES.enter_scope(table_name)
10126 result = BlockBase.match(
10128 [Specification_Part, Execution_Part, Internal_Subprogram_Part],
10133 SYMBOL_TABLES.exit_scope()
10136 SYMBOL_TABLES.remove(table_name)