fparser Reference Guide
0.0.14
|
Public Member Functions | |
def | create (self, std=None) |
Creates a parser suitable for the specified Fortran standard.
def fparser.two.parser.ParserFactory.create | ( | self, | |
std = None |
|||
) |
Creates a class hierarchy suitable for the specified Fortran standard. Also sets-up the list of classes that define scoping regions in the global SymbolTables object and clears any existing symbol table information. :param str std: the Fortran standard. Choices are 'f2003' or \ 'f2008'. 'f2003' is the default. :return: a Program class (not object) for use with the Fortran reader :rtype: :py:class:`fparser.two.Fortran2003.Program` :raises ValueError: if the supplied value for the std parameter \ is invalid For example: >>> from fparser.two.parser import ParserFactory >>> f2003_parser = ParserFactory().create() >>> f2003_parser = ParserFactory().create(std='f2003') >>> f2008_parser = ParserFactory().create(std='f2008') >>> # Assuming that a reader has already been created ... >>> ast = f2008_parser(reader) >>> print(ast)
Definition at line 98 of file parser.py.
References fparser.two.parser.ParserFactory._setup(), fparser.two.C99Preprocessor.Cpp_Pp_Tokens.subclass_names, fparser.two.Fortran2003.Comment.subclass_names, fparser.two.C99Preprocessor.Cpp_If_Stmt.subclass_names, fparser.two.Fortran2008.Executable_Construct_C201.subclass_names, fparser.two.C99Preprocessor.Cpp_Elif_Stmt.subclass_names, fparser.two.Fortran2008.Action_Stmt_C201.subclass_names, fparser.two.C99Preprocessor.Cpp_Else_Stmt.subclass_names, fparser.two.Fortran2008.Action_Stmt_C816.subclass_names, fparser.two.Fortran2008.Action_Stmt_C828.subclass_names, fparser.two.C99Preprocessor.Cpp_Endif_Stmt.subclass_names, fparser.two.C99Preprocessor.Cpp_Macro_Identifier_List.subclass_names, fparser.two.Fortran2003.Execution_Part_Construct_C201.subclass_names, fparser.two.C99Preprocessor.Cpp_Undef_Stmt.subclass_names, fparser.two.Fortran2003.Executable_Construct_C201.subclass_names, fparser.two.C99Preprocessor.Cpp_Warning_Stmt.subclass_names, fparser.two.Fortran2003.Action_Stmt_C201.subclass_names, fparser.two.Fortran2003.Action_Stmt_C802.subclass_names, fparser.two.Fortran2003.Action_Stmt_C824.subclass_names, fparser.two.Fortran2003.Digit_String.subclass_names, fparser.two.utils.Type_Declaration_StmtBase.subclass_names, fparser.two.Fortran2003.Dimension_Component_Attr_Spec.subclass_names, fparser.two.Fortran2003.Proc_Component_PASS_Arg_Name.subclass_names, fparser.two.Fortran2003.Binding_PASS_Arg_Name.subclass_names, fparser.two.Fortran2003.Generic_Binding.subclass_names, fparser.two.Fortran2003.Ac_Implied_Do.subclass_names, fparser.two.Fortran2003.Ac_Implied_Do_Control.subclass_names, fparser.two.Fortran2003.Ac_Do_Variable.subclass_names, fparser.two.Fortran2003.Object_Name_Deferred_Shape_Spec_List_Item.subclass_names, fparser.two.Fortran2003.Target_Entity_Decl.subclass_names, fparser.two.Fortran2003.Data_Ref.subclass_names, fparser.two.Fortran2003.Scalar_Char_Initialization_Expr.subclass_names, fparser.two.Fortran2003.Parenthesis.subclass_names, fparser.two.Fortran2003.Connect_Spec.subclass_names, fparser.two.Fortran2003.Io_Control_Spec_List.subclass_names, fparser.two.Fortran2003.Io_Control_Spec.subclass_names, fparser.two.Fortran2003.Data_Edit_Desc_C1002.subclass_names, fparser.two.Fortran2003.Main_Program0.subclass_names, fparser.two.Fortran2003.Function_Body.subclass_names, fparser.two.Fortran2003.Subroutine_Body.subclass_names, and fparser.two.Fortran2003.Prefix.subclass_names.