Microsoft.CSharp.RuntimeBinder.Semantics.ExprFactory.CreateList C# (CSharp) Method

CreateList() public method

public CreateList ( EXPR op1, EXPR op2 ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRLIST
op1 EXPR
op2 EXPR
return Microsoft.CSharp.RuntimeBinder.Semantics.EXPRLIST
        public EXPRLIST CreateList(EXPR op1, EXPR op2)
        {
            EXPRLIST rval = new EXPRLIST();
            rval.kind = ExpressionKind.EK_LIST;
            rval.type = null;
            rval.flags = 0;
            rval.SetOptionalElement(op1);
            rval.SetOptionalNextListNode(op2);
            Debug.Assert(rval != null);
            return (rval);
        }
        public EXPRLIST CreateList(EXPR op1, EXPR op2, EXPR op3)

Same methods

ExprFactory::CreateList ( EXPR op1, EXPR op2, EXPR op3 ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRLIST
ExprFactory::CreateList ( EXPR op1, EXPR op2, EXPR op3, EXPR op4 ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRLIST

Usage Example

示例#1
0
        /////////////////////////////////////////////////////////////////////////////////
        // Expression types.

        private ExprBinOp VisitBoundLambda(ExprBoundLambda anonmeth)
        {
            Debug.Assert(anonmeth != null);

            MethodSymbol  lambdaMethod     = GetPreDefMethod(PREDEFMETH.PM_EXPRESSION_LAMBDA);
            AggregateType delegateType     = anonmeth.DelegateType;
            TypeArray     lambdaTypeParams = TypeArray.Allocate(delegateType);
            AggregateType expressionType   = SymbolLoader.GetPredefindType(PredefinedType.PT_EXPRESSION);
            MethWithInst  mwi = new MethWithInst(lambdaMethod, expressionType, lambdaTypeParams);
            Expr          createParameters = CreateWraps(anonmeth);

            Debug.Assert(createParameters != null);
            Debug.Assert(anonmeth.Expression != null);
            Expr body = Visit(anonmeth.Expression);

            Debug.Assert(anonmeth.ArgumentScope.nextChild == null);
            Expr            parameters = GenerateParamsArray(null, PredefinedType.PT_PARAMETEREXPRESSION);
            Expr            args       = ExprFactory.CreateList(body, parameters);
            CType           typeRet    = TypeManager.SubstType(mwi.Meth().RetType, mwi.GetType(), mwi.TypeArgs);
            ExprMemberGroup pMemGroup  = ExprFactory.CreateMemGroup(null, mwi);
            ExprCall        call       = ExprFactory.CreateCall(0, typeRet, args, pMemGroup, mwi);

            call.PredefinedMethod = PREDEFMETH.PM_EXPRESSION_LAMBDA;
            return(ExprFactory.CreateSequence(createParameters, call));
        }
All Usage Examples Of Microsoft.CSharp.RuntimeBinder.Semantics.ExprFactory::CreateList