Class ReplCompiler

java.lang.Object
org.ek9lang.cli.ReplCompiler

public final class ReplCompiler extends Object
Handles compilation of REPL input to bytecode. Uses serialization to provide a fresh bootstrap context for each compilation.
  • Constructor Details

  • Method Details

    • compile

      public ReplCompileResult compile(String source, int errorLevel, boolean strictMode)
      Compile the assembled EK9 source.
    • compile

      public ReplCompileResult compile(String source, int errorLevel)
      Compile with default non-strict mode.
    • execute

      public String execute(ReplCompileResult result)
      Execute the compiled bytecode and return captured output.
    • locateSymbol

      public Optional<ISymbol> locateSymbol(String name, int line, int column)
      Look up a symbol by name from the last successful compilation.
    • locateSymbolByName

      public Optional<ISymbol> locateSymbolByName(String name, int lineInSource, int column)
      Symbol lookup by name with position info.
    • locateSymbolByName

      public Optional<ISymbol> locateSymbolByName(String name)
      Simple symbol lookup by name only.
    • getAllSymbols

      public List<ISymbol> getAllSymbols(String prefix)
      Get all symbols from all modules that start with the given prefix.
    • getLocalVariables

      public List<ISymbol> getLocalVariables(String prefix, String scopeName)
      Get local variables from a scope matching the prefix.
    • cleanup

      public void cleanup()
      Clean up temporary files.