AST nodes: Expr node hierarchy

The Fortress AST nodes are automatically generated by the  ASTGen tool from the AST node hierarchy description. Among other language constructs, Fortress expressions are represented as subclasses of the abstract class Expr. The Expr node hierarchy is shown below:

  • abstract Expr
    • abstract TypeAnnotatedExpr
      • AsExpr
      • AsIfExpr
    • Assignment

_RewriteAssignment An assignment that has passed typechecking, and uses an operator.

  • abstract DelimitedExpr
    • Block
    • CaseExpr
    • Do
    • For (Plan: Removed after the first desugarer before the type checker)
    • If (Desugared in the first desugarer but not removed before the type checker)
    • Label
    • abstract AbstractObjectExpr
      • ObjectExpr
        • Removed after interpreter.rewrite.Desugarer
        • It is not clear whether _ObjectExpr is removed before or after the type checking.
      • _RewriteObjectExpr
        • Created during interpreter.rewriete.Desugarer
        • It is not clear whether _RewriteObjectExpr is created before or after the type checking.
    • Try
    • abstract AbstractTupleExpr
      • TupleExpr
      • ArgExpr
    • Typecase (Desugared in the first desugarer but not removed before the type checker)
    • While (Desugared in the first desugarer but not removed before the type checker)
  • abstract FlowExpr
    • abstract BigOpApp
      • Accumulator (Plan: Removed after the first desugarer before the type checker)
      • ArrayComprehension (NYI: Maybe removed after the first desugarer before the type checker)
    • AtomicExpr
    • Exit
    • Spawn (Plan: Removed after the first desugarer before the type checker)
    • Throw
    • TryAtomicExpr
  • FnExpr
  • abstract LetExpr
    • LetFn
    • LocalVarDecl
  • GeneratedExpr (Plan: Removed after the first desugarer before the type checker)
  • abstract SimpleExpr
    • SubscriptExpr
    • abstract Primary
      • abstract LiteralExpr
        • abstract NumberLiteralExpr
          • FloatLiteralExpr
          • IntLiteralExpr
        • CharLiteralExpr
        • StringLiteralExpr
        • VoidLiteralExpr
      • VarRef
      • _RewriteObjectRef (Created at disambiguation/typechecker pass)
      • abstract AbstractFieldRef
        • FieldRef
        • RewriteFieldRef
          • Created by interpreter.rewrite.Desugarer
          • Some VarRef is replaced with _RewriteFieldRef
      • abstract FunctionalRef
        • _RewriteInstantiatedFnRefs
          • Generated by the typechecker in the first pass and removed in the second. Indicates that a FnRef? might need to be instantiated by one of several numbers of static args.
        • FnRef
          • Parser generates a FnRef only when an identifier is immediately followed by static arguments.
          • compiler.disambiguator.ExprDisambiguator generates some FnRef.
          • interpreter.rewrite.RewriteInAbsenceOfTypeInfo removes FnRef. If a FnRef node has static arguments, it is replaced with _RewriteFnRef. Otherwise, it is replaced with VarRef or FieldRef.
        • _RewriteFnRef (Created by interpreter.rewrite.RewriteInAbsenceOfTypeInfo)
        • OpRef
          • _RewriteInstantiatedOpRefs Similar to _RewriteInstantiatedFnRefs, this node is used for inferring static arguments to an Op call. This node only exists between the first and second passes of the typechecker.
      • abstract AppExpr
        • abstract Juxt
          • LooseJuxt (Removed after type checking)
          • TightJuxt (Removed after type checking)
        • _RewriteFnApp (Created during type checking, a function application)
        • OpExpr (Desugared in the first desugarer but not removed before the type checker)
        • ChainExpr
        • CoercionInvocation (NYI: Maybe created after type checking)
        • MethodInvocation
      • MathPrimary (Plan: Removed after type checking)
      • abstract ArrayExpr
        • ArrayElement
        • ArrayElements