projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be0d74d
)
ply grammar: Fixup Tokenizer class so you can get lexer arguments
author
Nathan Binkert
<nate@binkert.org>
Thu, 24 Sep 2009 01:28:29 +0000
(18:28 -0700)
committer
Nathan Binkert
<nate@binkert.org>
Thu, 24 Sep 2009 01:28:29 +0000
(18:28 -0700)
src/python/m5/util/grammar.py
patch
|
blob
|
history
diff --git
a/src/python/m5/util/grammar.py
b/src/python/m5/util/grammar.py
index 93c2c84c45dcbae4f7e8346f7f2b44dee4ac1b0d..ab5f35868872120a084e79b695f7f3f233b9d258 100644
(file)
--- 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 = {}