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