Esempio n. 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.FirstArgument  = op1;
            rval.SecondArgument = op2;
            Debug.Assert(rval != null);
            return(rval);
        }
Esempio n. 2
0
        protected override Expr VisitCONCAT(ExprConcat expr)
        {
            Debug.Assert(expr != null);
            PREDEFMETH pdm;

            if (expr.FirstArgument.Type.isPredefType(PredefinedType.PT_STRING) && expr.SecondArgument.Type.isPredefType(PredefinedType.PT_STRING))
            {
                pdm = PREDEFMETH.PM_STRING_CONCAT_STRING_2;
            }
            else
            {
                pdm = PREDEFMETH.PM_STRING_CONCAT_OBJECT_2;
            }
            Expr         p1         = Visit(expr.FirstArgument);
            Expr         p2         = Visit(expr.SecondArgument);
            MethodSymbol method     = GetPreDefMethod(pdm);
            Expr         methodInfo = GetExprFactory().CreateMethodInfo(method, GetSymbolLoader().GetPredefindType(PredefinedType.PT_STRING), null);

            return(GenerateCall(PREDEFMETH.PM_EXPRESSION_ADD_USER_DEFINED, p1, p2, methodInfo));
        }
Esempio n. 3
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(type);

            rval.FirstArgument  = op1;
            rval.SecondArgument = op2;
            return(rval);
        }
Esempio n. 4
0
 protected virtual Expr VisitCONCAT(ExprConcat pExpr)
 {
     return(VisitEXPR(pExpr));
 }