[cfe-dev] Recursive ASTMatcher expressions
luke.titley at gmail.com
Tue Aug 26 03:38:17 PDT 2014
Hi my name is Luke Titley,
I'm a c++ developer based in London and I'm experimenting with clang
It's really a lot of fun and already I can see the power of using AST
matchers for automatic re-factoring.
clang, really does provide a top notch set of tools.
There's one thing I'm not 100 % clear on.
Is is possible to create recursive/(self referential) ASTMatcher
For example, if I wanted a matcher to match this scenario.
int var = 1;
int * foo = &var;
int * bar = foo;
int * baz = bar;
... Add infinitum ...
I'd like my matcher to match
I want to track every pointer that is initialized with a reference to a
variable that is initialized with a value of 1.
I imagine this would be done with some sort of self referential definition.
Is that correct ?
Thanks in advance,
and thanks for all the hard work!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev