F2x.parser.tree module¶
This module contains the base classes for the Abtract Generation Tree that is built by the parser form the Fortran sources.
-
class
F2x.parser.tree.FuncDef(ast)¶ Bases:
F2x.parser.tree.SubDef
-
class
F2x.parser.tree.Module(ast)¶ Bases:
F2x.parser.tree.Node
-
class
F2x.parser.tree.Node(ast)¶ Bases:
dictNode constructor stores local AST node in
_astand calls_init_children()which should be overwritten by child classes.This is the base class for the simplified AST that can easily be used in templates. It is simply a dict which stores child nodes as values. This allows to simply use
node.childto access the values from a template. E.g. to get the modules name, you can simply use{{ module.name }}
-
class
F2x.parser.tree.SubDef(ast)¶ Bases:
F2x.parser.tree.Node
-
class
F2x.parser.tree.TypeDef(ast)¶ Bases:
F2x.parser.tree.Node
-
class
F2x.parser.tree.VarDecl(ast, prefix='')¶ Bases:
F2x.parser.tree.NodeA variable declaration.
The following properties are available:
nameThe symbolic name of the variable.
typeThe C type of this variable. This might be a basic type (REAL, INTEGER, LOGICAL) or TYPE(C) for any other type like arrays, derived types or strings.
intentMay be
'IN','OUT', or'INOUT'.getterThis indicates whether the generated getter should be a
FUNCTINorSUBROUTINE’.setter(opt)
This indicates whether a
SUBROUTINEshould be generated as setter.ftype(opt)
The name of the derived type.
strlen(opt)
The length of the string.
kind(opt)
The
KINDspecifier if available.dynamic(opt)
Indicates whether the variable is
ALLOCATABLEor aPOINTER.dims(opt)
For an array contains a list with the sizes per dimension.
-
with_intent(intent)¶
-