Beispiel #1
0
                public override Cell Evaluate(SpoolSpace Memory)
                {
                    Cell x = this.Evaluate(Memory);
                    Cell y = this.Evaluate(Memory);

                    return(x.IsNull ? y : x);
                }
Beispiel #2
0
                public override Cell Evaluate(SpoolSpace Memory)
                {
                    Cell x = this.Evaluate(Memory);
                    Cell y = this.Evaluate(Memory);

                    return(x == y ? CellValues.Null(x.AFFINITY) : x);
                }
Beispiel #3
0
 public SpoolSpace(SpoolSpace Seed)
     : this()
 {
     foreach (KeyValuePair <string, Spool> s in Seed._Spools.Entries)
     {
         this._Spools.Allocate(s.Key, s.Value);
     }
 }
Beispiel #4
0
        public Record Initialize(SpoolSpace Memory)
        {
            RecordBuilder rb = new RecordBuilder();

            foreach (Expression x in this._Values)
            {
                rb.Add(x.Initialize(Memory));
            }
            return(rb.ToRecord());
        }
Beispiel #5
0
        public CellArray ToArray(SpoolSpace Memory)
        {
            CellArray x = new CellArray();

            foreach (Expression sx in this._Values.Values)
            {
                x.Append(sx.Evaluate(Memory));
            }
            return(x);
        }
Beispiel #6
0
            public override Cell Evaluate(SpoolSpace Memory)
            {
                Cell c = this._Children[0].Evaluate(Memory);

                if (c.Affinity != CellAffinity.EQUATION)
                {
                    return(c);
                }
                return(c.valueEQUATION.Evaluate(Memory));
            }
Beispiel #7
0
        public Record Accumulate(SpoolSpace Memory, Record Work)
        {
            RecordBuilder rb = new RecordBuilder();

            for (int i = 0; i < this._Values.Count; i++)
            {
                rb.Add(this._Values[i].Accumulate(Memory, Work[i]));
            }
            return(rb.ToRecord());
        }
Beispiel #8
0
                public override Cell Accumulate(SpoolSpace Memory, Cell Work)
                {
                    Cell x = this._Children[0].Evaluate(Memory);

                    if (this._Trigger == false)
                    {
                        return(x);
                    }
                    return(Work);
                }
Beispiel #9
0
            public override Cell Evaluate(SpoolSpace Memory)
            {
                CellArray x = new CellArray();

                foreach (Expression z in this._Children)
                {
                    x.Append(z.Evaluate(Memory));
                }
                return(x);
            }
Beispiel #10
0
        public Record ToRecord(SpoolSpace Memory)
        {
            RecordBuilder rb = new RecordBuilder();

            foreach (Expression sx in this._Values.Values)
            {
                rb.Add(sx.Evaluate(Memory));
            }
            return(rb.ToRecord());
        }
Beispiel #11
0
                public override Cell Accumulate(SpoolSpace Memory, Cell Work)
                {
                    Cell x = this._Children[0].Evaluate(Memory);

                    if (!x.IsNull && x.IsNumeric)
                    {
                        Work++;
                    }
                    return(Work);
                }
Beispiel #12
0
        public virtual Table Select(SpoolSpace Memory)
        {
            Cell val = this.Evaluate(Memory);

            if (val.Affinity == CellAffinity.TREF)
            {
                return(this._Host.OpenTable(val.valueTREF));
            }
            return(null);
        }
Beispiel #13
0
                public override Cell Accumulate(SpoolSpace Memory, Cell Work)
                {
                    Cell x = this._Children[0].Evaluate(Memory);

                    if (!x.IsNull)
                    {
                        return(CellFunctions.Max(Work, x));
                    }
                    return(Work);
                }
Beispiel #14
0
            public override Cell Evaluate(SpoolSpace Memory)
            {
                Cell x   = this._Children[0].Evaluate(Memory);
                Cell Idx = this._Children[1].Evaluate(Memory);

                if (x.IsNull || Idx.IsNull)
                {
                    return(CellValues.Null(x.AFFINITY));
                }
                return(x[Idx.valueINT]);
            }
