diff options
author | Nathan Binkert <nate@binkert.org> | 2009-09-23 18:28:29 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-09-23 18:28:29 -0700 |
commit | bae6a4a4d9ab3953051fb9d1b866172ecfcbccdb (patch) | |
tree | 5e421ccc2cc1ec7738d6a5aa88d4e2960058a91f /src | |
parent | be0d74d6f6a4af96b975b40782bc28cfae78f624 (diff) | |
download | gem5-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.py | 4 |
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 = {} |