Class Parser
java.lang.Object
ca.mcscert.jpipe.compiler.model.Transformation<org.antlr.v4.runtime.CommonTokenStream, org.antlr.v4.runtime.tree.ParseTree>
ca.mcscert.jpipe.compiler.steps.transformations.Parser
public final class Parser
extends Transformation<org.antlr.v4.runtime.CommonTokenStream, org.antlr.v4.runtime.tree.ParseTree>
Delegate to ANTLR the transformation of a token stream into a parse tree.
Parsing errors are reported as non-fatal diagnostics via the
CompilationContext, allowing the pipeline to accumulate both lexing
and parsing errors before deciding 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.tree.ParseTreerun(org.antlr.v4.runtime.CommonTokenStream tokens, CompilationContext ctx) Business logic of this step.
-
Constructor Details
-
Parser
public Parser()
-
-
Method Details
-
run
protected org.antlr.v4.runtime.tree.ParseTree run(org.antlr.v4.runtime.CommonTokenStream tokens, 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.CommonTokenStream, org.antlr.v4.runtime.tree.ParseTree>- Parameters:
tokens- the value produced by the previous step.ctx- compilation context carrying the source path and diagnostic bag.- Returns:
- the transformed value — never
null.
-