T - The return type of the visit operation. Use Void for
operations with no return type.public class CalculatorBaseVisitor<T> extends org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<T> implements CalculatorVisitor<T>
CalculatorVisitor,
which can be extended to create a visitor which only needs to handle a subset
of the available methods.| Constructor and Description |
|---|
CalculatorBaseVisitor() |
| Modifier and Type | Method and Description |
|---|---|
T |
visitAddSub(CalculatorParser.AddSubContext ctx)
Visit a parse tree produced by the
AddSub
labeled alternative in CalculatorParser.expr(). |
T |
visitAssign(CalculatorParser.AssignContext ctx)
Visit a parse tree produced by the
assign
labeled alternative in CalculatorParser.statement(). |
T |
visitBlank(CalculatorParser.BlankContext ctx)
Visit a parse tree produced by the
blank
labeled alternative in CalculatorParser.statement(). |
T |
visitId(CalculatorParser.IdContext ctx)
Visit a parse tree produced by the
id
labeled alternative in CalculatorParser.expr(). |
T |
visitInt(CalculatorParser.IntContext ctx)
Visit a parse tree produced by the
int
labeled alternative in CalculatorParser.expr(). |
T |
visitMulDiv(CalculatorParser.MulDivContext ctx)
Visit a parse tree produced by the
MulDiv
labeled alternative in CalculatorParser.expr(). |
T |
visitParenthese(CalculatorParser.ParentheseContext ctx)
Visit a parse tree produced by the
parenthese
labeled alternative in CalculatorParser.expr(). |
T |
visitPrint(CalculatorParser.PrintContext ctx)
Visit a parse tree produced by the
print
labeled alternative in CalculatorParser.statement(). |
T |
visitProgram(CalculatorParser.ProgramContext ctx)
Visit a parse tree produced by
CalculatorParser.program(). |
aggregateResult, defaultResult, shouldVisitNextChild, visit, visitChildren, visitErrorNode, visitTerminalpublic T visitProgram(CalculatorParser.ProgramContext ctx)
CalculatorParser.program().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitProgram in interface CalculatorVisitor<T>ctx - the parse treepublic T visitPrint(CalculatorParser.PrintContext ctx)
print
labeled alternative in CalculatorParser.statement().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitPrint in interface CalculatorVisitor<T>ctx - the parse treepublic T visitAssign(CalculatorParser.AssignContext ctx)
assign
labeled alternative in CalculatorParser.statement().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitAssign in interface CalculatorVisitor<T>ctx - the parse treepublic T visitBlank(CalculatorParser.BlankContext ctx)
blank
labeled alternative in CalculatorParser.statement().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitBlank in interface CalculatorVisitor<T>ctx - the parse treepublic T visitMulDiv(CalculatorParser.MulDivContext ctx)
MulDiv
labeled alternative in CalculatorParser.expr().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitMulDiv in interface CalculatorVisitor<T>ctx - the parse treepublic T visitAddSub(CalculatorParser.AddSubContext ctx)
AddSub
labeled alternative in CalculatorParser.expr().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitAddSub in interface CalculatorVisitor<T>ctx - the parse treepublic T visitParenthese(CalculatorParser.ParentheseContext ctx)
parenthese
labeled alternative in CalculatorParser.expr().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitParenthese in interface CalculatorVisitor<T>ctx - the parse treepublic T visitId(CalculatorParser.IdContext ctx)
id
labeled alternative in CalculatorParser.expr().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitId in interface CalculatorVisitor<T>ctx - the parse treepublic T visitInt(CalculatorParser.IntContext ctx)
int
labeled alternative in CalculatorParser.expr().
The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.
visitInt in interface CalculatorVisitor<T>ctx - the parse treeCopyright © 2025. All rights reserved.