summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-09-23 18:28:29 -0700
committerNathan Binkert <nate@binkert.org>2009-09-23 18:28:29 -0700
commitbae6a4a4d9ab3953051fb9d1b866172ecfcbccdb (patch)
tree5e421ccc2cc1ec7738d6a5aa88d4e2960058a91f /src
parentbe0d74d6f6a4af96b975b40782bc28cfae78f624 (diff)
downloadgem5-bae6a4a4d9ab3953051fb9d1b866172ecfcbccdb.tar.xz
ply grammar: Fixup Tokenizer class so you can get lexer arguments
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/util/grammar.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/m5/util/grammar.py b/src/python/m5/util/grammar.py
index 93c2c84c4..ab5f35868 100644
--- a/src/python/m5/util/grammar.py
+++ b/src/python/m5/util/grammar.py
@@ -55,6 +55,7 @@ class Tokenizer(object):
break
yield tok
self.input = _input()
+ self.lexer = lexer
def next(self):
return self.input.next()
@@ -68,6 +69,9 @@ class Tokenizer(object):
except StopIteration:
return None
+ def __getattr__(self, attr):
+ return getattr(self.lexer, attr)
+
class Grammar(object):
def __init__(self, output=None, debug=False):
self.yacc_args = {}