Class ParsedModuleTransientData

java.lang.Object
org.ek9lang.compiler.ParsedModuleTransientData

public class ParsedModuleTransientData extends Object
Used to hold just the transient data that will be used by listeners and visitors and SymbolsAndScopes.
  • Constructor Details

    • ParsedModuleTransientData

      public ParsedModuleTransientData()
  • Method Details

    • recordDirective

      public void recordDirective(Directive directive)
      When processing EK9 source code the developer now has some ability to use '@directives'. These are aimed at code compilation, instrumentation and error checking. This means that for compiler development, we can reduce the number of Java unit tests and specific coding (to some extent), by adding in our expectations just before we write so erroneous code (to check the compiler). This means that the test and the deliberated defective code as co-located.
    • getDirectives

      public List<Directive> getDirectives(DirectiveType type, CompilationPhase phase)
      Provide access to any directives recorded of a specific type and compilation phase.
    • getDirectives

      public List<Directive> getDirectives(DirectiveType type)
      Provide access to any directives recorded.
    • recordScope

      public void recordScope(org.antlr.v4.runtime.tree.ParseTree node, IScope withScope)
      Record a particular node context during listen/visit of a context with a particular scope.
    • getRecordedScope

      public IScope getRecordedScope(org.antlr.v4.runtime.tree.ParseTree node)
      Locate and return a recorded scope against part of the parse tree, this may return null if nothing has been recorded.
    • recordSymbol

      public void recordSymbol(org.antlr.v4.runtime.tree.ParseTree node, ISymbol symbol, Module module)
      Record a particular node context with a particular symbol.
    • getRecordedSymbol

      public ISymbol getRecordedSymbol(org.antlr.v4.runtime.tree.ParseTree node)
      Locate and return a recorded symbol against part of the parse tree, this may return null if nothing has been recorded.