Class CompilationContext
java.lang.Object
ca.mcscert.jpipe.compiler.model.CompilationContext
Mutable context threaded through every step of a compilation pipeline.
Carries the source file path (for error reporting) and a Diagnostic
bag that steps may append to without aborting the pipeline immediately. Use
hasFatalErrors() to decide whether to stop early, and
diagnostics() to inspect the full list at the end.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUnmodifiable view of all diagnostics in report order.voidConvenience: append a non-fatal ERROR diagnostic with source location.voidConvenience: append a non-fatal ERROR diagnostic.voidConvenience: append a coded non-fatal ERROR diagnostic with source location.voidConvenience: append a coded non-fatal ERROR diagnostic.Ordered list of actions that occurred during interpretation.voidConvenience: append a FATAL diagnostic with source location.voidConvenience: append a FATAL diagnostic.booleanTrue if any ERROR or FATAL diagnostic has been reported.booleanTrue if any FATAL diagnostic has been reported.voidrecordActions(List<ExecutedAction> actions) Record the ordered list of actions that occurred during interpretation.voidrecordStat(String key, long value) Record a named numeric statistic produced during compilation.voidreport(Diagnostic diagnostic) Append a pre-built diagnostic.Path to the input file being compiled.stats()Unmodifiable view of all recorded statistics in insertion order.
-
Field Details
-
STAT_COMMANDS_TOTAL
Total number of commands in the action list.- See Also:
-
STAT_COMMANDS_MACROS
Number of macro commands in the action list.- See Also:
-
STAT_COMMANDS_DEFERRALS
Total number of execution-engine deferral rounds.- See Also:
-
-
Constructor Details
-
CompilationContext
-
-
Method Details
-
sourcePath
Path to the input file being compiled. -
report
Append a pre-built diagnostic. -
error
Convenience: append a non-fatal ERROR diagnostic. -
error
Convenience: append a non-fatal ERROR diagnostic with source location. -
error
Convenience: append a coded non-fatal ERROR diagnostic.- Parameters:
code- stable kebab-case identifier, seeDiagnosticCodes.message- human-readable description, without the code.
-
error
Convenience: append a coded non-fatal ERROR diagnostic with source location.- Parameters:
code- stable kebab-case identifier, seeDiagnosticCodes.line- 1-based source line.column- 0-based column offset.message- human-readable description, without the code.
-
fatal
Convenience: append a FATAL diagnostic. -
fatal
Convenience: append a FATAL diagnostic with source location. -
hasErrors
public boolean hasErrors()True if any ERROR or FATAL diagnostic has been reported. -
hasFatalErrors
public boolean hasFatalErrors()True if any FATAL diagnostic has been reported. -
diagnostics
Unmodifiable view of all diagnostics in report order. -
recordStat
Record a named numeric statistic produced during compilation. -
stats
-
recordActions
Record the ordered list of actions that occurred during interpretation. -
executedActions
Ordered list of actions that occurred during interpretation.
-