Help: add statements to generator output files 
Author Message
 Help: add statements to generator output files

I wrote a small _generator_ which expands a generic file for
database access (written in ESQL/C) with the needed table- and
field-names. The generator gets all the field-names for each
table in the database and produces one file per table with
functions and statements to insert, update, delete and fetch
records.
Those many functions can't be done in the usual C fashion (with
just one function for each group of commands and different parameters),
because we use an older version of the INFORMIX Database (SE and
INFORMIX ESQL/C 4.0), which has only *static* cursors and doesn't
work with variable cursor-names.

So I have *one* (generic) file in the beginning, and x generated
ESQL/C-files (one for each table) after the generator run.
So far so good. But now I'd like to fine tune the generated
ESQL/C-sources with additional (table-specific) statements.
What can I do to have the best of both worlds?
    1) I'd like to to be able to change my generic file and rerun
        the generator, when needed, thus producing new files
        (in truth overwriting my "old" generated files).
    2) I'd like to add specific statements to those generated files,
        where the default statements just aren't enough.
        (Of course, I don't want to loose my additional "handwritten"
        refinements, which I've done so far, each time the generator
        produces a new version)

The best solution seems to be, at least for me, to insert default
function calls (see #1, #2, #3 just below) at various locations
in the generic source-file and resolve those functions in extra files.

table1_insert()
{
    table1_insert_init();               /* default #1 */
    /* generated  code ... */
    table1_insert_body();               /* default #2 */
    /* even more generated code ... */
    table1_insert_exit();               /* default #3 */

Quote:
}

The problem is, I don't know in advance, how many "escapes" (default
functions) I need and where I need them all.

Any help or hints are highly appreciated!

Thanks in advance, Klaus

-------------------------------------------------------

Gutenbergstr. 1 B   | Phone: 0049 941 / 990 225
93051 Regensburg    | Germany
-------------------------------------------------------



Thu, 17 Oct 1996 04:20:17 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to add output to VC6 output pane?

2. Custom Appwizards - add compiler options to output mak file

3. DllImport statement generator

4. read a file than produce 2 output files(HELP)

5. read a file than produce 2 output files(HELP)

6. fprintf statements changing value of output !?

7. redirect TRACE statements output

8. Controlling TRACE statement output in debugger

9. ANSI C Run Time Erroe to output data to the output file

10. VC 5 TRACE output to a file instead of the output window

11. MFC CDC HTML Output (ala Meta File Output)

12. Need Help with output to multiple files

 

 
Powered by phpBB® Forum Software