version 1.19, 2014/01/08 22:55:59 |
version 1.20, 2014/02/21 02:18:00 |
|
|
int j; |
int j; |
|
|
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %slhs[] =\n" |
"const short %slhs[] =\n" |
"#else\n" |
"\t{%42d,", symbol_prefix, symbol_value[start_symbol]); |
"short %slhs[] =\n" |
|
"#endif\n" |
|
"\t{%42d,", symbol_prefix, symbol_prefix, symbol_value[start_symbol]); |
|
|
|
j = 10; |
j = 10; |
for (i = 3; i < nrules; i++) |
for (i = 3; i < nrules; i++) |
|
|
fprintf(output_file, "\n};\n"); |
fprintf(output_file, "\n};\n"); |
|
|
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %slen[] =\n" |
"const short %slen[] =\n" |
"#else\n" |
"\t{%42d,", symbol_prefix, 2); |
"short %slen[] =\n" |
|
"#endif\n" |
|
"\t{%42d,", symbol_prefix, symbol_prefix, 2); |
|
|
|
j = 10; |
j = 10; |
for (i = 3; i < nrules; i++) |
for (i = 3; i < nrules; i++) |
|
|
int i, j; |
int i, j; |
|
|
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %sdefred[] =\n" |
"const short %sdefred[] =\n" |
"#else\n" |
|
"short %sdefred[] =\n" |
|
"#endif\n" |
|
"\t{%39d,", |
"\t{%39d,", |
symbol_prefix, symbol_prefix, (defred[0] ? defred[0] - 2 : 0)); |
symbol_prefix, (defred[0] ? defred[0] - 2 : 0)); |
|
|
j = 10; |
j = 10; |
for (i = 1; i < nstates; i++) |
for (i = 1; i < nstates; i++) |
|
|
|
|
k = default_goto(start_symbol + 1); |
k = default_goto(start_symbol + 1); |
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %sdgoto[] =\n" |
"const short %sdgoto[] =\n" |
"#else\n" |
"\t{%40d,", symbol_prefix, k); |
"short %sdgoto[] =\n" |
|
"#endif\n" |
|
"\t{%40d,", symbol_prefix, symbol_prefix, k); |
|
save_column(start_symbol + 1, k); |
save_column(start_symbol + 1, k); |
|
|
j = 10; |
j = 10; |
|
|
int i, j; |
int i, j; |
|
|
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %ssindex[] =\n" |
"const short %ssindex[] =\n" |
"#else\n" |
"\t{%39d,", symbol_prefix, base[0]); |
"short %ssindex[] =\n" |
|
"#endif\n" |
|
"\t{%39d,", symbol_prefix, symbol_prefix, base[0]); |
|
|
|
j = 10; |
j = 10; |
for (i = 1; i < nstates; i++) |
for (i = 1; i < nstates; i++) |
|
|
if (!rflag) outline += 2; |
if (!rflag) outline += 2; |
fprintf(output_file, |
fprintf(output_file, |
"};\n" |
"};\n" |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %srindex[] =\n" |
"const short %srindex[] =\n" |
"#else\n" |
"\t{%39d,", symbol_prefix, base[nstates]); |
"short %srindex[] =\n" |
|
"#endif\n" |
|
"\t{%39d,", symbol_prefix, symbol_prefix, base[nstates]); |
|
|
|
j = 10; |
j = 10; |
for (i = nstates + 1; i < 2*nstates; i++) |
for (i = nstates + 1; i < 2*nstates; i++) |
|
|
if (!rflag) outline += 2; |
if (!rflag) outline += 2; |
fprintf(output_file, |
fprintf(output_file, |
"};\n" |
"};\n" |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %sgindex[] =\n" |
"const short %sgindex[] =\n" |
"#else\n" |
"\t{%39d,", symbol_prefix, base[2*nstates]); |
"short %sgindex[] =\n" |
|
"#endif\n" |
|
"\t{%39d,", symbol_prefix, symbol_prefix, base[2*nstates]); |
|
|
|
j = 10; |
j = 10; |
for (i = 2*nstates + 1; i < nvectors - 1; i++) |
for (i = 2*nstates + 1; i < nvectors - 1; i++) |
|
|
++outline; |
++outline; |
fprintf(code_file, "#define YYTABLESIZE %d\n", high); |
fprintf(code_file, "#define YYTABLESIZE %d\n", high); |
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %stable[] =\n" |
"const short %stable[] =\n" |
"#else\n" |
"\t{%40d,", symbol_prefix, table[0]); |
"short %stable[] =\n" |
|
"#endif\n" |
|
"\t{%40d,", symbol_prefix, symbol_prefix, table[0]); |
|
|
|
j = 10; |
j = 10; |
for (i = 1; i <= high; i++) |
for (i = 1; i <= high; i++) |
|
|
int j; |
int j; |
|
|
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const short %scheck[] =\n" |
"const short %scheck[] =\n" |
"#else\n" |
"\t{%40d,", symbol_prefix, check[0]); |
"short %scheck[] =\n" |
|
"#endif\n" |
|
"\t{%40d,", symbol_prefix, symbol_prefix, check[0]); |
|
|
|
j = 10; |
j = 10; |
for (i = 1; i <= high; i++) |
for (i = 1; i <= high; i++) |
|
|
if (!rflag) ++outline; |
if (!rflag) ++outline; |
fprintf(output_file, |
fprintf(output_file, |
"#if YYDEBUG\n" |
"#if YYDEBUG\n" |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const char * const %sname[] =\n" |
"const char * const %sname[] =\n" |
"#else\n" |
"\t{", symbol_prefix); |
"char *%sname[] =\n" |
|
"#endif\n" |
|
"\t{", symbol_prefix, symbol_prefix); |
|
j = 80; |
j = 80; |
for (i = 0; i <= max; ++i) |
for (i = 0; i <= max; ++i) |
{ |
{ |
|
|
|
|
if (!rflag) ++outline; |
if (!rflag) ++outline; |
fprintf(output_file, |
fprintf(output_file, |
"#if defined(__cplusplus) || defined(__STDC__)\n" |
|
"const char * const %srule[] =\n" |
"const char * const %srule[] =\n" |
"#else\n" |
"\t{", symbol_prefix); |
"char *%srule[] =\n" |
|
"#endif\n" |
|
"\t{", symbol_prefix, symbol_prefix); |
|
for (i = 2; i < nrules; ++i) |
for (i = 2; i < nrules; ++i) |
{ |
{ |
fprintf(output_file, "\"%s :", symbol_name[rlhs[i]]); |
fprintf(output_file, "\"%s :", symbol_name[rlhs[i]]); |