public void TestLeftRecursionHexEscape() { var parser = new LRParser(); var match = parser.GetMatch("#\\x000", parser.HexEscapeCharacter); Assert.IsTrue(match.Success); }
public void TestLeftRecursionLR2() { var parser = new LRParser(); var match = parser.GetMatch("ababbba", parser.AAA); Assert.IsTrue(match.Success); var res = match.Result; }
public void TestLeftRecursionAssociation() { var parser = new LRParser(); var match = parser.GetMatch("1+1+1+1", parser.Exp); Assert.IsTrue(match.Success); Assert.AreEqual("(((1 + 1) + 1) + 1)", match.Result); }
public void TestLeftRecursionNonLR() { var parser = new LRParser(false); var match = parser.GetMatch("ab", parser.NonLR); Assert.IsTrue(match.Success); match = parser.GetMatch("ac", parser.NonLR); Assert.IsTrue(match.Success); match = parser.GetMatch("ad", parser.NonLR); Assert.IsFalse(match.Success); }