Esempio n. 1
0
        public void ParseRoutineWithInsts()
        {
            string input = TestUtil.GetInput("RoutineWithInsts");

            IrLexer lexer = new IrLexer(input);

            Token[] output = lexer.Tokenize();

            Token[] expected = TestUtil.DeserializeTokensFromOutput("RoutineInstTokens", "json");

            TestUtil.AssertTokens(expected, output);
        }
Esempio n. 2
0
        public void Simple(string input, string expectedValue)
        {
            // Create the lexer.
            IrLexer lexer = new IrLexer(input);

            // Invoke the lexer and create the corresponding stream.
            TokenStream stream = new TokenStream(lexer.Tokenize());

            // Create the parser context.
            ParserContext context = new ParserContext(stream);

            // Invoke the parser.
            Reference result = new ReferenceParser().Parse(context);

            // Compare resulting value.
            Assert.AreEqual(expectedValue, result.Value);
        }