Beispiel #15
0
        public virtual void WriteTo(SpoolSpace Memory, RecordWriter Writer)
        {
            Cell val = this.Evaluate(Memory);

            if (val.Affinity == CellAffinity.TREF)
            {
                Table t = this._Host.OpenTable(val.valueTREF);
                using (RecordReader rr = t.OpenReader())
                {
                    while (rr.CanAdvance)
                    {
                        Writer.Insert(rr.ReadNext());
                    }
                }
            }
        }
Beispiel #16
0
        internal Record ToAggShellRecord(SpoolSpace Memory)
        {
            RecordBuilder rb = new RecordBuilder();

            foreach (Expression x in this._Values.Values)
            {
                if (x.IsAggregate)
                {
                    rb.Add(x.Initialize(Memory));
                }
                else
                {
                    rb.Add(x.Evaluate(Memory));
                }
            }
            return(rb.ToRecord());
        }
Beispiel #17
0
                public override Cell Accumulate(SpoolSpace Memory, Cell Work)
                {
                    if (!Work.IsArray)
                    {
                        throw new Exception("Expecting an array");
                    }
                    Cell x = this._Children[0].Evaluate(Memory);
                    Cell w = (this._Children.Count == 2 ? this._Children[1].Evaluate(Memory) : CellValues.OneDOUBLE);

                    if (!x.IsNull && !w.IsNull && x.IsNumeric && w.IsNumeric)
                    {
                        Work[0] += w;
                        Work[1] += x * w;
                        Work[2] += x * x * w;
                    }
                    return(Work);
                }
Beispiel #18
0
            public override Cell Evaluate(SpoolSpace Memory)
            {
                if (this._Children.Count < 2 || this._Children.Count > 3)
                {
                    throw new Exception("If requires either two or three arguments");
                }

                if (this._Children.Count == 2)
                {
                    if (this._Children[0].Evaluate(Memory).valueBOOL)
                    {
                        return(this._Children[1].Evaluate(Memory));
                    }
                    return(CellValues.Null(this._Children[1].TypeOf() != CellAffinity.VARIANT ? this._Children[1].TypeOf() : CellAffinity.INT));
                }

                if (this._Children[0].Evaluate(Memory).valueBOOL)
                {
                    return(this._Children[1].Evaluate(Memory));
                }
                return(this._Children[2].Evaluate(Memory));
            }
Beispiel #19
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     return(this._Children[0].Evaluate(Memory) % this._Children[1].Evaluate(Memory));
 }
Beispiel #20
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     //Cell x = this._Children[0].Evaluate(Memory);
     //Cell y = this._Children[1].Evaluate(Memory);
     return(this._Children[0].Evaluate(Memory) * this._Children[1].Evaluate(Memory));
 }
Beispiel #21
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     return(CellOperations.CheckDivide(this._Children[0].Evaluate(Memory), this._Children[1].Evaluate(Memory)));
 }
Beispiel #22
0
                public override Cell Initialize(SpoolSpace Memory)
                {
                    Cell x = CellValues.MinBYTE;

                    return(new Cell(new CellArray(new Cell[] { x, x, x, x, x, x })));
                }
Beispiel #23
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     return(this._Children[0].Evaluate(Memory).IsNull ? CellValues.True : CellValues.False);
 }
Beispiel #24
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     return(Memory[this._sName].Get(this._vName));
 }
Beispiel #25
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     return(new Cell(this._Children[0]));
 }
Beispiel #26
0
 public override Cell Initialize(SpoolSpace Memory)
 {
     return(CellValues.MinBOOL);
 }
Beispiel #27
0
 public override Cell Accumulate(SpoolSpace Memory, Cell Work)
 {
     return(this._Children[0].Evaluate(Memory));
 }
Beispiel #28
0
 public override Cell Initialize(SpoolSpace Memory)
 {
     return(CellValues.MaxCSTRING);
 }
Beispiel #29
0
 public abstract Table Select(SpoolSpace Memory);
Beispiel #30
0
 public override Cell Evaluate(SpoolSpace Memory)
 {
     throw new Exception();
 }