6.19.1.4.4. Augment grammar

This function adds a production S' -> S to the grammar where S was the start symbol.
Comienzo python section to interscript/parsers/lalr1.py[8 /24 ] Siguiente Previo Primero Ăšltimo
   157: #line 302 "lalr1_parser.ipk"
   158:   def augment(self):
   159:     lhss = map(lambda x: x.LHS, self.productions)
   160:     newsym = self.start
   161:     while newsym in lhss: newsym = newsym + "'"
   162:     self.productions.insert(0, Production(newsym, [self.start]))
   163: 
   164:   def unaugment(self):
   165:     del self.productions[0]
   166: 
End python section to interscript/parsers/lalr1.py[8]