Author Topic: VC2010 use a hint file just like our macro replacement?  (Read 5615 times)

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5624
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
VC2010 use a hint file just like our macro replacement?
« on: July 24, 2010, 07:02:39 am »
In Visual C++ 2010, the parser called "tag parser", see
Tag Parsing C++ - Visual C++ Team Blog - Site Home - MSDN Blogs

It seems they admit that Parsering C++ code is some times so hard. :D due to preprocessors and the complexity of c++ grammer.

An old article can be find here:
http://msdn.microsoft.com/en-us/library/ms379615%28VS.80%29.aspx

Quote
# IntelliSense does not support parsing the same file under different macro states in the same solution. (The macro state of a file refers to the values given to all macros existing in the file; different values mean different macro states for the same file.)

In most cases we will parse the header file only once (for speed reasons), even if the same header file is included under different macro states in the same source file, on different source files in the same project, or in different projects in the same solution. This means that the files that depend on this header file in a macro state that is not the one populated may not show 100-percent accurate IntelliSense information.

Our parser in CC just do the similar thing.  :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.