当前位置: 首页>>代码示例>>C#>>正文


C# ExpressionVisitor类代码示例

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


ExpressionVisitor类属于命名空间,在下文中一共展示了ExpressionVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClientQueryProvider

 /// <summary>
 /// Initializes a new instance of the <see cref="Artefacts.Service.ClientQueryProvider`1"/> class.
 /// </summary>
 /// <param name="repository">Repository.</param>
 /// <param name="visitor">Visitor.</param>
 public ClientQueryProvider(IRepository repository, ExpressionVisitor visitor = null)
 {
     if (repository == null)
         throw new ArgumentNullException("repository");
     Repository = repository;
     _clientProxy = new RepositoryClientProxy(new NetTcpBinding(SecurityMode.None), "net.tcp://localhost:3334/ArtefactRepository");
 }
开发者ID:jbowwww,项目名称:ArtefactService,代码行数:12,代码来源:ClientQueryProvider.cs

示例2: BuildParameters

        public static Dictionary<string, FNode> BuildParameters(ExpressionVisitor Evaluator, HScriptParser.Bind_element_setContext context)
        {

            Dictionary<string, FNode> parameters = new Dictionary<string, FNode>();
            if (context == null)
                return parameters;
            
            foreach (HScriptParser.Bind_elementContext ctx in context.bind_element())
            {

                string key = ctx.SCALAR().GetText();
                bool is_dynamic = 
                    (ctx.K_STATIC() == null) 
                    ? true 
                    : false;
                FNode value = 
                    (is_dynamic) 
                    ? Evaluator.ToNode(ctx.expression()) 
                    : new FNodeValue(null, new Cell(ctx.expression().GetText(), false));
                parameters.Add(key, value);

            }
            return parameters;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:25,代码来源:ScriptHelper.cs

示例3: ParseTokens

        private static Expression ParseTokens(CommonTokenStream input)
        {
            ExpressionParser.ExpressionContext startContext = new ExpressionParser(input).expression();

            ExpressionVisitor visit = new ExpressionVisitor();
            Expression expr = visit.Visit(startContext);
            return expr;
        }
开发者ID:sungaila,项目名称:uebersetzerbauSWP,代码行数:8,代码来源:ExpressionAnalyzer.cs

示例4: RenderStagedReadPlan

        // Reads //
        public static StagedReadName RenderStagedReadPlan(Workspace Home, HScriptParser.Crudam_readContext context)
        {

            // Get the data source //
            DataSet data = VisitorHelper.GetData(Home, context.full_table_name());
            string alias =
                (context.K_AS() != null)
                ? context.IDENTIFIER().GetText()
                : data.Name;

            // Create a local heap to work off of //
            MemoryStruct local_heap = new MemoryStruct(true);

            // Create a record register //
            StreamRegister memory = new StreamRegister(null);

            // Create expression visitor //
            ExpressionVisitor exp_vis = new ExpressionVisitor(local_heap, Home, alias, data.Columns, memory);

            // Where clause //
            Predicate where = VisitorHelper.GetWhere(exp_vis, context.where_clause());

            // Create a reader //
            RecordReader reader = data.OpenReader(where);

            // Attach the reader to the register //
            memory.BaseStream = reader;

            // Create the action visitor //
            ActionVisitor act_vis = new ActionVisitor(Home, local_heap, exp_vis);

            // Get the declarations //
            if (context.crudam_declare_many() != null)
            {
                VisitorHelper.AllocateMemory(Home, local_heap, exp_vis, context.crudam_declare_many());
            }

            // Get the initial actionset //
            TNode pre_run =
                (context.init_action() != null)
                ? act_vis.ToNode(context.init_action().query_action())
                : new TNodeNothing(null);

            // Get the main actionset //
            TNode run = act_vis.ToNode(context.main_action().query_action());

            // Get the final actionset //
            TNode post_run =
                (context.final_action() != null)
                ? act_vis.ToNode(context.final_action().query_action())
                : new TNodeNothing(null);

            return new StagedReadName(reader, pre_run, run, post_run);

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:56,代码来源:CommandCompiler.cs

示例5: Accept

 public override Expression Accept(ExpressionVisitor visitor)
 {
     return visitor.VisitParameter(this);
 }
开发者ID:x335,项目名称:WootzJs,代码行数:4,代码来源:ParameterExpression.cs

示例6: Accept

 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor) {
     return visitor.VisitMethodCall(this);
 }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:6,代码来源:MethodCallExpression.cs

示例7: Visit

 public override void Visit(ExpressionVisitor visitor)
 {
     visitor.Visit(this);
 }
开发者ID:stroan,项目名称:Lamn,代码行数:4,代码来源:AST.cs

示例8: Accept

 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor) {
     return visitor.VisitNewArray(this);
 }
