本文整理汇总了C#中com.calitha.goldparser.NonterminalToken类的典型用法代码示例。如果您正苦于以下问题:C# NonterminalToken类的具体用法?C# NonterminalToken怎么用?C# NonterminalToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NonterminalToken类属于com.calitha.goldparser命名空间,在下文中一共展示了NonterminalToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Rule_Assign
public Rule_Assign(Rule_Context pContext, NonterminalToken pTokens)
: base(pContext)
{
//ASSIGN <Qualified ID> '=' <Expression>
//<Let_Statement> ::= LET Identifier '=' <Expression>
//<Simple_Assign_Statement> ::= Identifier '=' <Expression>
switch(pTokens.Rule.Lhs.ToString())
{
case "<Assign_Statement>":
//NonterminalToken T = (NonterminalToken)pTokens.Tokens[1];
//this.QualifiedId = T.Tokens[0].ToString();
this.QualifiedId = this.SetQualifiedId(pTokens.Tokens[1]);
//this.value = new Rule_Expression(pContext, (NonterminalToken)pTokens.Tokens[3]);
this.value = AnalysisRule.BuildStatments(pContext, pTokens.Tokens[3]);
break;
case "<Let_Statement>":
//this.QualifiedId = pTokens.Tokens[1].ToString();
this.QualifiedId = this.SetQualifiedId(pTokens.Tokens[1]);
//this.value = new Rule_Expression(pContext, (NonterminalToken)pTokens.Tokens[3]);
this.value = AnalysisRule.BuildStatments(pContext, pTokens.Tokens[3]);
break;
case "<Simple_Assign_Statement>":
//Identifier '=' <Expression>
//T = (NonterminalToken)pTokens.Tokens[1];
//this.QualifiedId = this.GetCommandElement(pTokens.Tokens, 0);
this.QualifiedId = this.SetQualifiedId(pTokens.Tokens[0]);
//this.value = new Rule_Expression(pContext, (NonterminalToken)pTokens.Tokens[2]);
this.value = AnalysisRule.BuildStatments(pContext, pTokens.Tokens[2]);
break;
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:34,代码来源:Rule_Assign.cs
示例2: Rule_Define_Group
public Rule_Define_Group(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
//<Define_Group_Statement> ::= DEFINE Identifier GROUPVAR <IdentifierList>
this.Identifier = this.GetCommandElement(pToken.Tokens, 1);
this.IdentifierList.AddRange(this.GetCommandElement(pToken.Tokens, 3).Split(' '));
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:7,代码来源:Rule_Define_Group.cs
示例3: Rule_CoxPH
public Rule_CoxPH(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
/*
<Simple_Cox_Statement> ::= COXPH Identifier '=' <CoxTermList> '*' Identifier '(' DecLiteral ')' <CoxOptList>
<Boolean_Cox_Statement> ::= COXPH Identifier '=' <CoxTermList> '*' Identifier '(' Boolean ')' <CoxOptList>*/
//!COXPH <time variable>= <covariate(s)>[: <time function>:] * <censor variable> (<value>) [TIMEUNIT="<time unit>"] [OUTTABLE=<tablename>] [GRAPHTYPE="<graph type>"] [WEIGHTVAR=<weight variable>] [STRATAVAR=<strata variable(s)>] [GRAPH=<graph variable(s)>]
string[] saCensorArray;
this.commandText = this.ExtractTokens(pToken.Tokens);
this.time_variable = this.GetCommandElement(pToken.Tokens, 1).Trim(new char[] {'[',']'});
saCensorArray = GetUncensoredVarVal(this.GetCommandElement(pToken.Tokens, 5));
this.censor_variable = saCensorArray[0].Trim(new char[] { '[', ']' });
this.censor_value = saCensorArray[1].Trim(new char[] { '[', ']' });
this.SetTermList((NonterminalToken) pToken.Tokens[3]);
if (pToken.Tokens.Length > 6)
{
this.SetOptionList((NonterminalToken)pToken.Tokens[6]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:25,代码来源:Rule_CoxPH.cs
示例4: Rule_Report
public Rule_Report(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
// <Report_Display_Statement> ::= REPORT File DISPLAY
// <Report_File_Statement> ::= REPORT File TO File
// <Report_Print_Statement> ::= REPORT File String
epiReportExecutablePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
epiReportExecutablePath = Path.Combine(epiReportExecutablePath, "EpiReport.exe");
templatePath = this.GetCommandElement(pToken.Tokens, 1);
option = this.GetCommandElement(pToken.Tokens, 2);
selectedPrinter = String.Empty;
if (option.ToUpper() == CommandNames.TO.ToUpper())
{
reportHtmlPath = this.GetCommandElement(pToken.Tokens, 3);
}
else if (option.ToUpper() != CommandNames.DISPLAY.ToUpper())
{
selectedPrinter = this.GetCommandElement(pToken.Tokens, 2);
option = "PRINT";
}
string commandLineArguments = string.Format(" /template:\"{0}\"", templatePath);
commandlineString = epiReportExecutablePath + " " + commandLineArguments;
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:27,代码来源:Rule_Report.cs
示例5: ReduceEventArgs
public ReduceEventArgs(Rule rule, NonterminalToken token, State newState)
{
this.rule = rule;
this.token = token;
this.newState = newState;
this.contin = true;
}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:7,代码来源:ParserEvents.cs
示例6: Rule_CompareExp
public Rule_CompareExp(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
// <Concat Exp> LIKE String
// <Concat Exp> '=' <Compare Exp>
// <Concat Exp> '<>' <Compare Exp>
// <Concat Exp> '>' <Compare Exp>
// <Concat Exp> '>=' <Compare Exp>
// <Concat Exp> '<' <Compare Exp>
// <Concat Exp> '<=' <Compare Exp>
// <Concat Exp>
//this.ConcatExp = new Rule_ConcatExp(pContext, (NonterminalToken)pToken.Tokens[0]);
this.ParameterList.Add(AnalysisRule.BuildStatments(pContext, pToken.Tokens[0]));
if (pToken.Tokens.Length > 1)
{
op = pToken.Tokens[1].ToString();
if (pToken.Tokens[1].ToString().Equals("LIKE", StringComparison.OrdinalIgnoreCase))
{
this.STRING = pToken.Tokens[2].ToString().Trim(new char[] {'"'});
}
else
{
//this.CompareExp = new Rule_CompareExp(pContext, (NonterminalToken)pToken.Tokens[2]);
this.ParameterList.Add(AnalysisRule.BuildStatments(pContext, pToken.Tokens[2]));
}
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:29,代码来源:Rule_CompareExp.cs
示例7: Rule_Autosearch_Function
public Rule_Autosearch_Function(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
/*<Auto_Search_Statement> ::= AUTOSEARCH <IdentifierList>
|AUTOSEARCH <IdentifierList> Always
|AUTOSEARCH <IdentifierList> DisplayList <IdentifierList>
|AUTOSEARCH <IdentifierList> DisplayList <IdentifierList> Always*/
this.IdentifierList = this.GetCommandElement(pToken.Tokens, 1).Split(' ');
if (pToken.Tokens.Length > 2)
{
if (pToken.Tokens[2].ToString().Equals("Always",StringComparison.OrdinalIgnoreCase))
{
this.AlwaysShow = true;
}
else
{
this.DisplayList = this.GetCommandElement(pToken.Tokens, 3).Split(' ');
}
}
if (pToken.Tokens.Length == 5)
{
this.AlwaysShow = true;
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:27,代码来源:Rule_Autosearch_Function.cs
示例8: Rule_CheckCodeBlock
public Rule_CheckCodeBlock(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
/* <CheckCodeBlock> ::= <DefineVariables_Statement>
| <View_Checkcode_Statement>
| <Record_Checkcode_Statement>
| <Page_Checkcode_Statement>
| <Field_Checkcode_Statement>
| <Subroutine_Statement> */
switch (pToken.Rule.Rhs[0].ToString())
{
case "<DefineVariables_Statement>":
this.CheckCodeBlock = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
break;
case "<View_Checkcode_Statement>":
this.CheckCodeBlock = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
break;
case "<Record_Checkcode_Statement>":
this.CheckCodeBlock = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
break;
case "<Page_Checkcode_Statement>":
this.CheckCodeBlock = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
break;
case "<Field_Checkcode_Statement>":
this.CheckCodeBlock = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
break;
case "<Subroutine_Statement>":
this.CheckCodeBlock = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
break;
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:31,代码来源:Rule_CheckCodeBlock.cs
示例9: Rule_Statements
public Rule_Statements(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
//<Statements> ::= <Statements> <Statement> | <Statement>
if (pToken.Tokens.Length > 1)
{
//NonterminalToken T;
//T = (NonterminalToken)pToken.Tokens[0];
//this.statements = new Rule_Statements(pContext, T);
statements = AnalysisRule.BuildStatments(pContext, pToken.Tokens[0]);
//T = ((NonterminalToken)pToken.Tokens[1]);
//this.statement = new Rule_Statement(pContext, T);
statement = AnalysisRule.BuildStatments(pContext, pToken.Tokens[1]);
}
else
{
//NonterminalToken T;
//T = (NonterminalToken)pToken.Tokens[0];
//this.statement = new Rule_Statement(pContext, T);
statement = AnalysisRule.BuildStatments(pContext, pToken.Tokens[0]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:25,代码来源:Rule_Statements.cs
示例10: Rule_If_Then_Else_End
public Rule_If_Then_Else_End(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
/*
<If_Statement> ::= IF <Expression> THEN <Statements> END-IF
| IF <Expression> THEN <Statements> END
<If_Else_Statement> ::= IF <Expression> THEN <Statements> <Else_If_Statement> END-IF
| IF <Expression> THEN <Statements> <Else_If_Statement> END
IF <Expression> THEN <Statements> ELSE <Statements> END-IF
| IF <Expression> THEN <Statements> ELSE <Statements> END
*/
IfClause = EnterRule.BuildStatments(pContext, pToken.Tokens[1]);
ThenClause = EnterRule.BuildStatments(pContext, pToken.Tokens[3]);
if (this.GetCommandElement(pToken.Tokens, 4).Equals("Else", StringComparison.OrdinalIgnoreCase))
{
ElseClause = EnterRule.BuildStatments(pContext, pToken.Tokens[5]);
}
/*
else
{
ElseClause = EnterRule.BuildStatments(pContext, pToken.Tokens[4]);
}*/
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:25,代码来源:Rule_If_Then_Else_End.cs
示例11: Rule_Printout
public Rule_Printout(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
if (pToken.Tokens.Length > 1)
{
file = this.GetCommandElement(pToken.Tokens, 1);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:8,代码来源:Rule_Printout.cs
示例12: Rule_Program
public Rule_Program(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
//<Program> ::= <CheckCodeBlocks> | !Eof
if (pToken.Tokens.Length > 0)
{
CheckCodeBlocks = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:9,代码来源:Rule_Program.cs
示例13: Rule_Geocode
public Rule_Geocode(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
// Geocode address_field_name, latitude_field_name, longitude_field_name
//<Geocode_Statement> ::= Geocode Identifier ',' Identifier ',' Identifier
this.address_field_name = this.GetCommandElement(pToken.Tokens, 1);
this.latitude_field_name = this.GetCommandElement(pToken.Tokens, 3);
this.longitude_field_name = this.GetCommandElement(pToken.Tokens, 5);
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:9,代码来源:Rule_Geocode.cs
示例14: Rule_Subroutine_Statement
public Rule_Subroutine_Statement(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
//<Subroutine_Statement> ::= Sub Identifier <Statements> End | Sub Identifier End
this.Identifier = this.GetCommandElement(pToken.Tokens, 1);
if (pToken.Tokens.Length > 3)
{
this.Statements = AnalysisRule.BuildStatments(pContext, pToken.Tokens[2]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:10,代码来源:Rule_Subroutine_Statement.cs
示例15: Rule_Help
public Rule_Help(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
//<Help_Statement> ::= HELP file String
// file = filepath
// String = Anchor
this.FileName = this.GetCommandElement(pToken.Tokens,1);
this.AnchorString = this.GetCommandElement(pToken.Tokens, 2);
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:10,代码来源:Rule_Help.cs
示例16: Rule_Delete_File
public Rule_Delete_File(Rule_Context pContext, NonterminalToken pToken)
: base(pContext, pToken)
{
string trimChars = "'";
filePath = GetCommandElement(pToken.Tokens, 1).Trim(trimChars.ToCharArray());
if (pToken.Tokens.Length > 2)
{
deleteOptions.AddRange(GetCommandElement(pToken.Tokens, 2).ToUpper().Split(StringLiterals.SPACE.ToCharArray()));
runSilent = deleteOptions.Contains("RUNSILENT");
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:11,代码来源:Rule_Delete.cs
示例17: Rule_PowExp
public Rule_PowExp(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
/* ::= <Negate Exp> '^' <Negate Exp> | <Negate Exp> */
this.NegateExp1 = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
if (pToken.Tokens.Length > 1)
{
this.NegateExp2 = EnterRule.BuildStatments(pContext, pToken.Tokens[2]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:11,代码来源:Rule_PowExp.cs
示例18: Rule_Begin_Before_Statement
public Rule_Begin_Before_Statement(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
//<Begin_Before_statement> ::= Begin-Before <Statements> End | Begin-Before End |!Null
if (pToken.Tokens.Length > 2)
{
//NonterminalToken T = (NonterminalToken)pToken.Tokens[1];
//this.Statements = new Rule_Statements(pContext, T);
this.Statements = EnterRule.BuildStatments(pContext, pToken.Tokens[1]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:11,代码来源:Rule_Begin_Before_Statement.cs
示例19: Rule_DefineVariables_Statement
public Rule_DefineVariables_Statement(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
this.TextField = this.ExtractTokensWithFormat(pToken.Tokens);
//<DefineVariables_Statement> ::= DefineVariables <Define_Statement_Group> End-DefineVariables
if (pToken.Tokens.Length > 2)
{
//define_Statements_Group = new Rule_Define_Statement_Group(pContext, (NonterminalToken)pToken.Tokens[1]);
define_Statements_Group = EnterRule.BuildStatments(pContext, pToken.Tokens[1]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:12,代码来源:Rule_DefineVariables_Statement.cs
示例20: Rule_AndExp
public Rule_AndExp(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
// <Not Exp> AND <And Exp>
// <Not Exp>
this.NotExp = EnterRule.BuildStatments(pContext, pToken.Tokens[0]);
if (pToken.Tokens.Length > 1)
{
this.AndExp = EnterRule.BuildStatments(pContext, pToken.Tokens[2]);
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:12,代码来源:Rule_AndExp.cs
注:本文中的com.calitha.goldparser.NonterminalToken类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论