Class CompilationPipeline
java.lang.Object
io.github.protasm.jvmud.compiler.pipeline.CompilationPipeline
Coordinates the LPC compiler stages for one source unit.
The pipeline is the compiler facade used by host tooling. It preprocesses and scans source,
parses an LPC object, resolves inherited source, performs semantic analysis, lowers to typed IR,
and optionally produces JVM bytecode. Stage failures are returned as CompilationProblem
values rather than thrown for ordinary source errors.
-
Constructor Summary
ConstructorsConstructorDescriptionCompilationPipeline(String parentInternalName) Creates a pipeline whose generated classes inherit from the supplied JVM internal class name.CompilationPipeline(String parentInternalName, RuntimeContext runtimeContext) Creates a pipeline using an explicit generated-code runtime context.CompilationPipeline(String parentInternalName, RuntimeContext runtimeContext, CompilationObserver observer) Creates a pipeline with stage observation. -
Method Summary
Modifier and TypeMethodDescriptionCompiles source text with default parser options.run(String source, ParserOptions parserOptions) Compiles source text with explicit parser options.run(Path sourcePath, String source, ParserOptions parserOptions) Compiles source loaded from a path with explicit parser options.run(Path sourcePath, String source, String sourceName, String displayPath, ParserOptions parserOptions) Compiles source with the display metadata used for diagnostics and inherited-source lookup.
-
Constructor Details
-
CompilationPipeline
Creates a pipeline whose generated classes inherit from the supplied JVM internal class name.- Parameters:
parentInternalName- JVM internal name such asjava/lang/Object
-
CompilationPipeline
Creates a pipeline using an explicit generated-code runtime context.- Parameters:
parentInternalName- JVM internal name used as the generated superclassruntimeContext- runtime helper context used by parser and semantic analysis
-
CompilationPipeline
public CompilationPipeline(String parentInternalName, RuntimeContext runtimeContext, CompilationObserver observer) Creates a pipeline with stage observation.- Parameters:
observer- callback sink for scan, parse, analyze, lower, and compile progress
-
-
Method Details
-
run
Compiles source text with default parser options. -
run
Compiles source text with explicit parser options. -
run
Compiles source loaded from a path with explicit parser options. -
run
public CompilationResult run(Path sourcePath, String source, String sourceName, String displayPath, ParserOptions parserOptions) Compiles source with the display metadata used for diagnostics and inherited-source lookup.- Parameters:
sourcePath- real filesystem path, ornullfor in-memory sourcesource- LPC source textsourceName- mudlib-relative or internal source name, if knowndisplayPath- path shown in diagnostics, if different fromsourceNameparserOptions- parser feature options
-