Class CompileClassifier
java.lang.Object
org.ek9lang.compiler.fuzz.CompileClassifier
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordResult of a compilation: duplicate info plus the deepest phase reached.(package private) static final recordInformation about a duplicate variable detected during compilation (E50050).(package private) static final recordResult of a quick parse: whether the source parsed and the error listener with any errors. -
Constructor Summary
ConstructorsConstructorDescriptionCompileClassifier(Path crashDir, FuzzReporter reporter) Create a new compile classifier. -
Method Summary
Modifier and TypeMethodDescription(package private) List<CompilableSource> buildCompilableSources(List<NamedSource> namedSources) Build compilable sources from the named source list.(package private) CompileClassifier.CompileResultcompileAndRecord(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.(package private) CompileClassifier.CompileResultcompileAndRecord(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.extractErrorCodes(List<CompilableSource> compilableSources) Extract all error codes from the compiled sources' error listeners.(package private) static booleanhasDevSources(List<NamedSource> namedSources) Check if any named source in the list is marked as dev.(package private) static booleanCheck if an exception is a known compiler limitation rather than a real bug.(package private) CompileClassifier.ParseResultquickParse(String source) Quick ANTLR parse gate: returns a ParseResult with the parse outcome and error listener.
-
Constructor Details
-
CompileClassifier
CompileClassifier(Path crashDir, FuzzReporter reporter) Create a new compile classifier.- Parameters:
crashDir- directory to save crash-triggering source filesreporter- the fuzz reporter for saving crash files
-
-
Method Details
-
extractErrorCodes
Extract all error codes from the compiled sources' error listeners. -
quickParse
Quick ANTLR parse gate: returns a ParseResult with the parse outcome and error listener. Used to avoid sending unparseable sources through the full compilation pipeline. Callers should callCompileClassifier.ParseResult.harvestErrorCodes(FuzzStatistics)to capture any parse-phase error codes before discarding the result. -
buildCompilableSources
Build compilable sources from the named source list. Sources marked as dev in the NamedSource are set as dev CompilableSources. -
hasDevSources
Check if any named source in the list is marked as dev. -
isKnownLimitation
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.