fab.parse.fortran_common module#

Common functionality for both Fortran and (sanitised) X90 processing.

fab.parse.fortran_common.iter_content(obj)#

Return a generator which yields every node in the tree.

class fab.parse.fortran_common.FortranAnalyserBase(result_class, std=None)#

Bases: ABC

Base class for Fortran parse-tree analysers, e.g FortranAnalyser and X90Analyser.

Parameters:
  • result_class – The type (class) of the analysis result. Defined by the subclass.

  • std – The Fortran standard. (default: None)

run(fpath)#

Parse the source file and record what we’re interested in (subclass specific).

Reloads previous analysis results if available.

Returns the analysis data and the result file where it was stored/loaded.

Return type:

Union[Tuple[AnalysedDependent, Path], Tuple[EmptySourceFile, None], Tuple[Exception, None]]

abstract walk_nodes(fpath, file_hash, node_tree)#

Examine the nodes in the parse tree, recording things we’re interested in.

Return type depends on our subclass, and will be a subclass of AnalysedDependent.

Return type:

AnalysedDependent