Lines Matching refs:token
83 token = XmlToken(ELEMENT_START, name, attributes, line, column)
84 self.tokens.append(token)
89 token = XmlToken(ELEMENT_END, name, None, line, column)
90 self.tokens.append(token)
101 token = XmlToken(CHARACTER_DATA, self.character_data, None, line, column)
102 self.tokens.append(token)
123 token = XmlToken(EOF, None, None, line, column)
125 token = self.tokens[self.index]
127 return token
152 self.token = self.tokenizer.next()
155 return self.token.type == ELEMENT_START and self.token.name_or_data == name
158 return self.token.type == ELEMENT_END and self.token.name_or_data == name
161 while self.token.type == CHARACTER_DATA:
163 if self.token.type != ELEMENT_START:
164 raise TokenMismatch(XmlToken(ELEMENT_START, name), self.token)
165 if self.token.name_or_data != name:
166 raise TokenMismatch(XmlToken(ELEMENT_START, name), self.token)
167 attrs = self.token.attrs
172 while self.token.type == CHARACTER_DATA:
174 if self.token.type != ELEMENT_END:
175 raise TokenMismatch(XmlToken(ELEMENT_END, name), self.token)
176 if self.token.name_or_data != name:
177 raise TokenMismatch(XmlToken(ELEMENT_END, name), self.token)
182 while self.token.type == CHARACTER_DATA:
183 data += self.token.name_or_data
198 while self.token.type not in (ELEMENT_END, EOF):
201 if self.token.type != EOF:
218 while self.token.type == ELEMENT_START:
219 if self.token.name_or_data == 'arg':
222 elif self.token.name_or_data == 'ret':
224 elif self.token.name_or_data == 'call':
227 elif self.token.name_or_data == 'time':
230 raise TokenMismatch("<arg ...> or <ret ...>", self.token)
258 if self.token.type == ELEMENT_START:
259 if self.token.name_or_data in expected_tokens:
260 method = getattr(self, 'parse_' + self.token.name_or_data)
262 raise TokenMismatch(" or " .join(expected_tokens), self.token)
314 while self.token.type != ELEMENT_END:
329 while self.token.type != ELEMENT_END: