Exemplo n.º 1
0
        private static AstBoolean AggregateMinimum2 <TSource>(this IReadOnlyCollection <TSource> source,
                                                              Func <TSource, AstNumber> selector, Func <AstNumber, AstNumber, AstBoolean> comp)
        {
            if (source == null)
            {
                throw new ArgumentNullException();
            }
            if (selector == null)
            {
                throw new ArgumentNullException();
            }
            if (source.Count < 2)
            {
                throw new Exception("Too few args");
            }
            var q = new Queue <TSource>(source);

            var previous = selector(q.Dequeue());
            var ret      = new AstBoolean(false);

            while (q.Count > 0)
            {
                var current = selector(q.Dequeue());
                ret      = comp(previous, current);
                previous = current;
            }

            return(ret);
        }
        public SemanticAtom Visit(AstBoolean n)
        {
            var t = new UtilizedType(Primitive.Boolean.Name, n.Location);

            return(t);
        }
Exemplo n.º 3
0
 public void Visit(AstBoolean n)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 protected bool Equals(AstBoolean other)
 {
     return(this == other);
 }
Exemplo n.º 5
0
 public void Visit(AstBoolean n)
 {
     Helpers.WriteColor("boolean", ConsoleColor.DarkCyan, ConsoleColor.Black);
 }
Exemplo n.º 6
0
 public void Visit(AstBoolean n)
 {
     Helpers.WriteLine($"{_tab}{n.Text} [{n.Location.StartLine}, {n.Location.StartColumn}]");
 }
 public SemanticAtom Visit(AstBoolean n)
 {
     return(Primitive.Boolean);
 }