Пример #1
0
        public void ParseConstant(string value, bool expected)
        {
            var grammer = new AsmBaseGrammar();
            var p       = new ParserState(value);

            Assert.That(grammer.constant.Match(p), Is.EqualTo(expected));

            ParseNode node = p.GetRoot();

            Console.WriteLine(node.Value);
        }
Пример #2
0
        public void ParseComment(string value, bool expected)
        {
            var grammer = new AsmBaseGrammar();
            var p       = new ParserState(value);

            Assert.That(grammer.comment.Match(p), Is.EqualTo(expected));

            var printer = new CppStructuralOutputAsXml();

            printer.Print(p.GetRoot());
            Console.WriteLine(printer.AsXml());
        }
Пример #3
0
        public void ParseOpCode(string value, bool expected)
        {
            var grammer = new AsmBaseGrammar();
            var printer = new CppStructuralOutputAsXml();
            var p       = new ParserState(value);

            Assert.That(grammer.opcode.Match(p), Is.EqualTo(expected));

            ParseNode node = p.GetRoot();

            Console.WriteLine(node.Value);
        }