How to write a antlr4 visitor
问题 I am trying to write a visitor for a simple antlr4 grammar - I am adapting from the following example from the book: * directory tour * example: LabeledExpr.g4, EvalVisitor.java, Calc.java Based on the java code, I have written the following go code: package main import ( "os" "./parser" "github.com/antlr/antlr4/runtime/Go/antlr" ) type evalVisitor struct { *parser.BaseLabeledExprVisitor } func (v *evalVisitor) VisitAddSub(c *parser.AddSubContext) int { left := v.Visit(c.Expr(0)) right := v