Lines Matching refs:id
122 def id(self): member in Token
129 @id.setter
130 def id(self, new_id): member in Token
145 if self.id == 'defined':
146 return self.id
148 return "(ident %s)" % self.id
150 return self.id
153 return self.id
324 token_list.append((token.id, token.location.line,
327 token_list.append(token.id)
416 def expectId(self, id): argument
419 if self._index >= self._num_tokens or token.id != id:
422 id, token.id))
426 token = self.tokens[self._index].id
437 token = self.tokens[self._index].id
450 token = self.tokens[self._index].id
482 if t.id == tokMINUS and self._index + 1 < self._num_tokens:
488 if t.id == tokPLUS and self._index + 1 < self._num_tokens:
498 if t.id != tokDEFINED:
505 self.tokens[self._index].id == tokLPAREN):
523 return ("defined", t.id)
533 name = t.id
537 self.tokens[self._index].id != tokLPAREN):
545 id = self.tokens[self._index].id
546 if id == tokLPAREN:
548 elif depth == 1 and (id == tokCOMMA or id == tokRPAREN):
552 if id == tokRPAREN:
555 elif id == tokRPAREN:
581 node = (op.id, node, rhs)
589 return (op.id, self.parseExpression(self.precedence(op)))
592 if op.id == tokLPAREN:
596 elif op.id == "?":
600 elif op.id == '+' or op.id == '-' or op.kind == TokenKind.LITERAL:
604 elif op.id == tokDEFINED:
611 self.tokens[self._index].id))
615 return token.id in self.binaries
618 return token.id in self.unaries
621 return self.precedences.get(token.id)
971 tok.id = tokDEFINED
978 tok1.id = tokNOT
979 tok2.id = tokDEFINED
1037 if t.id == '{':
1041 if i < 2 or tokens[i-2].id != 'extern' or tokens[i-1].id != '"C"':
1045 elif t.id == '}':
1052 (tokens[i+1].id == ';' or
1053 tokens[i+1].id in ['else', '__attribute__',
1062 elif t.id == ';':
1067 elif t.id == ',' and t.cursor.kind == CursorKind.ENUM_DECL:
1139 expr = strip_space(' '.join([tok.id for tok in self.tokens]))
1147 result = "#error %s" % ' '.join([tok.id for tok in self.tokens])
1153 result += ''.join([tok.id for tok in self.tokens])
1273 token_id = block.tokens[i].id
1277 if (i >= 2 and block.tokens[i-2].id == 'extern' and
1278 block.tokens[i-1].id == '"C"'):
1289 if block.tokens[i].id == ';':
1306 block.tokens[i-1].id in macros):
1319 if block.tokens[i].id == ')':
1323 elif block.tokens[i].id == '(':
1371 if (tok.kind == TokenKind.KEYWORD and tok.id == 'struct'
1372 and (i + 2) < len(b.tokens) and b.tokens[i + 2].id == '{'):
1373 struct_name = b.tokens[i + 1].id
1377 while end < len(b.tokens) and b.tokens[end].id != '}':
1380 while end < len(b.tokens) and b.tokens[end].id != ';':
1389 if tok.id in replacements:
1390 tok.id = replacements[tok.id]
1470 print ' ' * 2, t.id, t.kind, t.cursor.kind
1515 directive = tokens[j+1].id
1525 id = ''
1528 if (i + 1 < len(tokens) and tokens[i+1].id == '(' and
1532 id += tokens[i].id
1538 id += tokens[i].id
1544 lineno=t.location.line, identifier=id))
1555 directive = tokens[i+1].id