示例#1
0
 public override Choice GetComplexEBNFBlock(GrammarAST ebnfRoot, IList<CodeBlockForAlt> alts)
 {
     int ebnf = 0;
     if (ebnfRoot != null)
         ebnf = ebnfRoot.Type;
     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;
 }