示例#1
0
        public void ParseMemoryAddress(string value, bool expected)
        {
            var grammer = new AsmBaseGrammar();
            var p = new ParserState(value);

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

            ParseNode node = p.GetRoot();
            Console.WriteLine(node.Value);
        }
示例#2
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);
        }
示例#3
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());
        }