summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2003-03-27 18:02:58 +0000
committerJohn Millaway <john43@users.sourceforge.net>2003-03-27 18:02:58 +0000
commit17551916f3f63d31562c1c6c15ea8749b4a9279b (patch)
treee815f489a1aa347b4f19acfaafbde5f3bb75a61b /main.c
parent6fe6068dee3020caf4bd93c2c7d71c675df3201d (diff)
Added %top block syntax.
Added test for %top block. Documented %top block.
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index 94a78da..748dfe9 100644
--- a/main.c
+++ b/main.c
@@ -441,9 +441,18 @@ void check_options ()
buf_destroy(&tmpbuf);
}
+ /* This is where we begin writing to the file. */
+
+ /* Dump the %top code. */
+ if( top_buf.elts)
+ outn((char*) top_buf.elts);
+
/* Dump the m4 definitions. */
buf_print_strings(&m4defs_buf, stdout);
m4defs_buf.nelts = 0; /* memory leak here. */
+
+ /* Place a bogus line directive, it will be fixed in the filter. */
+ outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n");
/* Dump the user defined preproc directives. */
if (userdef_buf.elts)
@@ -935,6 +944,7 @@ void flexinit (argc, argv)
buf_init (&userdef_buf, sizeof (char)); /* one long string */
buf_init (&defs_buf, sizeof (char *)); /* list of strings */
buf_init (&yydmap_buf, sizeof (char)); /* one long string */
+ buf_init (&top_buf, sizeof (char)); /* one long string */
{
const char * m4defs_init_str[] = {"m4_changequote\n",