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); }
public void StopWhenNotParsing() { var p = new Parser(); p.Stop(); Assert.True(!p.IsParsing); Assert.Equal(Syntan.SyntacticAnalysis.LR.ParsingPhase.NotParsing, p.Phase); }
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); }