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();

            pResult.kind  = ExpressionKind.EK_ARRAYINDEX;
            pResult.type  = pType;
            pResult.flags = 0;
            pResult.SetArray(pArray);
            pResult.SetIndex(pIndex);
            return(pResult);
        }
Exemplo n.º 2
0
 protected override EXPR VisitARRAYINDEX(EXPRARRAYINDEX pExpr)
 {
     Debug.Assert(pExpr != null);
     Debug.Assert(alwaysRewrite || currentAnonMeth != null);
     EXPR arr = Visit(pExpr.GetArray());
     EXPR args = GenerateIndexList(pExpr.GetIndex());
     if (args.isLIST())
     {
         EXPR Params = GenerateParamsArray(args, PredefinedType.PT_EXPRESSION);
         return GenerateCall(PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2, arr, Params);
     }
     return GenerateCall(PREDEFMETH.PM_EXPRESSION_ARRAYINDEX, arr, args);
 }
Exemplo n.º 3
0
 protected virtual EXPR VisitARRAYINDEX(EXPRARRAYINDEX pExpr)
 {
     return(VisitEXPR(pExpr));
 }
Exemplo n.º 4
0
 protected virtual EXPR VisitARRAYINDEX(EXPRARRAYINDEX pExpr)
 {
     return VisitEXPR(pExpr);
 }
Exemplo n.º 5
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();
            pResult.kind = ExpressionKind.EK_ARRAYINDEX;
            pResult.type = pType;
            pResult.flags = 0;
            pResult.SetArray(pArray);
            pResult.SetIndex(pIndex);
            return pResult;
        }