Exemple #1
0
        private static bool HasCorrectType(Conditional node, Dictionary <Id, Types.Type> identifierToType)
        {
            var collector = new ExpressionTypeCollector(identifierToType);

            return(node.Condition.Accept(collector).IsEqual(new Types.BoolType()) &&
                   !ContainsError(collector.GetCollectedNotifications()));
        }
Exemple #2
0
        private static IEnumerable <INotification> CheckExpressionsHaveType(IList <IExpression> topLevelExpressions, Dictionary <Id, Types.Type> identifierToType)
        {
            List <INotification> notifications = new List <INotification>();

            foreach (IExpression expr in topLevelExpressions)
            {
                ExpressionTypeCollector collector = new ExpressionTypeCollector(identifierToType);

                expr.Accept(collector);

                notifications.AddRange(collector.GetCollectedNotifications());
            }

            return(notifications);
        }