Class Lexer

java.lang.Object
ca.mcscert.jpipe.compiler.model.Transformation<org.antlr.v4.runtime.CharStream, org.antlr.v4.runtime.CommonTokenStream>
ca.mcscert.jpipe.compiler.steps.transformations.Lexer

public final class Lexer extends Transformation<org.antlr.v4.runtime.CharStream, org.antlr.v4.runtime.CommonTokenStream>
Delegate to ANTLR the task of "lexing" the character stream into relevant tokens.

Lexing errors are reported as non-fatal diagnostics via the CompilationContext, allowing subsequent steps (e.g. the parser) to still run and accumulate further errors before the pipeline decides to abort.

  • Constructor Details

    • Lexer

      public Lexer()
  • Method Details

    • run

      protected org.antlr.v4.runtime.CommonTokenStream run(org.antlr.v4.runtime.CharStream input, CompilationContext ctx)
      Description copied from class: Transformation
      Business logic of this step. Must not return null; may throw any exception. Use ctx to report non-fatal diagnostics or inspect previously accumulated errors.
      Specified by:
      run in class Transformation<org.antlr.v4.runtime.CharStream, org.antlr.v4.runtime.CommonTokenStream>
      Parameters:
      input - the value produced by the previous step.
      ctx - compilation context carrying the source path and diagnostic bag.
      Returns:
      the transformed value — never null.