Lines Matching refs:token
85 token = XmlToken(ELEMENT_START, name, attributes, line, column)
86 self.tokens.append(token)
91 token = XmlToken(ELEMENT_END, name, None, line, column)
92 self.tokens.append(token)
103 token = XmlToken(CHARACTER_DATA, self.character_data, None, line, column)
104 self.tokens.append(token)
125 token = XmlToken(EOF, None, None, line, column)
127 token = self.tokens[self.index]
129 return token
154 self.token = self.tokenizer.next()
157 return self.token.type == ELEMENT_START and self.token.name_or_data == name
160 return self.token.type == ELEMENT_END and self.token.name_or_data == name
163 while self.token.type == CHARACTER_DATA:
165 if self.token.type != ELEMENT_START:
166 raise TokenMismatch(XmlToken(ELEMENT_START, name), self.token)
167 if self.token.name_or_data != name:
168 raise TokenMismatch(XmlToken(ELEMENT_START, name), self.token)
169 attrs = self.token.attrs
174 while self.token.type == CHARACTER_DATA:
176 if self.token.type != ELEMENT_END:
177 raise TokenMismatch(XmlToken(ELEMENT_END, name), self.token)
178 if self.token.name_or_data != name:
179 raise TokenMismatch(XmlToken(ELEMENT_END, name), self.token)
184 while self.token.type == CHARACTER_DATA:
185 data += self.token.name_or_data
200 while self.token.type not in (ELEMENT_END, EOF):
203 if self.token.type != EOF:
220 while self.token.type == ELEMENT_START:
221 if self.token.name_or_data == 'arg':
224 elif self.token.name_or_data == 'ret':
226 elif self.token.name_or_data == 'call':
229 elif self.token.name_or_data == 'time':
232 raise TokenMismatch("<arg ...> or <ret ...>", self.token)
260 if self.token.type == ELEMENT_START:
261 if self.token.name_or_data in expected_tokens:
262 method = getattr(self, 'parse_' + self.token.name_or_data)
264 raise TokenMismatch(" or " .join(expected_tokens), self.token)
316 while self.token.type != ELEMENT_END:
331 while self.token.type != ELEMENT_END: