Class HaltAndCatchFire<T>

java.lang.Object
ca.mcscert.jpipe.compiler.model.Transformation<T,T>
ca.mcscert.jpipe.compiler.model.Checker<T>
ca.mcscert.jpipe.compiler.steps.checkers.HaltAndCatchFire<T>
Type Parameters:
T - type of model used at that point (only useful for chaining purpose).

public final class HaltAndCatchFire<T> extends Checker<T>
Converts accumulated non-fatal errors into a fatal signal, aborting the pipeline at the next step boundary.

This checker is part of the "late error management" design: lexing and parsing report errors as non-fatal diagnostics so that both steps always run. Placing this checker after them causes the pipeline to abort — via the ctx.hasFatalErrors() fast-fail in Transformation.fire(I, CompilationContext) — before downstream steps attempt to build or render a model from a broken parse tree.

The name is a reference to the HCF instruction in IBM System/360 (as well as a good TV show).

  • Constructor Details

    • HaltAndCatchFire

      public HaltAndCatchFire()
  • Method Details

    • check

      protected void check(T input, CompilationContext ctx)
      Description copied from class: Checker
      Perform the check. Must not modify input. Non-fatal issues should be reported via ctx.error() rather than thrown; throw (or call ctx.fatal()) only for unrecoverable failures.
      Specified by:
      check in class Checker<T>
      Parameters:
      input - the value to inspect.
      ctx - compilation context for reporting diagnostics.