Example #1
0
        public override bool NotEquals(Primitive first, Primitive second)
        {
            var f = (decimal)first.Value;
            var s = (decimal)second.Value;

            return f != s;
        }
Example #2
0
 public override void Clear()
 {
     this.Header = "";
     this.Parent = null;
     this.Cases = new Dictionary<Primitive, List<IAst>>();
     this.Default = null;
 }
Example #3
0
        public override bool LessThan(Primitive first, Primitive second)
        {
            var f = (decimal)first.Value;
            var s = (decimal)second.Value;

            return f < s;
        }
Example #4
0
 public override Boolean ParserHeader(string aHeader)
 {
     Boolean returns = false;
     var rg = new Regex(Parser.Grammar.GetPattern("whilestart").ToString());
     Match values = rg.Match(this.Header);
     if (values.Groups["val"].Value.ToLower() == "true")
     {
         this.Left = new EcString("1", false);
         this.Right = new EcString("1", false);
         this.op = "==";
     }
     else if (values.Groups["val"].Value.ToLower() == "false")
     {
         this.Left = new EcString("1");
         this.Right = new EcString("1");
         this.op = "!=";
     }
     else
     {
         this.Left = new EcString(values.Groups["left"].Value);
         this.Right = new EcString(values.Groups["right"].Value);
         this.op = values.Groups["operator"].Value;
     }
     return returns;
 }
Example #5
0
 public override void Clear()
 {
     this.Nodes = new List<IAst>();
     this.Header = "";
     this.Left = null;
     this.Right = null;
     this.op = "";
 }
Example #6
0
        public override bool LessThan(Primitive first, Primitive second)
        {
            var f = (decimal)first.Value;
            var s = (decimal)second.Value;

            if (f < s)
            {
                return true;
            }
            return false;
        }
Example #7
0
 public override void Clear()
 {
     this.Statements = new List<IAst>();
     this.Header = "";
     this.Left = null;
     this.Right = null;
     this.op = "";
     this.Value = null;
     this.setValue = null;
     this.forop = null;
     this.Step = null;
 }
Example #8
0
 public static void Store(string name, Primitive o, List<AttributeStmt> Attributes = null)
 {
     try
     {
         internals.Add(name, o);
         if (Attributes != null)
         {
             DeclarationAttributes.Add(name, Attributes);
         }
     }
     catch
     {
     }
 }
Example #9
0
 public virtual bool Mod(Primitive first, Primitive second)
 {
     return false;
 }
Example #10
0
 public virtual Primitive MinusEquals(Primitive first, Primitive second)
 {
     return null;
 }
Example #11
0
 public virtual bool LessThan(Primitive first, Primitive second)
 {
     return false;
 }
Example #12
0
 public virtual bool GreaterThan(Primitive first, Primitive second)
 {
     return false;
 }
Example #13
0
 public virtual bool NotEquals(Primitive first, Primitive second)
 {
     return false;
 }
Example #14
0
 public override Boolean ParserHeader(string aHeader)
 {
     var rg = new Regex(Parser.Grammar.GetPattern("forstart").ToString());
     Match values = rg.Match(this.Header);
     this.Left = new EcString(values.Groups["left"].Value);
     this.Right = new EcString(values.Groups["right"].Value);
     this.op = values.Groups["operator"].Value;
     this.Value = values.Groups["Name"].Value;
     this.setValue = values.Groups["Type"].Value;
     this.forop = values.Groups["Forop"].Value;
     try
     {
         this.Step = new Step { Every = int.Parse(values.Groups["step"].Value) };
     }
     catch
     {
     }
     return true;
 }
Example #15
0
 public ThrowException(Primitive p)
 {
     this.p = p;
 }
Example #16
0
 public override Primitive MinusEquals(Primitive first, Primitive second)
 {
     return new EcNumber(((decimal)first.Value) - ((decimal)second.Value));
 }
Example #17
0
        public override bool NotEquals(Primitive first, Primitive second)
        {
            var f = (decimal)first.Value;
            var s = (decimal)second.Value;

            if (f != s)
            {
                return true;
            }
            return false;
        }
Example #18
0
        public override bool ParserHeader(string aHeader)
        {
            Match values = Parser.Grammar.GetPattern("switchstart").Match(this.Header);
            Group par = values.Groups["Name"];

            if (SymbolTable.Contains(par.Value))
            {
                this.Parent = SymbolTable.Get(par.Value);
            }
            else
            {
                this.Parent = new EcObject(par.Value);
            }

            return true;
        }
Example #19
0
 public static void Set(string name, Primitive newValue)
 {
     internals[name] = newValue;
 }