> Dear all:
> When you use ConsumeToken(), does it mean that token is part of AST
> after consuming it?
No, only Sema adds to the AST. ConsumeToken(), called by the parser, just reads the next token and updates a bit of bookkeeping data. In other words, if you haven't processed the token by the time you call ConsumeToken, it is lost.
ConsumeToken returns the source location of the token it just consumed.
> How can I print parse tree/ AST using clang?
Clang doesn't produce a parse tree. For printing the AST, the various AST nodes have dump() and print() functions.