Exemplo n.º 1
0
        public void TerminalLexemShouldWhileAcceptedContinuesToMatch()
        {
            var terminalLexeme = new TerminalLexerRule('c').CreateLexeme(0);

            Assert.IsFalse(terminalLexeme.IsAccepted());
            Assert.IsTrue(terminalLexeme.Scan('c'));
            Assert.IsTrue(terminalLexeme.IsAccepted());
            Assert.IsFalse(terminalLexeme.Scan('c'));
        }
Exemplo n.º 2
0
        public void TerminalLexemeResetShouldClearPreExistingValues()
        {
            var terminalLexeme = new TerminalLexerRule('c').CreateLexeme(0);

            Assert.IsTrue(terminalLexeme.Scan('c'));
        }