public void TestRel()
        {
            var isLess = new Rel(new Token('<'), new Constant(10), new Constant(100));
            Assert.AreEqual("10 < 100", isLess.ToString());

            isLess.Jumping(42, 99);
            //output:
            //        if 10 < 100 goto L42
            //        goto L99
        }
Exemple #2
0
        public Expr Equality()
        {
            Expr expr = this.Rel();

            while (_look.TagValue == Tag.EQ || _look.TagValue == Tag.NE)
            {
                var tok = _look;
                this.Move();
                expr = new Rel(tok, expr, this.Rel());
            }
            return(expr);
        }
Exemple #3
0
 public Expr Equality()
 {
     Expr expr = this.Rel();
     while(_look.TagValue == Tag.EQ || _look.TagValue == Tag.NE)
     {
         var tok = _look;
         this.Move();
         expr = new Rel(tok, expr, this.Rel());
     }
     return expr;
 }