public void TestMethod3() { Re_Resolver re = new Re_Resolver(); re.Resolve("(a)$"); Assert.AreEqual(new Symbol("a"), re.parseTree.root.value); }
public void TestMethod14() { Re_Resolver re = new Re_Resolver(); bool result = re.Resolve("(a+|b))$"); Assert.AreEqual(false, result); }
public void TestMethod17() { Re_Resolver re = new Re_Resolver(); Assert.IsTrue(re.Resolve("import$")); Assert.AreEqual(Operation.And, re.parseTree.root.operation); }
public void TestMethod5() { Re_Resolver re = new Re_Resolver(); re.Resolve("ab$"); Assert.AreEqual(new Symbol("b"), re.parseTree.root.sons[1].value); Assert.AreEqual(Operation.And, re.parseTree.root.operation); }
public void TestMethod9() { Re_Resolver re = new Re_Resolver(); re.Resolve("(a|[b,1-9])*$"); Assert.AreEqual(new Symbol("b,1-9"), re.parseTree.root.sons[0].sons[1].value); Assert.AreEqual(Operation.Star, re.parseTree.root.operation); Assert.AreEqual(Operation.Or, re.parseTree.root.sons[0].operation); }
public void TestMethod8() { Re_Resolver re = new Re_Resolver(); Assert.IsTrue(re.Resolve("(a|b)*$")); Assert.AreEqual(new Symbol("b"), re.parseTree.root.sons[0].sons[1].value); Assert.AreEqual(Operation.Star, re.parseTree.root.operation); Assert.AreEqual(Operation.Or, re.parseTree.root.sons[0].operation); }
public void TestMethod16() { Re_Resolver re = new Re_Resolver(); Assert.IsTrue(re.Resolve("(ab*c|a)(ab)*$")); Assert.AreEqual(Operation.And, re.parseTree.root.operation); Assert.AreEqual(Operation.Or, re.parseTree.root.sons[0].operation); Assert.AreEqual(Operation.Star, re.parseTree.root.sons[1].operation); }
public void test1() { String re = "a*$"; Re_Resolver re_resolver = new Re_Resolver(); if (!re_resolver.Resolve(re)) { Console.WriteLine("Incorrect Format of RE"); return; } State.count = 0; NFA_ParseTree nfa = new NFA_ParseTree(re_resolver.parseTree); Assert.IsTrue(StartNFA(nfa.automata, "aa")); }