/// <summary> /// 2 <PList> ::= <Vn> "::=" <VList> ";" <PList>; /// <para>3 <PList> ::= null;</para> /// </summary> /// <param name="builder"></param> /// <param name="syntaxTree"></param> private static void GetFormattedPList(StringBuilder builder, SyntaxTree <EnumTokenTypeCG, EnumVTypeCG, TreeNodeValueCG> syntaxTree) {//<PList> ::= <Vn> "::=" <VList> ";" <PList> | null; 2 3 if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_PList___tail_lessThan_Leave()) { GetFormattedVn(builder, syntaxTree.Children[0]); builder.Append(" "); GetFormattedpointToLeave(builder, syntaxTree.Children[1]); builder.Append(" "); GetFormattedVList(builder, syntaxTree.Children[2]); GetFormattedsemicolonLeave(builder, syntaxTree.Children[3]); builder.AppendLine(); GetFormattedPList(builder, syntaxTree.Children[4]); } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_PList___tail_startEndLeave()) { // nothing to do //GetFormattednull(builder, syntaxTree.Children[0]); } }
/// <summary> /// 2 <PList> ::= <Vn> "::=" <VList> ";" <PList>; /// <para>3 <PList> ::= null;</para> /// </summary> /// <param name="plist"></param> /// <param name="syntaxTree"></param> private static void GetGrammarPList( ContextfreeProductionList plist, SyntaxTree <EnumTokenTypeCG, EnumVTypeCG, TreeNodeValueCG> syntaxTree) {//<PList> ::= <Vn> "::=" <VList> ";" <PList> | null; 2 3 if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_PList___tail_lessThan_Leave()) { ContextfreeProduction production = new ContextfreeProduction(); plist.Add(production); var vn = GetGrammarVn(syntaxTree.Children[0]); production.Left = vn; var vlist = GetGrammarVList(syntaxTree.Children[2]); production.RightCollection = vlist; GetGrammarPList(plist, syntaxTree.Children[4]); } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_PList___tail_startEndLeave()) { // nothing to do //GetGrammarnull(syntaxTree.Children[0]); } }