public EXPRQUESTIONMARK CreateQuestionMark(EXPR pTestExpression, EXPRBINOP pConsequence)
        {
            Debug.Assert(pTestExpression != null);
            Debug.Assert(pConsequence != null);

            CType pType = pConsequence.type;

            if (pType == null)
            {
                Debug.Assert(pConsequence.GetOptionalLeftChild() != null);
                pType = pConsequence.GetOptionalLeftChild().type;
                Debug.Assert(pType != null);
            }
            EXPRQUESTIONMARK pResult = new EXPRQUESTIONMARK();

            pResult.kind  = ExpressionKind.EK_QUESTIONMARK;
            pResult.type  = pType;
            pResult.flags = 0;
            pResult.SetTestExpression(pTestExpression);
            pResult.SetConsequence(pConsequence);
            Debug.Assert(pResult != null);
            return(pResult);
        }
 protected override EXPR VisitQUESTIONMARK(EXPRQUESTIONMARK pExpr)
 {
     Debug.Assert(pExpr != null);
     Debug.Assert(alwaysRewrite || currentAnonMeth != null);
     EXPR p1 = Visit(pExpr.GetTestExpression());
     EXPR p2 = GenerateQuestionMarkOperand(pExpr.GetConsequence().asBINOP().GetOptionalLeftChild());
     EXPR p3 = GenerateQuestionMarkOperand(pExpr.GetConsequence().asBINOP().GetOptionalRightChild());
     return GenerateCall(PREDEFMETH.PM_EXPRESSION_CONDITION, p1, p2, p3);
 }
Exemple #3
0
 protected virtual EXPR VisitQUESTIONMARK(EXPRQUESTIONMARK pExpr)
 {
     return(VisitEXPR(pExpr));
 }
Exemple #4
0
 protected virtual EXPR VisitQUESTIONMARK(EXPRQUESTIONMARK pExpr)
 {
     return VisitEXPR(pExpr);
 }
Exemple #5
0
        public EXPRQUESTIONMARK CreateQuestionMark(EXPR pTestExpression, EXPRBINOP pConsequence)
        {
            Debug.Assert(pTestExpression != null);
            Debug.Assert(pConsequence != null);

            CType pType = pConsequence.type;
            if (pType == null)
            {
                Debug.Assert(pConsequence.GetOptionalLeftChild() != null);
                pType = pConsequence.GetOptionalLeftChild().type;
                Debug.Assert(pType != null);
            }
            EXPRQUESTIONMARK pResult = new EXPRQUESTIONMARK();
            pResult.kind = ExpressionKind.EK_QUESTIONMARK;
            pResult.type = pType;
            pResult.flags = 0;
            pResult.SetTestExpression(pTestExpression);
            pResult.SetConsequence(pConsequence);
            Debug.Assert(pResult != null);
            return pResult;
        }