Esempio n. 1
0
        public void TestParseConstants(string value, int constantCount)
        {
            Arrange(value);

            var context = parser.constants();

            Assert.AreEqual((parser.InputStream as CommonTokenStream)?.Get(0).Type, Oc5Lexer.CONSTANTS);
            Assert.AreEqual((parser.InputStream as CommonTokenStream)?.Get(1).Type, Oc5Lexer.NUMBER);
            Assert.AreEqual(context.constant().Length, constantCount);
            Assert.AreEqual((parser.InputStream as CommonTokenStream)?.GetTokens().Reverse().Skip(1).First().Type, Oc5Lexer.ENDTABLE);
            AssertParsingOk();
        }