Esempio n. 1
0
        public void TrcoDbp()
        {
            ProcedureBuilder m = new ProcedureBuilder();
            Identifier       a = m.Local32("a");
            Identifier       b = m.LocalByte("b");
            var s = m.Assign(a, m.Dpb(a, b, 0));

            coll = CreateCollector();
            s.Accept(eqb);
            s.Accept(coll);
            StringWriter sb = new StringWriter();

            handler.Traits.Write(sb);
            string exp =
                "T_1 (in a : word32)" + nl +
                "\ttrait_primitive(word32)" + nl +
                "\ttrait_primitive(word32)" + nl +
                "\ttrait_primitive(word32)" + nl +
                "\ttrait_equal(T_3)" + nl +
                "T_2 (in b : byte)" + nl +
                "\ttrait_primitive(byte)" + nl +
                "T_3 (in DPB(a, b, 0) : word32)" + nl +
                "\ttrait_primitive(word32)" + nl;

            Assert.AreEqual(exp, sb.ToString());
        }