Example #1
0
        public EXPRCONCAT CreateConcat(EXPR op1, EXPR op2)
        {
            Debug.Assert(op1?.type != null);
            Debug.Assert(op2?.type != null);
            Debug.Assert(op1.type.isPredefType(PredefinedType.PT_STRING) || op2.type.isPredefType(PredefinedType.PT_STRING));

            CType type = op1.type;

            if (!type.isPredefType(PredefinedType.PT_STRING))
            {
                type = op2.type;
            }

            Debug.Assert(type.isPredefType(PredefinedType.PT_STRING));

            EXPRCONCAT rval = new EXPRCONCAT();

            rval.kind  = ExpressionKind.EK_CONCAT;
            rval.type  = type;
            rval.flags = 0;
            rval.SetFirstArgument(op1);
            rval.SetSecondArgument(op2);
            Debug.Assert(rval != null);
            return(rval);
        }
 protected override EXPR VisitCONCAT(EXPRCONCAT expr)
 {
     Debug.Assert(expr != null);
     Debug.Assert(alwaysRewrite || currentAnonMeth != null);
     PREDEFMETH pdm;
     if (expr.GetFirstArgument().type.isPredefType(PredefinedType.PT_STRING) && expr.GetSecondArgument().type.isPredefType(PredefinedType.PT_STRING))
     {
         pdm = PREDEFMETH.PM_STRING_CONCAT_STRING_2;
     }
     else
     {
         pdm = PREDEFMETH.PM_STRING_CONCAT_OBJECT_2;
     }
     EXPR p1 = Visit(expr.GetFirstArgument());
     EXPR p2 = Visit(expr.GetSecondArgument());
     MethodSymbol method = GetPreDefMethod(pdm);
     EXPR methodInfo = GetExprFactory().CreateMethodInfo(method, GetSymbolLoader().GetReqPredefType(PredefinedType.PT_STRING), null);
     return GenerateCall(PREDEFMETH.PM_EXPRESSION_ADD_USER_DEFINED, p1, p2, methodInfo);
 }
Example #3
0
 protected virtual EXPR VisitCONCAT(EXPRCONCAT pExpr)
 {
     return VisitEXPR(pExpr);
 }
Example #4
0
 protected virtual EXPR VisitCONCAT(EXPRCONCAT pExpr)
 {
     return(VisitEXPR(pExpr));
 }
Example #5
0
        public EXPRCONCAT CreateConcat(EXPR op1, EXPR op2)
        {
            Debug.Assert(op1 != null && op1.type != null);
            Debug.Assert(op2 != null && op2.type != null);
            Debug.Assert(op1.type.isPredefType(PredefinedType.PT_STRING) || op2.type.isPredefType(PredefinedType.PT_STRING));

            CType type = op1.type;
            if (!type.isPredefType(PredefinedType.PT_STRING))
            {
                type = op2.type;
            }

            Debug.Assert(type.isPredefType(PredefinedType.PT_STRING));

            EXPRCONCAT rval = new EXPRCONCAT();
            rval.kind = ExpressionKind.EK_CONCAT;
            rval.type = type;
            rval.flags = 0;
            rval.SetFirstArgument(op1);
            rval.SetSecondArgument(op2);
            Debug.Assert(rval != null);
            return (rval);
        }