Lines Matching refs:tok
16 def __init__(self, tok, txt): argument
17 self.tok = tok
130 def validate(self, tok): argument
131 id = tok.value.upper()
132 if tok.type == 'ID':
134 raise ParserException(tok, 'Invalid License ID')
136 elif tok.type == 'EXC':
138 raise ParserException(tok, 'Invalid Exception ID')
140 raise ParserException(tok, 'Exception not valid for license %s' %self.lastid)
142 elif tok.type != 'WITH':
146 def t_RPAR(self, tok): argument
148 self.lasttok = tok.type
149 return tok
151 def t_LPAR(self, tok): argument
153 self.lasttok = tok.type
154 return tok
156 def t_ID(self, tok): argument
160 print(tok)
161 raise ParserException(tok, 'Missing parentheses')
163 tok.value = tok.value.strip()
164 val = tok.value.upper()
167 tok.type = val
169 tok.type = 'EXC'
171 self.lasttok = tok.type
172 self.validate(tok)
173 return tok
175 def t_error(self, tok): argument
176 raise ParserException(tok, 'Invalid token')
230 if pe.tok:
231 col = line.find(expr) + pe.tok.lexpos
232 tok = pe.tok.value
233 sys.stdout.write('%s: %d:%d %s: %s\n' %(fname, self.curline, col, pe.txt, tok))