Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] getRawSignature does not work with certain IASTNodes

> I am unable to get the string representation of certain IASTNodes using
> getRawSignature. Are there special ways to do this. Also, the
> Node.getTranslationUnit() returns a null in these cases.

getTranslationUnit() is implemented by walking up the "parent" pointers
from the IASTNode until you reach the translation unit. If this is returning
null, that means the node is not hooked up into an AST properly.

As the node does not store its own string representation, only the
translation unit does (and the node stores an offset/length into that),
having the translation unit is necessary to get the string rep of the node.

Regards,
Nate


Back to the top