Update ParserFactory.getLL1EBNFBlock to ensure it is correct even if additional ATN optimizations are implemented

This commit is contained in:
Sam Harwell 2014-06-03 07:31:47 -05:00
parent 31a3b59576
commit 95596b4a52
1 changed files with 4 additions and 2 deletions

View File

@ -284,10 +284,12 @@ public class ParserFactory extends DefaultOutputModelFactory {
else c = new LL1OptionalBlock(this, ebnfRoot, alts);
break;
case ANTLRParser.CLOSURE :
c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
else c = getComplexEBNFBlock(ebnfRoot, alts);
break;
case ANTLRParser.POSITIVE_CLOSURE :
c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts);
if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts);
else c = getComplexEBNFBlock(ebnfRoot, alts);
break;
}
return c;