Class CompileClassifier

java.lang.Object
org.ek9lang.compiler.fuzz.CompileClassifier

final class CompileClassifier extends Object
Handles the compile-check-classify pipeline for fuzz-generated sources. Manages ANTLR parse gate, in-process compilation through PRE_IR_CHECKS, error code extraction, and crash classification. Used by all 5 strands in FuzzRunner.
  • Constructor Details

    • CompileClassifier

      CompileClassifier(Path crashDir, FuzzReporter reporter)
      Create a new compile classifier.
      Parameters:
      crashDir - directory to save crash-triggering source files
      reporter - the fuzz reporter for saving crash files
  • Method Details

    • compileAndRecord

      CompileClassifier.CompileResult compileAndRecord(List<CompilableSource> compilableSources, List<NamedSource> namedSources, SharedThreadContext<CompilableProgram> sharedContext, FileHandling fileHandling, CompilerReporter compilerReporter, FuzzStatistics stats, Set<String> constructs, Set<String> controlFlow)
      Compile the sources and record results into the statistics collector. Delegates to the full overload with a null templateId and "S1" strand.
    • compileAndRecord

      CompileClassifier.CompileResult compileAndRecord(List<CompilableSource> compilableSources, List<NamedSource> namedSources, SharedThreadContext<CompilableProgram> sharedContext, FileHandling fileHandling, CompilerReporter compilerReporter, FuzzStatistics stats, Set<String> constructs, Set<String> controlFlow, String templateId, String strandId)
      Compile the sources through PACKAGING_POST_PROCESSING and record outcomes. On success, extracts error codes and duplicate variable info. On crash, classifies as known limitation or real bug and saves crash files.
      Parameters:
      compilableSources - the compilable sources to compile
      namedSources - the original named sources (for crash file saving)
      sharedContext - the per-worker shared compiler context
      fileHandling - the per-worker file handling instance
      compilerReporter - the per-worker compiler reporter
      stats - the shared statistics collector
      constructs - construct tags for crash attribution
      controlFlow - control flow tags for crash attribution
      templateId - optional template identifier for crash attribution
      strandId - the strand identifier for per-strand phase tracking
      Returns:
      compile result with duplicate infos and deepest phase reached
    • extractErrorCodes

      Set<String> extractErrorCodes(List<CompilableSource> compilableSources)
      Extract all error codes from the compiled sources' error listeners.
    • quickParse

      boolean quickParse(String source)
      Quick ANTLR parse gate: returns true if the source parses without errors. Used to avoid sending unparseable sources through the full compilation pipeline.
    • buildCompilableSources

      List<CompilableSource> buildCompilableSources(List<NamedSource> namedSources)
      Build compilable sources from the named source list, each marked as dev.
    • isKnownLimitation

      static boolean isKnownLimitation(Throwable ex)
      Check if an exception is a known compiler limitation rather than a real bug. Known limitations include unimplemented features that throw IllegalArgumentException with "not implemented" in the message.