fparser.common.base_classes
Base classes for all Fortran statement types
Module Contents
Classes
Defines a object with predefined attributes. Only those attributes |
|
Variable instance has attributes: |
|
Statement instance has attributes: |
|
END [<blocktype> [<name>]] |
- class fparser.common.base_classes.AttributeHolder(**kws)[source]
Defines a object with predefined attributes. Only those attributes are allowed that are specified as keyword arguments of a constructor. When an argument is callable then the corresponding attribute will be read-only and set by the value the callable object returns.
- class fparser.common.base_classes.Variable(parent, name)[source]
Variable instance has attributes:
name typedecl dimension attributes intent parent - Statement instances defining the variable
- known_intent_specs = ['IN', 'OUT', 'INOUT', 'CACHE', 'HIDE', 'COPY', 'OVERWRITE', 'CALLBACK', 'AUX', 'C', 'INPLACE', 'OUT='][source]
- class fparser.common.base_classes.Statement(parent, item)[source]
Statement instance has attributes:
parent - Parent BeginStatement or FortranParser instance item - Line instance containing the statement line isvalid - boolean, when False, the Statement instance will be ignored
- class fparser.common.base_classes.BeginStatement(parent, item=None)[source]
Bases:
Statement
[ construct_name : ] <blocktype> [ <name> ]
BeginStatement instances have additional attributes:
name blocktype
Block instance has attributes:
content - list of Line or Statement instances name - name of the block, unnamed blocks are named with the line label construct_name - name of a construct parent - Block or FortranParser instance item - Line instance containing the block start statement get_item, put_item - methods to retrive/submit Line instances from/to Fortran reader. isvalid - boolean, when False, the Block instance will be ignored. stmt_cls, end_stmt_cls
- process_subitem(item)[source]
Check if item is blocks start statement, if it is, read the block.
Return True to stop adding items to given block.
- handle_unknown_item_and_raise(item)[source]
Called when process_subitem does not find a start or end of block. It adds the item (which is an instance of Line) to the content, but then raises an AnalyzeError. An instance of Line in content typically results in other errors later (e.g. because Line has no analyze method).
- class fparser.common.base_classes.EndStatement(parent, item)[source]
Bases:
Statement
END [<blocktype> [<name>]]
EndStatement instances have additional attributes:
name blocktype