use of org.antlr.v4.codegen.model.LL1StarBlockSingleAlt in project antlr4 by antlr.
the class ParserFactory method getLL1EBNFBlock.
@Override
public Choice getLL1EBNFBlock(GrammarAST ebnfRoot, List<CodeBlockForAlt> alts) {
int ebnf = 0;
if (ebnfRoot != null)
ebnf = ebnfRoot.getType();
Choice c = null;
switch(ebnf) {
case ANTLRParser.OPTIONAL:
if (alts.size() == 1)
c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts);
else
c = new LL1OptionalBlock(this, ebnfRoot, alts);
break;
case ANTLRParser.CLOSURE:
if (alts.size() == 1)
c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
else
c = getComplexEBNFBlock(ebnfRoot, alts);
break;
case ANTLRParser.POSITIVE_CLOSURE:
if (alts.size() == 1)
c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts);
else
c = getComplexEBNFBlock(ebnfRoot, alts);
break;
}
return c;
}
Aggregations