Lines Matching refs:tok
15 def __init__(self, tok, txt): argument
16 self.tok = tok
100 def validate(self, tok): argument
101 id = tok.value.upper()
102 if tok.type == 'ID':
104 raise ParserException(tok, 'Invalid License ID')
106 elif tok.type == 'EXC':
108 raise ParserException(tok, 'Invalid Exception ID')
110 raise ParserException(tok, 'Exception not valid for license %s' %self.lastid)
112 elif tok.type != 'WITH':
116 def t_RPAR(self, tok): argument
118 self.lasttok = tok.type
119 return tok
121 def t_LPAR(self, tok): argument
123 self.lasttok = tok.type
124 return tok
126 def t_ID(self, tok): argument
130 print(tok)
131 raise ParserException(tok, 'Missing parentheses')
133 tok.value = tok.value.strip()
134 val = tok.value.upper()
137 tok.type = val
139 tok.type = 'EXC'
141 self.lasttok = tok.type
142 self.validate(tok)
143 return tok
145 def t_error(self, tok): argument
146 raise ParserException(tok, 'Invalid token')
195 if pe.tok:
196 col = line.find(expr) + pe.tok.lexpos
197 tok = pe.tok.value
198 sys.stdout.write('%s: %d:%d %s: %s\n' %(fname, self.curline, col, pe.txt, tok))