예제 #1
0
        protected override Expr VisitARRAYINDEX(ExprArrayIndex pExpr)
        {
            Debug.Assert(pExpr != null);
            Expr arr  = Visit(pExpr.Array);
            Expr args = GenerateIndexList(pExpr.Index);

            if (args is ExprList)
            {
                Expr Params = GenerateParamsArray(args, PredefinedType.PT_EXPRESSION);
                return(GenerateCall(PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2, arr, Params));
            }
            return(GenerateCall(PREDEFMETH.PM_EXPRESSION_ARRAYINDEX, arr, args));
        }
예제 #2
0
        public ExprArrayIndex CreateArrayIndex(Expr pArray, Expr pIndex)
        {
            CType pType = pArray.Type;

            if (pType != null && pType.IsArrayType())
            {
                pType = pType.AsArrayType().GetElementType();
            }
            else if (pType == null)
            {
                pType = GetTypes().GetReqPredefAgg(PredefinedType.PT_INT).getThisType();
            }
            ExprArrayIndex pResult = new ExprArrayIndex(pType);

            pResult.Array = pArray;
            pResult.Index = pIndex;
            return(pResult);
        }
예제 #3
0
 protected virtual Expr VisitARRAYINDEX(ExprArrayIndex pExpr)
 {
     return(VisitEXPR(pExpr));
 }