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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Transformation
Transformation.Step<I,O> -
Field Summary
Fields inherited from class Transformation
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.antlr.v4.runtime.CommonTokenStreamrun(org.antlr.v4.runtime.CharStream input, CompilationContext ctx) Business logic of this step.
-
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:TransformationBusiness logic of this step. Must not returnnull; may throw any exception. Usectxto report non-fatal diagnostics or inspect previously accumulated errors.- Specified by:
runin classTransformation<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.
-