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); }
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); }