• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Rule_Context类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Rule_Context的典型用法代码示例。如果您正苦于以下问题:C# Rule_Context类的具体用法?C# Rule_Context怎么用?C# Rule_Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Rule_Context类属于命名空间,在下文中一共展示了Rule_Context类的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_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


示例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]);
               }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:25,代码来源:Rule_Statements.cs


示例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;
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:27,代码来源:Rule_Autosearch_Function.cs


示例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;
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:35,代码来源:Rule_Dialog.cs


示例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;
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:27,代码来源:Rule_Report.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_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


示例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]));
                }
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:29,代码来源:Rule_CompareExp.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_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


示例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]);
     }
 }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:9,代码来源:Rule_Program.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: RenderHtml

        public static string RenderHtml(Rule_Context pContext, string commandName, string fileName, string tableName, int rowCount)
        {
            StringBuilder sb = new StringBuilder();
            Epi.DataSets.Config.SettingsRow settings = Configuration.GetNewInstance().Settings;
            sb.Append(HTML.Italics(SharedStrings.CURRENT_VIEW + ":&nbsp;"));
            sb.Append(HTML.Bold(String.Format("{0}:{1}", fileName.Trim(new char[] { '\'' }), tableName)));
            if (pContext.CurrentRead.RelatedTables != null)
            {
                foreach (string table in pContext.CurrentRead.RelatedTables)
                {
                    sb.Append(HTML.Tag("br"));
                    sb.Append(HTML.Italics("&nbsp&nbsp&nbsp&nbspRelate:&nbsp;"));
                    sb.Append(HTML.Bold(table));
                }
            }
            if (pContext.DataInfo.SelectCriteria != String.Empty)
            {
                sb.Append(HTML.Tag("br"));
                sb.Append(HTML.Italics("Selection:&nbsp;&nbsp;"));
                sb.Append("&nbsp;");
                sb.Append(HTML.Bold(EpiExpression(pContext, pContext.DataInfo.SelectCriteria)));
            }
            if (pContext.DataInfo.GetSqlStatementPartSortBy() != String.Empty)
            {
                sb.Append(HTML.Tag("br"));
                sb.Append(HTML.Italics("Sort By:&nbsp;&nbsp;"));
                sb.Append(HTML.Bold(EpiExpression(pContext, pContext.DataInfo.GetSqlStatementPartSortBy())));
            }
            sb.Append(HTML.Tag("br"));
            sb.Append(HTML.Italics(SharedStrings.RECORD_COUNT + ":&nbsp;&nbsp;"));
            sb.Append(HTML.Bold(rowCount.ToString()));
            string scope = string.Empty;
            switch (settings.RecordProcessingScope)
            {
                case 1:
                    scope = SharedStrings.DELETED_RECORDS_EXCLUDED;
                    break;
                case 2:
                    scope = SharedStrings.DELETED_RECORDS_ONLY;
                    break;
                default:
                    scope = SharedStrings.DELETED_RECORDS_INCLUDED;
                    break;
            }
            sb.Append("&nbsp;");
            sb.Append(HTML.Italics("(" + scope + ")&nbsp;&nbsp;&nbsp;"));
            sb.Append(HTML.Italics("Date:"));
            sb.Append("&nbsp;&nbsp;");
            sb.Append(HTML.Bold(DateTime.Now.ToString()));
            sb.Append(HTML.Tag("br"));
            sb.Append(HTML.Tag("br"));

            return sb.ToString();
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:54,代码来源:Rule_Tables.cs


示例20: 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



注:本文中的Rule_Context类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ruleset类代码示例发布时间:2022-05-24
下一篇:
C# RuleSet类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap