I am looking for something that will parse a body of C code and, like cscope, let me search for symbols. In particular, I want to be able to get a list that says something like "in these places, foobar is used as an lvalue, and in these places, it's used as an rvalue". This seems like a pretty useful tool, and doesn't seem like too much work beyond what tools like cscope and semantic-symref already do, so I would imagine it already exists. Does it?
Asked
Active
Viewed 125 times
0
-
Assuming `foobar` is an object, there are many places where it may be used, not all of which can be discovered statically. For example, if you have a pointer `p` that points to `foobar`, the expression `*p` is effectively the lvalue `foobar`. – James McNellis May 30 '12 at 04:29
-
it would be enough to see where p was set, as foobar's address must be taken (&foobar) and in this expression, foobar is an lvalue. – leif May 30 '12 at 05:30