public void walk(ParseTreeListener listener, ParseTree t) {if ( t instanceof ErrorNode) {listener.visitErrorNode((ErrorNode)t);return;}else if ( t instanceof TerminalNode) {listener.visitTerminal((TerminalNode)t);return;}RuleNode r = (RuleNode)t;enterRule(listener, r);int n = r.getChildCount();for (int i = 0; i<n; i++) {walk(listener, r.getChild(i));}exitRule(listener, r);}
public virtual void Walk(IParseTreeListener listener, IParseTree t){if (t is IErrorNode){listener.VisitErrorNode((IErrorNode)t);return;}else{if (t is ITerminalNode){listener.VisitTerminal((ITerminalNode)t);return;}}IRuleNode r = (IRuleNode)t;EnterRule(listener, r);int n = r.ChildCount;for (int i = 0; i < n; i++){Walk(listener, r.GetChild(i));}ExitRule(listener, r);}