-1

Once I use an IDE to compile my C++ code, this IDE seems know everything of my code: I could find the most original definition of any element in my code, no matter how deep it is from usage to definition.

The IDE seems know:

  1. my code logic
  2. my code structure

How IDE could do this?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

For example, it scans files to find all symbols declarations, their membership in scopes, other symbols (classes, structs and so on). Then if it find a reference to the symbol, it already knows, where it is declared. Internally, IDE uses graph models to represent the tree of dependencies and calls. If you're interested in this topic, I recommend you to read this book: http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools

12oz Mouse
  • 61
  • 4
  • yes, I'm trying to get these "symbol" kind of information from a compilation like a IDE does. Also I want to get the "structure" information. So I guess I could imitate what IDE does here. – user3789144 Jun 30 '14 at 08:20