From c716a87544d6f906b5b42b44efa8e56beb8e2ed9 Mon Sep 17 00:00:00 2001 From: parrt Date: Tue, 3 Jan 2012 11:05:40 -0800 Subject: [PATCH] move method down in file [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9791] --- .../Java/src/org/antlr/v4/runtime/Parser.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/Parser.java b/runtime/Java/src/org/antlr/v4/runtime/Parser.java index 3156ca6d5..90688e7a9 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/Parser.java +++ b/runtime/Java/src/org/antlr/v4/runtime/Parser.java @@ -227,18 +227,6 @@ public abstract class Parser extends Recognizer localctx, int altNum) { - // if we have new localctx, make sure we replace existing ctx - // that is previous child of parse tree - if ( buildParseTrees && _ctx != localctx ) { - ParserRuleContext parent = (ParserRuleContext)_ctx.parent; - parent.removeLastChild(); - if ( parent!=null ) parent.addChild(localctx); - } - _ctx = localctx; - _ctx.altNum = altNum; - } - /** Consume the current symbol and return it. E.g., given the following * input with A being the current lookahead symbol: * @@ -302,6 +290,18 @@ public abstract class Parser extends Recognizer)_ctx.parent; } + public void enterOuterAlt(ParserRuleContext localctx, int altNum) { + // if we have new localctx, make sure we replace existing ctx + // that is previous child of parse tree + if ( buildParseTrees && _ctx != localctx ) { + ParserRuleContext parent = (ParserRuleContext)_ctx.parent; + parent.removeLastChild(); + if ( parent!=null ) parent.addChild(localctx); + } + _ctx = localctx; + _ctx.altNum = altNum; + } + public ParserRuleContext getInvokingContext(int ruleIndex) { ParserRuleContext p = _ctx; while ( p!=null ) {