本文整理汇总了C#中Rule_Context类的典型用法代码示例。如果您正苦于以下问题:C# Rule_Context类的具体用法?C# Rule_Context怎么用?C# Rule_Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Rule_Context类属于命名空间,在下文中一共展示了Rule_Context类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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(' '));
}
示例3: 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]);
}*/
}
示例4: 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]);
}
}
示例5: 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;
}
}
示例6: AssignValue
public static bool AssignValue(Rule_Context pContext, string varName, object value)
{
EpiInfo.Plugin.IVariable var;
string dataValue = string.Empty;
var = pContext.CurrentScope.Resolve(varName);
if (var != null)
{
if (var.VariableScope == EpiInfo.Plugin.VariableScope.DataSource)
{
//var.Expression = value.ToString();
pContext.EnterCheckCodeInterface.Assign(varName, value);
}
else
{
if (value != null)
{
var.Expression = value.ToString();
}
else
{
var.Expression = "Null";
}
}
}
else
{
if (value != null)
{
pContext.EnterCheckCodeInterface.Assign(varName, value);
}
}
return false;
}
示例7: 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;
}
示例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;
}
}
示例9: 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]);
}
}
示例10: 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]));
}
}
}
示例11: Rule_Printout
public Rule_Printout(Rule_Context pContext, NonterminalToken pToken)
: base(pContext)
{
if (pToken.Tokens.Length > 1)
{
file = this.GetCommandElement(pToken.Tokens, 1);
}
}
示例12: 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);
}
示例13: 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]);
}
}
示例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]);
}
}
示例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);
}