Merge branch 'master' into tree-patterns

This commit is contained in:
Terence Parr 2013-11-20 14:20:09 -08:00
commit 02f937b115
2 changed files with 5 additions and 2 deletions

View File

@ -359,7 +359,11 @@ LeftRecursiveRuleFunction(currentRule,code,locals,ruleCtx,altLabelCtxs,
<ruleCtx>
<altLabelCtxs:{l | <altLabelCtxs.(l)>}; separator="\n">
<if(currentRule.modifiers)><currentRule.modifiers:{f | <f> }><else>public final <endif><currentRule.ctxType> <currentRule.name>(int _p<currentRule.args:{a | , <a>}>) throws RecognitionException {
<if(currentRule.modifiers)><currentRule.modifiers:{f | <f> }><else>public final <endif><currentRule.ctxType> <currentRule.name>(<currentRule.args; separator=", ">) throws RecognitionException {
return <currentRule.name>(0<currentRule.args:{a | , <a.name>}>);
}
private <currentRule.ctxType> <currentRule.name>(int _p<currentRule.args:{a | , <a>}>) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
<currentRule.ctxType> _localctx = new <currentRule.ctxType>(_ctx, _parentState<currentRule.args:{a | , <a.name>}>);

View File

@ -73,7 +73,6 @@ public class TestLeftRecursion extends BaseTest {
@Test public void testDirectCallToLeftRecursiveRule() throws Exception {
String grammar =
"grammar T;\n" +
"@parser::members{public AContext a() { return a(0); }}\n" +
"a @after {System.out.println($ctx.toStringTree(this));} : a ID\n" +
" | ID" +
" ;\n" +