Related articles |
---|
C preprocessor that include column information benwar@gmx.net (Ben War) (2002-02-06) |
Re: C preprocessor that include column information zackw@panix.com (Zack Weinberg) (2002-02-16) |
Re: C preprocessor that include column information schnetter@uni-tuebingen.de (Erik Schnetter) (2002-02-16) |
Re: C preprocessor that include column information idbaxter@semdesigns.com (Ira D. Baxter) (2002-02-16) |
From: | Zack Weinberg <zackw@panix.com> |
Newsgroups: | comp.compilers |
Date: | 16 Feb 2002 01:10:22 -0500 |
Organization: | PANIX -- Public Access Networks Corp. |
References: | 02-02-030 |
Keywords: | C, parse |
Posted-Date: | 16 Feb 2002 01:10:22 EST |
Ben War <benwar@gmx.net> writes:
>In A Research Project We Are Using Already Preprocessed C Code, Where We
>Have To Map Source Code Positions Back Onto The Original Sources. ...
> Now in gcc-3, the preprocessor doesn't
>preserve whitespace any longer and we have to use a different
>preprocessor. This raised the question, if there is a c preprocessor
>that not only annotates the preprocessed code with line number
>information but also includes column information?
Um, actually, the gcc-3 preprocessor does that. It's not accessible
from the textual output, but if you use the library interface (which
is pretty easy) every token comes with a column position.
We haven't finished documenting the interface yet, and the library
isn't really set up to be used outside GCC, but you can look at
cppinternals.texi from the GCC source tree, or c-lex.c, fix-header.c,
and cpplib.h. I'm also happy to answer questions - please use
my other address, <zack@codesourcery.com>.
zw
Return to the
comp.compilers page.
Search the
comp.compilers archives again.