Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to find all ifs, switch cases, etc.
How to find all ifs, switch cases, etc. [message #1754567] Mon, 20 February 2017 11:20 Go to next message
Alex Diese is currently offline Alex DieseFriend
Messages: 1
Registered: February 2017
Junior Member
So traversing the hole AST with an Visitor to find all IASTIfStatements or other statements in large files is very time consuming. Is there an other way to do so? Is there a way to do that index-based?
Re: How to find all ifs, switch cases, etc. [message #1754720 is a reply to message #1754567] Tue, 21 February 2017 19:14 Go to previous message
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 256
Registered: July 2009
Senior Member
There's no way that I know of that is index-based, the index primarily stores names and type information, not control flow (well, except for callers of functions which it does store). But if by time consuming you mean that it takes long for you to type Wink maybe you could be interested in the Control Flow Graph code available in org.eclipse.cdt.codan.core.cxx.internal.model.cfg. It parses the AST for you and offers a higher level interface. But it will still be as slow, CPU-wise as it does traverse the AST as well.
Previous Topic:Where are debug launcher "source container" types documented?
Next Topic:Makefile problems
Goto Forum:
  


Current Time: Thu Apr 18 23:24:34 GMT 2024

Powered by FUDForum. Page generated in 0.01875 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top