Commits

Benjamin Peterson  committed e918497

add a start attribute to Grammar

  • Participants
  • Parent commits aff3f16

Comments (0)

Files changed (2)

File pypy/interpreter/pyparser/metaparser.py

 
     def build_grammar(self, grammar_cls):
         gram = grammar_cls()
+        gram.start = self.start_symbol
         names = self.dfas.keys()
         names.sort()
         names.remove(self.start_symbol)

File pypy/interpreter/pyparser/parser.py

         self.dfas = []
         self.labels = [0]
         self.token_ids = {}
+        self.start = -1
 
     def shared_copy(self):
         new = self.__class__()