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.booleanTrue when a step has already rendered the diagnostics.voidConvenience: append a non-fatal ERROR diagnostic with source location.voidConvenience: append a 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.voidSignal that a pipeline step has already rendered the diagnostics (e.g.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. -
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. -
markDiagnosticsRendered
public void markDiagnosticsRendered()Signal that a pipeline step has already rendered the diagnostics (e.g.DiagnosticReport), soChainCompilershould not print them a second time. -
diagnosticsRendered
public boolean diagnosticsRendered()True when a step has already rendered the diagnostics.
-