diff python/pyyacc.py @ 240:6259856841a0

Remove project
author Windel Bouwman
date Mon, 22 Jul 2013 22:37:33 +0200
parents 494828a7adf1
children e84047f29c78
line wrap: on
line diff
--- a/python/pyyacc.py	Mon Jul 22 17:57:25 2013 +0200
+++ b/python/pyyacc.py	Mon Jul 22 22:37:33 2013 +0200
@@ -2,7 +2,6 @@
   Parser generator script
 """
 
-import shelve
 import hashlib
 from ppci import Token
 
@@ -170,17 +169,7 @@
     def genParser(self):
         """ Generates a parser from the grammar (using a caching algorithm) """
         signature = self.getSignature() 
-        cache = shelve.open('__grammar_cache__.shelve')
-        # TODO: fix caching.
-        if ('signature1' in cache) and cache['signature'] == signature:
-            goto_table = cache['goto_table']
-            action_table = cache['action_table']
-        else:
-            action_table, goto_table = self.doGenerate()
-            cache['goto_table'] = goto_table
-            cache['action_table'] = action_table
-            cache['signature'] = signature
-        cache.close()
+        action_table, goto_table = self.doGenerate()
         p = LRParser(action_table, goto_table, self.start_symbol)
         p.grammar = self
         return p