Esempio n. 1
0
 def test_simpleTestWithoutChange(self):
     ContextFree.remove_nongenerating_nonterminals(self.g)
     self.assertIn(0, self.g.terminals)
     self.assertIn(1, self.g.terminals)
     self.assertIn(A, self.g.nonterminals)
     self.assertIn(B, self.g.nonterminals)
     self.assertIn(C, self.g.nonterminals)
Esempio n. 2
0
 def test_simpleTestWithChange(self):
     ContextFree.remove_nongenerating_nonterminals(self.g, inplace=True)
     self.assertIn(0, self.g.terminals)
     self.assertIn(1, self.g.terminals)
     self.assertIn(A, self.g.nonterminals)
     self.assertIn(B, self.g.nonterminals)
     self.assertNotIn(C, self.g.nonterminals)
Esempio n. 3
0
 def test_simpleTest(self):
     changed = ContextFree.remove_nongenerating_nonterminals(self.g)
     self.assertIn(0, changed.terminals)
     self.assertIn(1, changed.terminals)
     self.assertIn(A, changed.nonterminals)
     self.assertIn(B, changed.nonterminals)
     self.assertNotIn(C, changed.nonterminals)