The AST subclass representing alternative statements (if-then, if-then-else, if-then-elseif..., or if-then-elseif...-else).

Consists of one or more conditional statements, the conditionalBlocks, and an optional elseBlock to use if none of the conditions is true.

Notes:

  • the elseBlock may be undefined, representing the case of an alternative with no else.
  • when the conditionalBlocks has length one, and the elseBlock is present, this subclass represents the standard if-then-else construction, if conditionalBlocks has length one, but no elseBlock is present, it represents the if-then construction, and if the conditionalBlocks has length more than one, it represents the multialternative construction.

PRECONDITIONS:

  • conditionalBlocks.length >=1

Hierarchy (view full)

API

  • The specialized constructor for this AST subclass, transforming this particular case to the general one using super.

    PRECONDITIONS:

    • conditionalBlocks.length >=1

    Parameters

    Returns ASTStmtIf

    Throws

    GParserPreconditionError

attributes: OptionsTable = ...

TO DO: Complete

children: ASTChild[]

TO DO: Complete This array may be used for 2 purposes:

  • as a list of heterogeneous childs (several branches, some of them lists)
  • as a list of homogeneous childs (just one list branch, represented directly) The difference is given by the kind of node and its components.
span: Span = ...

TO DO: Complete

tag: symbol

TO DO: Complete

  • Indicates if the ASTStmtIf has an else block.

    Returns boolean

  • Indicates if the ASTStmtIf is a multialternative.

    Returns boolean

  • Indicates if the ASTStmtIf is a single alternative, not a multialternative.

    Returns boolean

  • TO DO: Complete

    Returns string

Auxiliaries