fab.parse#

Classes

AnalysedFile(fpath[, file_hash])

Analysis results for a single file.

EmptySourceFile(fpath)

An analysis result for a file which resulted in an empty parse tree.

Exceptions

exception fab.parse.ParseException#
class fab.parse.AnalysedFile(fpath, file_hash=None)#

Analysis results for a single file. Abstract base class.

Parameters:
  • fpath (Union[str, Path]) – The path of the file which was analysed.

  • file_hash (Optional[int]) – The checksum of the file which was analysed. If omitted, Fab will evaluate lazily. (default: None)

If not provided, the self.file_hash property is lazily evaluated in case the file does not yet exist.

to_dict()#

Create a dict representing the object.

The dict may be written to json, so can’t contain sets. Lists are sorted for reproducibility in testing.

Return type:

Dict[str, Any]

classmethod field_names()#

Defines the order in which we want fields to appear in str or repr strings.

Calling this helps to ensure any lazy attributes are evaluated before use, e.g when constructing a string representation of the instance, or generating a hash value.

class fab.parse.EmptySourceFile(fpath)#

An analysis result for a file which resulted in an empty parse tree.

Parameters:

fpath (Union[str, Path]) – The path of the file which was analysed.

Modules

c

C language handling classes.

fortran

Fortran language handling classes.

fortran_common

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

x90