#2627 Let it be known what pgen generates

This commit is contained in:
Benjamin Peterson 2008-04-13 20:35:56 +00:00
parent c477427eba
commit 820b51c170
3 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,5 @@
/* Generated by Parser/pgen */
#define single_input 256 #define single_input 256
#define file_input 257 #define file_input 257
#define eval_input 258 #define eval_input 258

View File

@ -13,6 +13,7 @@ static void printlabels(grammar *, FILE *);
void void
printgrammar(grammar *g, FILE *fp) printgrammar(grammar *g, FILE *fp)
{ {
fprintf(fp, "/* Generated by Parser/pgen */\n\n");
fprintf(fp, "#include \"pgenheaders.h\"\n"); fprintf(fp, "#include \"pgenheaders.h\"\n");
fprintf(fp, "#include \"grammar.h\"\n"); fprintf(fp, "#include \"grammar.h\"\n");
printdfas(g, fp); printdfas(g, fp);
@ -31,6 +32,8 @@ printnonterminals(grammar *g, FILE *fp)
dfa *d; dfa *d;
int i; int i;
fprintf(fp, "/* Generated by Parser/pgen */\n\n");
d = g->g_dfa; d = g->g_dfa;
for (i = g->g_ndfas; --i >= 0; d++) for (i = g->g_ndfas; --i >= 0; d++)
fprintf(fp, "#define %s %d\n", d->d_name, d->d_type); fprintf(fp, "#define %s %d\n", d->d_name, d->d_type);

View File

@ -1,3 +1,5 @@
/* Generated by Parser/pgen */
#include "pgenheaders.h" #include "pgenheaders.h"
#include "grammar.h" #include "grammar.h"
static arc arcs_0_0[3] = { static arc arcs_0_0[3] = {