Пример #1
0
        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
        }
Пример #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);
        }
Пример #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;
 }