Пример #1
0
        public void ArithGenTest()
        {
            var token    = new Token('+');
            var variable = new Id(new Word("x", Tag.ID), VarType.INT, 0);
            var constant = new Constant(new Num(12), VarType.INT);
            var arith    = new Arith(token, variable, constant);

            var expresion = arith.Gen();

            Assert.AreEqual(VarType.INT, expresion.Type);
            Assert.AreEqual(token, expresion.Op);
            Assert.AreEqual("x + 12", expresion.ToString());
        }