Example #1
0
        public void StopAfterError()
        {
            var p = new Parser();
            p.Start(
                   Fixtures.Grammar2.ExtendedGrammar,
                   Fixtures.Grammar2.SLR1ParserTable,
                   new TerminalSymbol[] { Fixtures.Grammar2.ExtendedGrammar.EndOfSourceSymbol });

            p.Stop();
            Assert.Equal(ParsingPhase.NotParsing, p.Phase);
            Assert.True(!p.IsParsing);
        }
Example #2
0
        public void StopWhenNotParsing()
        {
            var p = new Parser();
            p.Stop();

            Assert.True(!p.IsParsing);
            Assert.Equal(Syntan.SyntacticAnalysis.LR.ParsingPhase.NotParsing, p.Phase);
        }
Example #3
0
        public void StopAfterAccept()
        {
            var p = new Parser();
            p.Start(
                Fixtures.EmptyGrammar.ExtendedGrammar,
                Fixtures.EmptyGrammar.SLR1ParserTable,
                new Syntan.SyntacticAnalysis.TerminalSymbol[] { Fixtures.EmptyGrammar.ExtendedGrammar.EndOfSourceSymbol });

            p.Stop();
            Assert.Equal(ParsingPhase.NotParsing, p.Phase);
            Assert.True(!p.IsParsing);
        }