コード例 #1
0
ファイル: ExprVisitorBase.cs プロジェクト: vinaykk/corefx
        protected virtual Expr Dispatch(Expr pExpr)
        {
            switch (pExpr.Kind)
            {
            case ExpressionKind.EK_BLOCK:
                return(VisitBLOCK(pExpr as ExprBlock));

            case ExpressionKind.EK_RETURN:
                return(VisitRETURN(pExpr as ExprReturn));

            case ExpressionKind.EK_BINOP:
                return(VisitBINOP(pExpr as ExprBinOp));

            case ExpressionKind.EK_UNARYOP:
                return(VisitUNARYOP(pExpr as ExprUnaryOp));

            case ExpressionKind.EK_ASSIGNMENT:
                return(VisitASSIGNMENT(pExpr as ExprAssignment));

            case ExpressionKind.EK_LIST:
                return(VisitLIST(pExpr as ExprList));

            case ExpressionKind.EK_QUESTIONMARK:
                return(VisitQUESTIONMARK(pExpr as ExprQuestionMark));

            case ExpressionKind.EK_ARRAYINDEX:
                return(VisitARRAYINDEX(pExpr as ExprArrayIndex));

            case ExpressionKind.EK_ARRAYLENGTH:
                return(VisitARRAYLENGTH(pExpr as ExprArrayLength));

            case ExpressionKind.EK_CALL:
                return(VisitCALL(pExpr as ExprCall));

            case ExpressionKind.EK_EVENT:
                return(VisitEVENT(pExpr as ExprEvent));

            case ExpressionKind.EK_FIELD:
                return(VisitFIELD(pExpr as ExprField));

            case ExpressionKind.EK_LOCAL:
                return(VisitLOCAL(pExpr as ExprLocal));

            case ExpressionKind.EK_THISPOINTER:
                return(VisitTHISPOINTER(pExpr as ExprThisPointer));

            case ExpressionKind.EK_CONSTANT:
                return(VisitCONSTANT(pExpr as ExprConstant));

            case ExpressionKind.EK_TYPEARGUMENTS:
                return(VisitTYPEARGUMENTS(pExpr as ExprTypeArguments));

            case ExpressionKind.EK_TYPEORNAMESPACE:
                return(VisitTYPEORNAMESPACE(pExpr as ExprTypeOrNamespace));

            case ExpressionKind.EK_CLASS:
                return(VisitCLASS(pExpr as ExprClass));

            case ExpressionKind.EK_FUNCPTR:
                return(VisitFUNCPTR(pExpr as ExprFuncPtr));

            case ExpressionKind.EK_PROP:
                return(VisitPROP(pExpr as ExprProperty));

            case ExpressionKind.EK_MULTI:
                return(VisitMULTI(pExpr as ExprMulti));

            case ExpressionKind.EK_MULTIGET:
                return(VisitMULTIGET(pExpr as ExprMultiGet));

            case ExpressionKind.EK_WRAP:
                return(VisitWRAP(pExpr as ExprWrap));

            case ExpressionKind.EK_CONCAT:
                return(VisitCONCAT(pExpr as ExprConcat));

            case ExpressionKind.EK_ARRINIT:
                return(VisitARRINIT(pExpr as ExprArrayInit));

            case ExpressionKind.EK_CAST:
                return(VisitCAST(pExpr as ExprCast));

            case ExpressionKind.EK_USERDEFINEDCONVERSION:
                return(VisitUSERDEFINEDCONVERSION(pExpr as ExprUserDefinedConversion));

            case ExpressionKind.EK_TYPEOF:
                return(VisitTYPEOF(pExpr as ExprTypeOf));

            case ExpressionKind.EK_ZEROINIT:
                return(VisitZEROINIT(pExpr as ExprZeroInit));

            case ExpressionKind.EK_USERLOGOP:
                return(VisitUSERLOGOP(pExpr as ExprUserLogicalOp));

            case ExpressionKind.EK_MEMGRP:
                return(VisitMEMGRP(pExpr as ExprMemberGroup));

            case ExpressionKind.EK_BOUNDLAMBDA:
                return(VisitBOUNDLAMBDA(pExpr as ExprBoundLambda));

            case ExpressionKind.EK_UNBOUNDLAMBDA:
                return(VisitUNBOUNDLAMBDA(pExpr as ExprUnboundLambda));

            case ExpressionKind.EK_HOISTEDLOCALEXPR:
                return(VisitHOISTEDLOCALEXPR(pExpr as ExprHoistedLocalExpr));

            case ExpressionKind.EK_FIELDINFO:
                return(VisitFIELDINFO(pExpr as ExprFieldInfo));

            case ExpressionKind.EK_METHODINFO:
                return(VisitMETHODINFO(pExpr as ExprMethodInfo));

            // Binary operators
            case ExpressionKind.EK_EQUALS:
                return(VisitEQUALS(pExpr.asBIN()));

            case ExpressionKind.EK_COMPARE:
                return(VisitCOMPARE(pExpr.asBIN()));

            case ExpressionKind.EK_NE:
                return(VisitNE(pExpr.asBIN()));

            case ExpressionKind.EK_LT:
                return(VisitLT(pExpr.asBIN()));

            case ExpressionKind.EK_LE:
                return(VisitLE(pExpr.asBIN()));

            case ExpressionKind.EK_GT:
                return(VisitGT(pExpr.asBIN()));

            case ExpressionKind.EK_GE:
                return(VisitGE(pExpr.asBIN()));

            case ExpressionKind.EK_ADD:
                return(VisitADD(pExpr.asBIN()));

            case ExpressionKind.EK_SUB:
                return(VisitSUB(pExpr.asBIN()));

            case ExpressionKind.EK_MUL:
                return(VisitMUL(pExpr.asBIN()));

            case ExpressionKind.EK_DIV:
                return(VisitDIV(pExpr.asBIN()));

            case ExpressionKind.EK_MOD:
                return(VisitMOD(pExpr.asBIN()));

            case ExpressionKind.EK_BITAND:
                return(VisitBITAND(pExpr.asBIN()));

            case ExpressionKind.EK_BITOR:
                return(VisitBITOR(pExpr.asBIN()));

            case ExpressionKind.EK_BITXOR:
                return(VisitBITXOR(pExpr.asBIN()));

            case ExpressionKind.EK_LSHIFT:
                return(VisitLSHIFT(pExpr.asBIN()));

            case ExpressionKind.EK_RSHIFT:
                return(VisitRSHIFT(pExpr.asBIN()));

            case ExpressionKind.EK_LOGAND:
                return(VisitLOGAND(pExpr.asBIN()));

            case ExpressionKind.EK_LOGOR:
                return(VisitLOGOR(pExpr.asBIN()));

            case ExpressionKind.EK_SEQUENCE:
                return(VisitSEQUENCE(pExpr.asBIN()));

            case ExpressionKind.EK_SEQREV:
                return(VisitSEQREV(pExpr.asBIN()));

            case ExpressionKind.EK_SAVE:
                return(VisitSAVE(pExpr.asBIN()));

            case ExpressionKind.EK_SWAP:
                return(VisitSWAP(pExpr.asBIN()));

            case ExpressionKind.EK_INDIR:
                return(VisitINDIR(pExpr.asBIN()));

            case ExpressionKind.EK_STRINGEQ:
                return(VisitSTRINGEQ(pExpr.asBIN()));

            case ExpressionKind.EK_STRINGNE:
                return(VisitSTRINGNE(pExpr.asBIN()));

            case ExpressionKind.EK_DELEGATEEQ:
                return(VisitDELEGATEEQ(pExpr.asBIN()));

            case ExpressionKind.EK_DELEGATENE:
                return(VisitDELEGATENE(pExpr.asBIN()));

            case ExpressionKind.EK_DELEGATEADD:
                return(VisitDELEGATEADD(pExpr.asBIN()));

            case ExpressionKind.EK_DELEGATESUB:
                return(VisitDELEGATESUB(pExpr.asBIN()));

            case ExpressionKind.EK_EQ:
                return(VisitEQ(pExpr.asBIN()));

            // Unary operators
            case ExpressionKind.EK_TRUE:
                return(VisitTRUE(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_FALSE:
                return(VisitFALSE(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_INC:
                return(VisitINC(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_DEC:
                return(VisitDEC(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_LOGNOT:
                return(VisitLOGNOT(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_NEG:
                return(VisitNEG(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_UPLUS:
                return(VisitUPLUS(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_BITNOT:
                return(VisitBITNOT(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_ADDR:
                return(VisitADDR(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_DECIMALNEG:
                return(VisitDECIMALNEG(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_DECIMALINC:
                return(VisitDECIMALINC(pExpr.asUnaryOperator()));

            case ExpressionKind.EK_DECIMALDEC:
                return(VisitDECIMALDEC(pExpr.asUnaryOperator()));

            default:
                throw Error.InternalCompilerError();
            }
        }