Class MutatedOnlyVariables.Collector

java.lang.Object
org.ek9lang.compiler.phase5.MutatedOnlyVariables.Collector
Enclosing class:
MutatedOnlyVariables

final class MutatedOnlyVariables.Collector extends Object
One source's collection. Callables nest (a dynamic class or function inside a method), so their returning variables are kept on a stack and an assignment is matched against the innermost.
  • Method Details

    • variableDeclared

      void variableDeclared(EK9Parser.VariableDeclarationContext ctx, ISymbol symbol)
    • enterCallable

      void enterCallable(ISymbol symbol)
      A method, operator, function or dynamic function is entered; only one with a returning variable is followed. Its returning variable's initialiser is read when the walk reaches the declaration (variableDeclared(EK9Parser.VariableDeclarationContext, ISymbol)).
    • enterCallable

      void enterCallable(ISymbol symbol, boolean inheritsBody)
      As enterCallable(ISymbol); a dynamic function with no body of its own (inheritsBody) is also queued for the inherited-rules step of both derivations (MutatedOnlyVariables.inheritingBodies).
    • exitCallable

      void exitCallable()
    • assignment

      A pointer assignment to the innermost callable's returning variable is a source of what it returns.
    • forLoop

      void forLoop(EK9Parser.ForLoopContext ctx)
      A for item in items loop: its variable is an ELEMENT of the iterated expression - a view of it, as items.iterator().next() is - so the expression is the variable's source.