Exemplo n.º 1
0
 private IExpressionBinding Visit(Declaration module, Declaration parent, VBAParser.RelationalOpContext expression, IBoundExpression withBlockVariable, StatementResolutionContext statementContext)
 {
     // To make the grammar we treat a type-of-is expression as a construct of the form "TYPEOF expression", where expression
     // is always "expression IS expression".
     if (expression.expression()[0] is VBAParser.TypeofexprContext)
     {
         return(VisitTypeOf(module, parent, expression, (VBAParser.TypeofexprContext)expression.expression()[0], expression.expression()[1], withBlockVariable, StatementResolutionContext.Undefined));
     }
     return(VisitBinaryOp(module, parent, expression, expression.expression()[0], expression.expression()[1], withBlockVariable, StatementResolutionContext.Undefined));
 }
Exemplo n.º 2
0
        private IExpressionBinding Visit(Declaration module, Declaration parent, VBAParser.RelationalOpContext expression, IBoundExpression withBlockVariable)
        {
            // To make the grammar we treat a type-of-is expression as a construct of the form "TYPEOF expression", where expression
            // is always "expression IS expression".
            if (expression.expression()[0] is VBAParser.TypeofexprContext typeofExpr)
            {
                return(VisitTypeOf(module, parent, expression, typeofExpr, expression.expression()[1], withBlockVariable));
            }

            var isIsRelation = expression.IS() != null;

            return(VisitBinaryOp(module, parent, expression, expression.expression()[0], expression.expression()[1], withBlockVariable, isIsRelation));
        }
Exemplo n.º 3
0
        private void ResolveStartValueAssignmentOfForNext(VBAParser.RelationalOpContext expression)
        {
            var expressions = expression.expression();
            var elementVariableExpression = expressions[0];

            ResolveDefault(elementVariableExpression, requiresLetCoercion: true, isAssignmentTarget: true);

            var startValueExpression = expressions[1];

            ResolveDefault(startValueExpression, requiresLetCoercion: true);
        }