branch : pmacs2
This commit is contained in:
moculus 2008-03-31 02:44:10 +00:00
parent c7da3f12c3
commit c70f3de119
1 changed files with 6 additions and 0 deletions

6
lex.py
View File

@ -368,6 +368,12 @@ class Lexer(object):
assert self.grammar.rules
def get_line(self):
return self.lines[self.y] + '\n'
def lex_all(self, lines):
lextokens = [[] for l in lines]
for t in lexer.lex(lines):
lextokens[t.y].append(t)
return lextokens
def lex(self, lines, y=0, x=0):
self.action = 'lex'
self.y = y