Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] getting preprocessed tokens for an AST node

When an AST node is created for something that occurs inside a macro expansion, the parser is operating on preprocessed tokens, that is, tokens that make up the macro expansion (as opposed to tokens that make up the macro invocation).

Is there a way to, given the AST node, recover the preprocessed tokens it was created from?

IASTNode has an 'IToken getSyntax()' method (and related methods getLeadingSyntax() and getTrailingSyntax()) which serve this purpose for AST nodes occurring in normal code (not inside a macro expansion), but these methods throw ExpansionOverlapsBoundaryException if the AST node occurs inside a macro expansion.


Back to the top