Пример #1
0
        private IBoundExpression CreateFailedExpression(IBoundExpression lExpression)
        {
            var failedExpr = new ResolutionFailedExpression();

            failedExpr.AddSuccessfullyResolvedExpression(lExpression);
            foreach (var arg in _argumentList.Arguments)
            {
                failedExpr.AddSuccessfullyResolvedExpression(arg.Expression);
            }
            return(failedExpr);
        }
Пример #2
0
        public IBoundExpression Resolve()
        {
            var leftExpr  = _left.Resolve();
            var rightExpr = _right.Resolve();

            if (leftExpr.Classification == ExpressionClassification.ResolutionFailed || rightExpr.Classification == ExpressionClassification.ResolutionFailed)
            {
                var failedExpr = new ResolutionFailedExpression();
                failedExpr.AddSuccessfullyResolvedExpression(leftExpr);
                failedExpr.AddSuccessfullyResolvedExpression(rightExpr);
                return(failedExpr);
            }
            return(new BinaryOpExpression(null, _context, leftExpr, rightExpr));
        }
Пример #3
0
        public IBoundExpression Resolve()
        {
            var expr     = _expressionBinding.Resolve();
            var typeExpr = _typeExpressionBinding.Resolve();

            if (expr.Classification == ExpressionClassification.ResolutionFailed || typeExpr.Classification == ExpressionClassification.ResolutionFailed)
            {
                var failedExpr = new ResolutionFailedExpression();
                failedExpr.AddSuccessfullyResolvedExpression(expr);
                failedExpr.AddSuccessfullyResolvedExpression(typeExpr);
                return(failedExpr);
            }
            return(new TypeOfIsExpression(null, _context, expr, typeExpr));
        }
Пример #4
0
        public IBoundExpression Resolve()
        {
            IBoundExpression boundExpression = null;
            var lExpression = _lExpressionBinding.Resolve();

            if (lExpression.Classification == ExpressionClassification.ResolutionFailed)
            {
                return(lExpression);
            }
            string name = Identifier.GetName(_expression.unrestrictedIdentifier());

            if (lExpression.Classification != ExpressionClassification.ProceduralModule)
            {
                return(null);
            }
            boundExpression = ResolveMemberInModule(lExpression, name, lExpression.ReferencedDeclaration, DeclarationType.Function, ExpressionClassification.Function);
            if (boundExpression != null)
            {
                return(boundExpression);
            }
            boundExpression = ResolveMemberInModule(lExpression, name, lExpression.ReferencedDeclaration, DeclarationType.Procedure, ExpressionClassification.Subroutine);
            if (boundExpression != null)
            {
                return(boundExpression);
            }
            var failedExpr = new ResolutionFailedExpression();

            failedExpr.AddSuccessfullyResolvedExpression(lExpression);
            return(failedExpr);
        }
        public IBoundExpression Resolve()
        {
            IBoundExpression boundExpression = null;
            var lExpression = _lExpressionBinding.Resolve();

            if (lExpression.Classification == ExpressionClassification.ResolutionFailed)
            {
                return(lExpression);
            }
            string unrestrictedName = Identifier.GetName(_expression.unrestrictedIdentifier());

            boundExpression = ResolveLExpressionIsProject(lExpression, unrestrictedName);
            if (boundExpression != null)
            {
                return(boundExpression);
            }
            boundExpression = ResolveLExpressionIsModule(lExpression, unrestrictedName);
            if (boundExpression != null)
            {
                return(boundExpression);
            }
            var failedExpr = new ResolutionFailedExpression();

            failedExpr.AddSuccessfullyResolvedExpression(lExpression);
            return(failedExpr);
        }
Пример #6
0
        private IBoundExpression CreateFailedExpression(IBoundExpression expression)
        {
            var failedExpr = new ResolutionFailedExpression();

            failedExpr.AddSuccessfullyResolvedExpression(expression);
            return(failedExpr);
        }
        private IBoundExpression CreateFailedExpression(IBoundExpression expression, ParserRuleContext context)
        {
            var failedExpr = new ResolutionFailedExpression(context);

            failedExpr.AddSuccessfullyResolvedExpression(expression);
            return(failedExpr);
        }
Пример #8
0
        private static IBoundExpression CreateResolutionFailedExpression(IBoundExpression lExpression, ArgumentList argumentList, ParserRuleContext context, bool isDefaultMemberResolution)
        {
            var failedExpr = new ResolutionFailedExpression(context, isDefaultMemberResolution);

            failedExpr.AddSuccessfullyResolvedExpression(lExpression);
            var argumentExpressions = argumentList.Arguments.Select(arg => arg.Expression);

            return(failedExpr.JoinAsFailedResolution(context, argumentExpressions));
        }