Class CompilerFactory
java.lang.Object
ca.mcscert.jpipe.compiler.CompilerFactory
Assembles a
Compiler from a CompilationConfig by wiring the
appropriate pipeline steps.
Not all formats are implemented yet. Unsupported combinations throw
UnsupportedOperationException at factory time, before any file I/O
occurs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Compilerbuild(CompilationConfig config, OutputStream stdout) Build a process-mode compiler from the given configuration.static CompilerbuildDiagnosticCompiler(OutputStream stdout) Build a diagnostic-mode compiler that parses the source and produces a human-readable report without exporting any model.static ChainBuilder<InputStream, List<Command>> Parsing chain: reads a source file, lexes, parses, and extracts the action list.static Transformation<List<Command>, Unit> Full unit builder: extends the parsing chain with model construction, consistency checking, and completeness checking.
-
Method Details
-
build
Build a process-mode compiler from the given configuration.- Parameters:
config- the compilation configuration.stdout- stream to use when the output target isCompilationConfig.STDOUT.- Returns:
- a ready-to-use
Compiler. - Throws:
UnsupportedOperationException- if the requested format is not yet implemented.
-
buildDiagnosticCompiler
Build a diagnostic-mode compiler that parses the source and produces a human-readable report without exporting any model.- Parameters:
stdout- stream to use when the output target isCompilationConfig.STDOUT.- Returns:
- a ready-to-use
Compiler.
-
parsingChain
Parsing chain: reads a source file, lexes, parses, and extracts the action list. Aborts on any syntax error viaHaltAndCatchFire. -
unitBuilder
Full unit builder: extends the parsing chain with model construction, consistency checking, and completeness checking.
-