Re: preprocessor line directives

From: Jos Horsmeier <jos_at_and.nl>
Date: 9 Oct 92 17:29:52 GMT
Message-ID: <3582_at_dozo.and.nl>


In article <900_at_unidoct.chemietechnik.uni-dortmund.de> pape_at_plato.chemietechnik.uni-dortmund.de (David Pape) writes:
|I have a Pro*C (Oracle SQL) program that needs to be run through a preprocessor
|before compilation. The problem is that the Pro*C precompiler doesn't put
|#line directives in the resulting *.c file, something which I would like
|to have. Has anyone written a shell script/awk/c program to do this?
|
|Specifically, all SQL statements start with:
|
|EXEC SQL blah blah blah; /* lets say were on line 25 of SQL_file */
|
|and I would like to have:
|
|#line 25 "SQL_file"
|EXEC SQL blah blah blah;
|
|in the SQL_file.
|
|Any helpers out there??

Maybe, if you stick a line like this:

#line __LINE__ __FILE__

just before and just followiing the embedded SQL statements in your code and run the C preprocessor first, before running the SQL preprocessor (or precompiler?) I said `maybe,' because I don't know if all SQL statements are valid pp-tokens for the C preprocessor ...

I hope this works, otherwise you have to do a lot of string fiddling yourself ...

kind regards,

Jos aka jos_at_and.nl Received on Fri Oct 09 1992 - 18:29:52 CET

Original text of this message