changeset a886774d5ae1 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=a886774d5ae1
description:
ply grammar: Fixup Tokenizer class so you can get lexer arguments
diffstat:
1 file changed, 4 insertions(+)
src/python/m5/util/grammar.py | 4 ++++
diffs (21 lines):
diff -r 60e8bbcae401 -r a886774d5ae1 src/python/m5/util/grammar.py
--- a/src/python/m5/util/grammar.py Wed Sep 23 18:17:11 2009 -0700
+++ b/src/python/m5/util/grammar.py Wed Sep 23 18:28:29 2009 -0700
@@ -55,6 +55,7 @@
break
yield tok
self.input = _input()
+ self.lexer = lexer
def next(self):
return self.input.next()
@@ -68,6 +69,9 @@
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 = {}
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev