Interface CompilerAccess
public interface CompilerAccess
Shared compiler surface for MCP tools, Oracle extractors, AI sessions, and the IDE.
Provides the minimal gateway every consumer needs: access to the compiled program,
the workspace, and the ability to trigger compilation. All Oracle tools (current and
future) work from getLastCompiledProgram() and getWorkspace() —
they walk the symbol table, scope chains, and IR directly.
In standalone ek9 -mcp mode, McpCompilerService implements this
with its own internal state. In ek9 -ide mode, the IDE's compiler service
implements it, and the MCP server delegates to it — one CompilableProgram
per JVM, shared by all agents.
-
Method Summary
Modifier and TypeMethodDescriptioncollectDiagnostics(int errorLevel) Collect structured diagnostics from the most recent compilation.booleancompile(CompilerFlags flags) Compile the workspace with the given flags.Get the compiled program from the most recent compilation.Get the current workspace containing all known source files.booleanCheck whether the most recent compilation produced any errors.voidinitializeWorkspace(List<String> roots) Initialize the workspace from root directories.
-
Method Details
-
initializeWorkspace
-
compile
Compile the workspace with the given flags.- Returns:
- true if compilation succeeded without errors
-
getLastCompiledProgram
SharedThreadContext<CompilableProgram> getLastCompiledProgram()Get the compiled program from the most recent compilation. This is the universal gateway for all Oracle tools — they resolve symbols, walk scopes, and traverse IR from this context.- Returns:
- the shared thread context, or null if no compilation has occurred
-
getWorkspace
Workspace getWorkspace()Get the current workspace containing all known source files. -
collectDiagnostics
Collect structured diagnostics from the most recent compilation.- Parameters:
errorLevel- controls rich error message inclusion (0=minimal, 3+=rich)
-
hasErrors
boolean hasErrors()Check whether the most recent compilation produced any errors.
-