This is not true. Ctags uses an approximate parser in order to be tolerant of coding errors, while still being able to create a usable tag file without having access to any of the include files. This is particularly important with C because of the preprocessor. C code can be rendered syntactically invalid via the use of macros, but restored to validity when macros are expanded. However, ctags must be able to parse just the source code without preprocessing and still produce something usable.

The parsers for a number of other languages that do not have preprocessors are closer to doing real lexical analysis, while still retaining some flexibility to accomodate minor coding errors.


On Apr 25, 2008, at 9:57 PM, wrote:

I've heard the ctags uses pure lexical analysis to parse in C source code. Just wondering if anyone can confirm that this is true. Thanks

Darren Hiebert