Skip to main content

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

I don't think it's possible to recover IToken 'x', but ASTName.getImageLocation() method always returns a non-null result. Don't know if this helps in your case.

-sergey

On Thu, Feb 4, 2016 at 1:31 PM, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:
Hi Alisson,

It seems from the macro definition I can get a string representing the
expansion part of the definition.

What I'm looking for, is the expansion for a particular invocation. Also,
I would like tokens, not a string.

For example, in the following code:

  #define MACRO(arg) int arg = 0;
  MACRO(x)

Given the IASTName 'x', I would like to recover the IToken 'x' that the
name was created from by the parser.

Is this possible?

Thanks,
Nate

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top