Lines Matching refs:id

93     It inherits the class in libclang, with an extra id property to hold the
120 def id(self):
127 @id.setter
128 def id(self, new_id):
143 if self.id == 'defined':
144 return self.id
146 return "(ident %s)" % self.id
148 return self.id
151 return self.id
162 # http://llvm.org/bugs/show_bug.cgi?id=22243, http://reviews.llvm.org/D7277
321 def expect(self, id):
326 tokid = self._token.id
327 if tokid == id:
330 tokid, id))
332 def expectToken(self, id, line, col):
333 self.expect(id)
337 id, self._token.lineno, line))
343 for id, line, col in tokens:
344 self.expectToken(id, line, col)
439 def expectId(self, id):
440 """Check that a given token id is at the current position."""
442 if self._index >= self._num_tokens or token.id != id:
445 id, token.id))
449 token = self.tokens[self._index].id
460 token = self.tokens[self._index].id
473 token = self.tokens[self._index].id
505 if t.id == tokMINUS and self._index + 1 < self._num_tokens:
511 if t.id == tokPLUS and self._index + 1 < self._num_tokens:
521 if t.id != tokDEFINED:
528 self.tokens[self._index].id == tokLPAREN):
546 return ("defined", t.id)
556 name = t.id
560 self.tokens[self._index].id != tokLPAREN):
568 id = self.tokens[self._index].id
569 if id == tokLPAREN:
571 elif depth == 1 and (id == tokCOMMA or id == tokRPAREN):
575 if id == tokRPAREN:
578 elif id == tokRPAREN:
604 node = (op.id, node, rhs)
612 return (op.id, self.parseExpression(self.precedence(op)))
615 if op.id == tokLPAREN:
619 elif op.id == "?":
623 elif op.id == '+' or op.id == '-' or op.kind == TokenKind.LITERAL:
627 elif op.id == tokDEFINED:
634 self.tokens[self._index].id))
638 return token.id in self.binaries
641 return token.id in self.unaries
644 return self.precedences.get(token.id)
991 tok.id = tokDEFINED
998 tok1.id = tokNOT
999 tok2.id = tokDEFINED
1057 if t.id == '{':
1063 elif t.id == '}':
1069 (tokens[i+1].id == ';' or
1070 tokens[i+1].id in ['else', '__attribute__',
1079 elif t.id == ';':
1084 elif t.id == ',' and t.cursor.kind == CursorKind.ENUM_DECL:
1165 expr = strip_space(' '.join([tok.id for tok in self.tokens]))
1173 result = "#error %s" % ' '.join([tok.id for tok in self.tokens])
1179 result += ''.join([tok.id for tok in self.tokens])
1297 tokid = tok.id
1325 if tok.id in ['struct', 'typedef', 'enum', 'union',
1347 tokid = b.tokens[j].id
1355 ident = b.tokens[j].id
1399 if tok.id in replacements:
1400 tok.id = replacements[tok.id]
1474 print ' ' * 2, t.id, t.kind, t.cursor.kind
1519 directive = tokens[j+1].id
1529 id = ''
1530 # We need to separate the id from the remaining of
1532 if (i + 1 < len(tokens) and tokens[i+1].id == '(' and
1536 id += tokens[i].id
1542 id += tokens[i].id
1543 # Advance to the next token that follows the macro id
1548 lineno=t.location.line, identifier=id))
1559 directive = tokens[i+1].id