Class CompilationPipeline

java.lang.Object
io.github.protasm.jvmud.compiler.pipeline.CompilationPipeline

public final class CompilationPipeline extends Object
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 Details

    • CompilationPipeline

      public CompilationPipeline(String parentInternalName)
      Creates a pipeline whose generated classes inherit from the supplied JVM internal class name.
      Parameters:
      parentInternalName - JVM internal name such as java/lang/Object
    • CompilationPipeline

      public CompilationPipeline(String parentInternalName, RuntimeContext runtimeContext)
      Creates a pipeline using an explicit generated-code runtime context.
      Parameters:
      parentInternalName - JVM internal name used as the generated superclass
      runtimeContext - 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

      public CompilationResult run(String source)
      Compiles source text with default parser options.
    • run

      public CompilationResult run(String source, ParserOptions parserOptions)
      Compiles source text with explicit parser options.
    • run

      public CompilationResult run(Path sourcePath, String source, ParserOptions parserOptions)
      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, or null for in-memory source
      source - LPC source text
      sourceName - mudlib-relative or internal source name, if known
      displayPath - path shown in diagnostics, if different from sourceName
      parserOptions - parser feature options