Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self) |
def | psyir_from_source (self, str source_code, bool free_form=True) |
def | psyir_from_expression (self, str source_code, Optional[SymbolTable] symbol_table=None) |
def | psyir_from_statement (self, str source_code, Optional[SymbolTable] symbol_table=None) |
def | psyir_from_file (self, file_path, free_form=True) |
Static Public Member Functions | |
def | validate_name (str name) |
PSyIR Fortran frontend. This frontend translates Fortran from a string or a file into PSyIR using the fparser2 utilities.
Definition at line 52 of file fortran.py.
def psyclone.psyir.frontend.fortran.FortranReader.psyir_from_expression | ( | self, | |
str | source_code, | ||
Optional[SymbolTable] | symbol_table = None |
||
) |
Generate the PSyIR tree for the supplied Fortran statement. The symbol table is expected to provide all symbols found in the expression. :param source_code: text of the expression to be parsed. :param symbol_table: the SymbolTable in which to search for any symbols that are encountered. :returns: PSyIR representing the provided Fortran expression. :rtype: :py:class:`psyclone.psyir.nodes.Node` :raises TypeError: if no valid SymbolTable is supplied. :raises ValueError: if the supplied source does not represent a Fortran expression.
Definition at line 104 of file fortran.py.
References psyclone.parse.module_info.ModuleInfo._processor, and psyclone.psyir.frontend.fortran.FortranReader._processor.
def psyclone.psyir.frontend.fortran.FortranReader.psyir_from_file | ( | self, | |
file_path, | |||
free_form = True |
|||
) |
Generate the PSyIR tree representing the given Fortran file. :param file_path: path of the file to be read and parsed. :type file_path: str or any Python Path format. :param free_form: If parsing free-form code or not (default True). :type free_form: bool :returns: PSyIR representing the provided Fortran file. :rtype: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 198 of file fortran.py.
References psyclone.psyir.frontend.fortran.FortranReader._parser, psyclone.parse.module_info.ModuleInfo._processor, and psyclone.psyir.frontend.fortran.FortranReader._processor.
def psyclone.psyir.frontend.fortran.FortranReader.psyir_from_source | ( | self, | |
str | source_code, | ||
bool | free_form = True |
||
) |
Generate the PSyIR tree representing the given Fortran source code. :param source_code: text representation of the code to be parsed. :param free_form: If parsing free-form code or not (default True). :returns: PSyIR representing the provided Fortran source code. :rtype: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 86 of file fortran.py.
References psyclone.psyir.frontend.fortran.FortranReader._parser, psyclone.parse.module_info.ModuleInfo._processor, and psyclone.psyir.frontend.fortran.FortranReader._processor.
def psyclone.psyir.frontend.fortran.FortranReader.psyir_from_statement | ( | self, | |
str | source_code, | ||
Optional[SymbolTable] | symbol_table = None |
||
) |
Generate the PSyIR tree for the supplied Fortran statement. The symbolt table is expected to provide all symbols found in the statement. :param source_code: text of the statement to be parsed. :param symbol_table: the SymbolTable in which to search for any symbols that are encountered. :returns: PSyIR representing the provided Fortran statement. :rtype: :py:class:`psyclone.psyir.nodes.Node` :raises TypeError: if no valid SymbolTable is supplied. :raises ValueError: if the supplied source does not represent a Fortran statement.
Definition at line 148 of file fortran.py.
References psyclone.parse.module_info.ModuleInfo._processor, and psyclone.psyir.frontend.fortran.FortranReader._processor.
|
static |
Utility method that checks that the supplied name is a valid Fortran name. :param name: the name to check. :raises TypeError: if the name is not a string. :raises ValueError: if this is not a valid name.
Definition at line 67 of file fortran.py.