<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 14, 2008, at 8:16 AM, steve naroff wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Andrew,<div><br></div><div>I believe Token::getName() or tok::getTokenName() is what you are looking for...</div></div></blockquote><div><br></div><div>I think that will return "lparen" for '(' etc.  </div><div><br></div><div>Tokens can have multiple spellings for each token, for example an identifier could be 'foo' or 'bar', but even simple things like && can be spelled "&&" or "and" (in C++).  There are also a variety of digraphs etc.  If you want to get the original spelling from the source code (minus escaped newlines, trigraphs etc), use Preprocessor::getSpelling(token)</div><div><br></div><div>-Chris</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div><div>snaroff</div><div><br><div><div>On Nov 14, 2008, at 11:09 AM, Andrew Sutton wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Is there any way to get the text of a token, regardless of its kind? Like '>' or '=', or 'Foo' if Foo is an identifier.<br clear="all"><br>Andrew Sutton<br><a href="mailto:andrew.n.sutton@gmail.com">andrew.n.sutton@gmail.com</a><br> _______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></div></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>