Class InjectionOrderingOrError

java.lang.Object
org.ek9lang.compiler.phase5.InjectionOrderingOrError
All Implemented Interfaces:
Consumer<org.antlr.v4.runtime.tree.ParseTree>

final class InjectionOrderingOrError extends Object implements Consumer<org.antlr.v4.runtime.tree.ParseTree>
Validates ordering in application blocks (E08200). Walks children in source order, maintaining a growing set of available registered types. For register statements: checks injection dependencies are already registered above. For block statements: checks that any called functions/constructors whose types have injection fields have those injection types already registered above, and that an injection declared in the application body (svc as Svc!) comes after the registration of its type.

For every statement - a registration or a block statement - it also records what that statement starts running (its calls, including a registration's constructor, arguments and aspects), with the types available at that point, so TransitiveInjectionOrderingOrError can follow each through the call graph once it is built: anything reachable that injects a type registered later is E08200 at the statement (decision 4, docs/language-design/EK9_ABSENCE_UNOBSERVABLE.md family E).

  • Constructor Details

  • Method Details

    • accept

      public void accept(org.antlr.v4.runtime.tree.ParseTree ctx)
      Specified by:
      accept in interface Consumer<org.antlr.v4.runtime.tree.ParseTree>