Class EnclosingPropertyInitialiser

java.lang.Object
org.ek9lang.compiler.support.EnclosingPropertyInitialiser
All Implemented Interfaces:
Function<org.antlr.v4.runtime.tree.ParseTree, Optional<PropertyInitialiser>>

public final class EnclosingPropertyInitialiser extends Object implements Function<org.antlr.v4.runtime.tree.ParseTree, Optional<PropertyInitialiser>>
THE "is this node inside a property's initialiser, and which one?" - the PropertyInitialiser a node is in. Use this wherever a check depends on a property initialiser - do not re-walk the tree for it. Hold an instance.
  • Constructor Details

    • EnclosingPropertyInitialiser

      public EnclosingPropertyInitialiser()
  • Method Details

    • apply

      public Optional<PropertyInitialiser> apply(org.antlr.v4.runtime.tree.ParseTree node)
      The property initialiser this node is in, if any. The walk stops where code no longer runs as part of the initialiser: a block of statements (a method body), an aggregate body (a dynamic class declared in the initialiser has its own), and a dynamic function's body, which runs when the function is called. A dynamic function's or class's capture list is evaluated by the initialiser, so the walk passes through those.
      Specified by:
      apply in interface Function<org.antlr.v4.runtime.tree.ParseTree, Optional<PropertyInitialiser>>