/// <summary> /// 11 <Vt> ::= "null"; /// <para>12 <Vt> ::= "identifier";</para> /// <para>13 <Vt> ::= "number";</para> /// <para>14 <Vt> ::= "constString";</para> /// <para>15 <Vt> ::= identifier;</para> /// <para>16 <Vt> ::= number;</para> /// <para>17 <Vt> ::= constString;</para> /// </summary> /// <param name="syntaxTree"></param> private static ProductionNode GetGrammarVt(SyntaxTree <EnumTokenTypeCG, EnumVTypeCG, TreeNodeValueCG> syntaxTree) {//<Vt> ::= "null" | "identifier" | "number" | "constString" | identifier | number | constString; // 11 12 13 14 15 16 17 ProductionNode result = null; if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_nullLeave()) { result = ProductionNode.tail_null; } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_identifierLeave()) { result = ProductionNode.tail_identifier; } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_numberLeave()) { result = ProductionNode.tail_number; } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_constStringLeave()) { result = ProductionNode.tail_constString; } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___constStringLeave()) { var name = GetGrammarconstString(syntaxTree.Children[0]); result = new ProductionNode(name, name, EnumProductionNodePosition.Leave); } return(result); }
/// <summary> /// 11 <Vt> ::= "null"; /// <para>12 <Vt> ::= "identifier";</para> /// <para>13 <Vt> ::= "number";</para> /// <para>14 <Vt> ::= "constString";</para> /// <para>15 <Vt> ::= constString;</para> /// </summary> /// <param name="builder"></param> /// <param name="syntaxTree"></param> private static void GetFormattedVt(StringBuilder builder, SyntaxTree <EnumTokenTypeCG, EnumVTypeCG, TreeNodeValueCG> syntaxTree) {//<Vt> ::= "null" | "identifier" | "number" | "constString" | constString; // 11 12 13 14 15 if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_nullLeave()) { builder.Append(ProductionNode.tail_null.NodeName); //GetFormattednull(builder, syntaxTree.Children[0]); } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_identifierLeave()) { builder.Append(ProductionNode.tail_identifier.NodeName); //GetFormattedidentifierLeave(builder, syntaxTree.Children[0]); } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_numberLeave()) { builder.Append(ProductionNode.tail_number.NodeName); //GetFormattednumberLeave(builder, syntaxTree.Children[0]); } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___tail_constStringLeave()) { builder.Append(ProductionNode.tail_constString.NodeName); //GetFormattedconstString(builder, syntaxTree.Children[0]); } else if (syntaxTree.CandidateFunc == LL1SyntaxParserCG.GetFuncParsecase_Vt___constStringLeave()) { GetFormattedconstString(builder, syntaxTree.Children[0]); } }