loki.ir.nodes.stmt_nodes

Generic and specific statement node type definitions.

Classes

CommonStmt(text[, source, label])

GenericStmt node that represents the COMMON specifier.

ContainsStmt([text, source, label])

GenericStmt node that represents the CONTAINS specifier.

ContinueStmt([text, source, label])

GenericStmt node that represents the CONTINUE specifier.

CycleStmt([text, source, label])

GenericStmt node that represents the CYCLE specifier.

FormatStmt([text, source, label])

GenericStmt node that represents the FORMAT specifier.

GenericStmt(text[, source, label])

Catch-all generic node for corner-cases.

GotoStmt(text[, source, label])

GenericStmt node that represents the GO TO specifier.

ImplicitStmt([text, source, label])

GenericStmt node that represents the IMPLICIT statement.

PrintStmt(text[, source, label])

GenericStmt node that represents the PRINT specifier.

PrivateStmt([text, source, label])

GenericStmt node that represents the PRIVATE specifier.

PublicStmt([text, source, label])

GenericStmt node that represents the PUBLIC specifier.

ReturnStmt([text, source, label])

GenericStmt node that represents the RETURN specifier.

SaveStmt([text, source, label])

GenericStmt node that represents the SAVE statement.

StopStmt([text, source, label])

GenericStmt node that represents the STOP specifier.

class GenericStmt(text: str, source: Source | str | None = None, label: str | None = None)

Bases: LeafNode, _GenericStmtBase

Catch-all generic node for corner-cases.

This is provided as a fallback for any statements that do not have an appropriate representation in the IR. These can either be language features for which support was not yet added, or statements that are not relevant in Loki’s scope of applications. This node retains the text of the statement in the original source as-is.

Parameters:
  • text (str) – The statement as a string.

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = None
class ImplicitStmt(text: str | Tuple[Expression, ...] | None = 'NONE', source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the IMPLICIT statement.

Parameters:
  • text (str or Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'IMPLICIT'
text: str | Tuple[Expression, ...] | None = 'NONE'
classmethod ensure_str_or_tuple(value)
class SaveStmt(text: Tuple[Expression, ...] | None = (), source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the SAVE statement.

Parameters:
  • text (str or Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'SAVE'
text: Tuple[Expression, ...] | None = ()
classmethod ensure_tuple(value)
class PublicStmt(text: Tuple[Expression, ...] | None = (), source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the PUBLIC specifier.

Parameters:
  • text (str or tuple of Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'PUBLIC'
text: Tuple[Expression, ...] | None = ()
classmethod ensure_tuple(value)
class PrivateStmt(text: Tuple[Expression, ...] | None = (), source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the PRIVATE specifier.

Parameters:
  • text (str or tuple of Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'PRIVATE'
text: Tuple[Expression, ...] | None = ()
classmethod ensure_tuple(value)
class CommonStmt(text: Tuple[Expression, ...], source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the COMMON specifier.

Parameters:
  • text (str or tuple of Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'COMMON'
text: Tuple[Expression, ...]
classmethod ensure_tuple(value)
class ContainsStmt(text: None = None, source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the CONTAINS specifier.

Parameters:

**kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'CONTAINS'
text: None = None
class ReturnStmt(text: None = None, source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the RETURN specifier.

Parameters:

**kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'RETURN'
text: None = None
class CycleStmt(text: None = None, source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the CYCLE specifier.

Parameters:

**kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'CYCLE'
text: None = None
class ContinueStmt(text: None = None, source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the CONTINUE specifier.

Parameters:

**kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'CONTINUE'
text: None = None
class StopStmt(text: None = None, source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the STOP specifier.

Parameters:

**kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'STOP'
text: None = None
class GotoStmt(text: str, source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the GO TO specifier.

Parameters:

**kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'GO TO'
text: str
class PrintStmt(text: Tuple[Expression, ...], source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the PRINT specifier.

Parameters:
  • text (str or tuple of Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'PRINT'
text: Tuple[Expression, ...]
classmethod ensure_tuple(value)
class FormatStmt(text: Tuple[Expression, ...] | None = (), source: Source | str | None = None, label: str | None = None)

Bases: GenericStmt

GenericStmt node that represents the FORMAT specifier.

Parameters:
  • text (str or tuple of Expression, optional) – Either a tuple of variable specifiers or a string; default: NONE

  • **kwargs (optional) – Other parameters that are passed on to the parent class constructor.

keyword = 'FORMAT'
text: Tuple[Expression, ...] | None = ()
classmethod ensure_tuple(value)