Nathan Binkert | e1270f8 | 2009-08-16 13:39:58 -0700 | [diff] [blame] | 1 | # lex_token1.py |
Steve Reinhardt | ba2eae5 | 2006-05-22 14:29:33 -0400 | [diff] [blame] | 2 | # |
| 3 | # Tests for absence of tokens variable |
| 4 | |
Nathan Binkert | 44ebb8d | 2007-05-24 21:54:51 -0700 | [diff] [blame] | 5 | import sys |
Nathan Binkert | e1270f8 | 2009-08-16 13:39:58 -0700 | [diff] [blame] | 6 | if ".." not in sys.path: sys.path.insert(0,"..") |
Nathan Binkert | 44ebb8d | 2007-05-24 21:54:51 -0700 | [diff] [blame] | 7 | |
| 8 | import ply.lex as lex |
Steve Reinhardt | ba2eae5 | 2006-05-22 14:29:33 -0400 | [diff] [blame] | 9 | |
| 10 | t_PLUS = r'\+' |
| 11 | t_MINUS = r'-' |
| 12 | t_NUMBER = r'\d+' |
| 13 | |
| 14 | def t_error(t): |
| 15 | pass |
| 16 | |
Steve Reinhardt | ba2eae5 | 2006-05-22 14:29:33 -0400 | [diff] [blame] | 17 | lex.lex() |
| 18 | |
| 19 | |