Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More lemon.c tweaks.
  • Loading branch information
icculus committed Feb 28, 2009
1 parent 7869285 commit 83097a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions misc/lemon.c
Expand Up @@ -1530,7 +1530,9 @@ char **argv;
/* Produce a header file for use by the scanner. (This step is
** omitted if the "-m" option is used because makeheaders will
** generate the file for us.) */
#if !__MOJOSHADER__
if( !mhflag ) ReportHeader(&lem);
#endif
}
if( statistics ){
printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n",
Expand Down Expand Up @@ -3608,7 +3610,11 @@ int mhflag; /* Output in makeheaders format if true */

in = tplt_open(lemp);
if( in==0 ) return;
#if __MOJOSHADER__
out = file_open(lemp,".c","wb");
#else
out = file_open(lemp,".h","wb");
#endif
if( out==0 ){
fclose(in);
return;
Expand All @@ -3618,11 +3624,13 @@ int mhflag; /* Output in makeheaders format if true */

/* Generate the include code, if any */
tplt_print(out,lemp,lemp->include,&lineno);
#if !__MOJOSHADER__
if( mhflag ){
char *name = file_makename(lemp, ".h");
fprintf(out,"#include \"%s\"\n", name); lineno++;
free(name);
}
#endif
tplt_xfer(lemp->name,in,out,&lineno);

/* Generate #defines for all tokens */
Expand Down

0 comments on commit 83097a8

Please sign in to comment.