开发者ID:madpilot,项目名称:ironruby,代码行数:6,代码来源:NewArrayExpression.cs

示例9: OnAfterCall

 public override void OnAfterCall(Identifier stackReg, ProcedureSignature sigCallee, ExpressionVisitor<Expression> eval)
 {
     throw new NotImplementedException();
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:4,代码来源:ThumbProcessorState.cs

示例10: GetPartitions

        // Partitions //
        public static int GetPartitions(ExpressionVisitor Evaluator, HScriptParser.PartitionsContext context)
        {

            // Null then assume 1 partition //
            if (context == null)
                return 1;

            // If the expression is null, then max out cores //
            if (context.expression() == null)
                return Environment.ProcessorCount;

            // Otherwise, get the value //
            int cnt = (int)Evaluator.ToNode(context.expression()).Evaluate().valueINT;

            // Bound it //
            cnt = Math.Min(cnt, Environment.ProcessorCount * 2);
            cnt = Math.Max(cnt, 1);

            return cnt;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:22,代码来源:VisitorHelper.cs

示例11: AllocateMemory

        public static void AllocateMemory(Workspace Home, MemoryStruct Heap, ExpressionVisitor Evaluator, HScriptParser.DeclareMatrixLiteralContext context)
        {

            string name = context.IDENTIFIER().GetText();
            CellAffinity type = GetAffinity(context.type());
            MatrixVisitor vis = new MatrixVisitor(Home, Heap, Evaluator);
            CellMatrix mat = vis.ToMatrix(context.matrix_expression()).Evaluate();
            Heap.Arrays.Reallocate(name, mat);

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:10,代码来源:VisitorHelper.cs

示例12: OnAfterCall

 public override void OnAfterCall(Identifier sp, ProcedureSignature sigCallee, ExpressionVisitor<Expression> eval)
 {
 }
开发者ID:melbcat,项目名称:reko,代码行数:3,代码来源:FakeArchitecture.cs

示例13: Accept

 /// <summary>
 /// Dispatches to the specific visit method for this node type.
 /// </summary>
 protected internal override Expression Accept(ExpressionVisitor visitor) {
     return visitor.VisitInvocation(this);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:InvocationExpression.cs

示例14: AppendSet

        private static void AppendSet(ExpressionVisitor Evaluator, FNodeSet Fields, HScriptParser.Expression_or_wildcardContext context)
        {

            if (context is HScriptParser.EOW_expressionContext)
            {
                AppendSet(Evaluator, Fields, context as HScriptParser.EOW_expressionContext);
                return;
            }

            if (context is HScriptParser.EOW_local_starContext)
            {
                AppendSet(Evaluator, Fields, context as HScriptParser.EOW_local_starContext);
                return;
            }

            if (context is HScriptParser.EOW_global_starContext)
            {
                AppendSet(Evaluator, Fields, context as HScriptParser.EOW_global_starContext);
                return;
            }

            if (context is HScriptParser.EOW_table_starContext)
            {
                AppendSet(Evaluator, Fields, context as HScriptParser.EOW_table_starContext);
                return;
            }

            if (context is HScriptParser.EOW_tables_starContext)
            {
                AppendSet(Evaluator, Fields, context as HScriptParser.EOW_tables_starContext);
                return;
            }

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:34,代码来源:VisitorHelper.cs

示例15: GetReturnStatement

        public static FNodeSet GetReturnStatement(ExpressionVisitor Evaluator, HScriptParser.Expression_or_wildcard_setContext context)
        {

            FNodeSet nodes = new FNodeSet();

            foreach (HScriptParser.Expression_or_wildcardContext ctx in context.expression_or_wildcard())
                AppendSet(Evaluator, nodes, ctx);

            return nodes;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:11,代码来源:VisitorHelper.cs


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