2 * Copyright (c) 1989 The Regents of the University of California.
5 * This code is derived from software contributed to Berkeley by
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 static char sccsid[] = "@(#)reader.c 5.7 (Berkeley) 1/20/91";
43 /* The line size must be a positive integer. One hundred was chosen */
44 /* because few lines in Yacc input grammars exceed 100 characters. */
45 /* Note that if a line exceeds LINESIZE characters, the line buffer */
46 /* will be expanded to accomodate it. */
76 char *line_format = "\t\t\t\t\t// line %d \"%s\"\n";
77 char *default_line_format = "\t\t\t\t\t// line %d\n";
84 if (cinc >= cache_size)
87 cache = REALLOC(cache, cache_size);
88 if (cache == 0) no_space();
97 register FILE *f = input_file;
101 if (saw_eof || (c = getc(f)) == EOF)
103 if (line) { FREE(line); line = 0; }
109 if (line == 0 || linesize != (LINESIZE + 1))
111 if (line) FREE(line);
112 linesize = LINESIZE + 1;
113 line = MALLOC(linesize);
114 if (line == 0) no_space();
122 if (c == '\n') { cptr = line; return; }
125 linesize += LINESIZE;
126 line = REALLOC(line, linesize);
127 if (line == 0) no_space();
144 register char *p, *s, *t;
146 if (line == 0) return (0);
148 while (*s != '\n') ++s;
149 p = MALLOC(s - line + 1);
150 if (p == 0) no_space();
154 while ((*t++ = *s++) != '\n') continue;
163 int st_lineno = lineno;
164 char *st_line = dup_line();
165 char *st_cptr = st_line + (cptr - line);
170 if (*s == '*' && s[1] == '/')
180 unterminated_comment(st_lineno, st_line, st_cptr);
208 if (line == 0) return (EOF);
234 else if (s[1] == '/')
237 if (line == 0) return (EOF);
265 if (isupper(c)) c = tolower(c);
268 else if (isdigit(c) || c == '_' || c == '.' || c == '$')
276 if (strcmp(cache, "token") == 0 || strcmp(cache, "term") == 0)
278 if (strcmp(cache, "type") == 0)
280 if (strcmp(cache, "left") == 0)
282 if (strcmp(cache, "right") == 0)
284 if (strcmp(cache, "nonassoc") == 0 || strcmp(cache, "binary") == 0)
286 if (strcmp(cache, "start") == 0)
294 if (c == '%' || c == '\\')
305 syntax_error(lineno, line, t_cptr);
315 int need_newline = 0;
316 int t_lineno = lineno;
317 char *t_line = dup_line();
318 char *t_cptr = t_line + (cptr - line - 2);
324 unterminated_text(t_lineno, t_line, t_cptr);
326 fprintf(f, line_format, lineno, input_file_name);
338 unterminated_text(t_lineno, t_line, t_cptr);
343 int s_lineno = lineno;
344 char *s_line = dup_line();
345 char *s_cptr = s_line + (cptr - line - 1);
360 unterminated_string(s_lineno, s_line, s_cptr);
369 unterminated_string(s_lineno, s_line, s_cptr);
381 do putc(c, f); while ((c = *++cptr) != '\n');
386 int c_lineno = lineno;
387 char *c_line = dup_line();
388 char *c_cptr = c_line + (cptr - line - 1);
396 if (c == '*' && *cptr == '/')
407 unterminated_comment(c_lineno, c_line, c_cptr);
418 if (need_newline) putc('\n', f);
436 if (c >= '0' && c <= '9')
438 if (c >= 'A' && c <= 'F')
439 return (c - 'A' + 10);
440 if (c >= 'a' && c <= 'f')
441 return (c - 'a' + 10);
449 register int c, quote;
454 int s_lineno = lineno;
455 char *s_line = dup_line();
456 char *s_cptr = s_line + (cptr - line);
463 if (c == quote) break;
464 if (c == '\n') unterminated_string(s_lineno, s_line, s_cptr);
467 char *c_cptr = cptr - 1;
474 if (line == 0) unterminated_string(s_lineno, s_line, s_cptr);
477 case '0': case '1': case '2': case '3':
478 case '4': case '5': case '6': case '7':
483 n = (n << 3) + (c - '0');
487 n = (n << 3) + (c - '0');
491 if (n > MAXCHAR) illegal_character(c_cptr);
498 if (n < 0 || n >= 16)
499 illegal_character(c_cptr);
504 if (i < 0 || i >= 16) break;
507 if (n > MAXCHAR) illegal_character(c_cptr);
512 case 'a': c = 7; break;
513 case 'b': c = '\b'; break;
514 case 'f': c = '\f'; break;
515 case 'n': c = '\n'; break;
516 case 'r': c = '\r'; break;
517 case 't': c = '\t'; break;
518 case 'v': c = '\v'; break;
527 if (s == 0) no_space();
529 for (i = 0; i < n; ++i)
538 for (i = 0; i < n; ++i)
540 c = ((unsigned char *)s)[i];
541 if (c == '\\' || c == cache[0])
553 case 7: cachec('a'); break;
554 case '\b': cachec('b'); break;
555 case '\f': cachec('f'); break;
556 case '\n': cachec('n'); break;
557 case '\r': cachec('r'); break;
558 case '\t': cachec('t'); break;
559 case '\v': cachec('v'); break;
561 cachec(((c >> 6) & 7) + '0');
562 cachec(((c >> 3) & 7) + '0');
563 cachec((c & 7) + '0');
577 if (n == 1 && bp->value == UNDEFINED)
578 bp->value = *(unsigned char *)s;
591 if (strcmp(name, ".") == 0 ||
592 strcmp(name, "$accept") == 0 ||
593 strcmp(name, "$end") == 0)
596 if (name[0] == '$' && name[1] == '$' && isdigit(name[2]))
599 while (isdigit(*s)) ++s;
600 if (*s == NUL) return (1);
613 for (c = *cptr; IS_IDENT(c); c = *++cptr)
617 if (is_reserved(cache)) used_reserved(cache);
619 return (lookup(cache));
630 for (c = *cptr; isdigit(c); c = *++cptr)
631 n = 10*n + (c - '0');
643 int t_lineno = lineno;
644 char *t_line = dup_line();
645 char *t_cptr = t_line + (cptr - line);
649 if (c == EOF) unexpected_EOF();
650 if (emptyOk && c == '>') {
651 ++cptr; return 0; // 0 indicates empty tag if emptyOk
653 if (!isalpha(c) && c != '_' && c != '$')
654 illegal_tag(t_lineno, t_line, t_cptr);
657 do { cachec(c); c = *++cptr; } while (IS_IDENT(c));
661 if (c == EOF) unexpected_EOF();
663 illegal_tag(t_lineno, t_line, t_cptr);
666 for (i = 0; i < ntags; ++i)
668 if (strcmp(cache, tag_table[i]) == 0)
669 return (tag_table[i]);
675 tag_table = (char **)
676 (tag_table ? REALLOC(tag_table, tagmax*sizeof(char *))
677 : MALLOC(tagmax*sizeof(char *)));
678 if (tag_table == 0) no_space();
682 if (s == 0) no_space();
684 tag_table[ntags] = s;
691 declare_tokens(assoc)
699 if (assoc != TOKEN) ++prec;
702 if (c == EOF) unexpected_EOF();
707 if (c == EOF) unexpected_EOF();
712 if (isalpha(c) || c == '_' || c == '.' || c == '$')
714 else if (c == '\'' || c == '"')
719 if (bp == goal) tokenized_start(bp->name);
724 if (bp->tag && tag != bp->tag)
725 retyped_warning(bp->name);
731 if (bp->prec && prec != bp->prec)
732 reprec_warning(bp->name);
738 if (c == EOF) unexpected_EOF();
742 value = get_number();
743 if (bp->value != UNDEFINED && value != bp->value)
744 revalued_warning(bp->name);
747 if (c == EOF) unexpected_EOF();
760 if (c == EOF) unexpected_EOF();
761 if (c != '<') syntax_error(lineno, line, cptr);
767 if (isalpha(c) || c == '_' || c == '.' || c == '$')
769 else if (c == '\'' || c == '"')
774 if (bp->tag && tag != bp->tag)
775 retyped_warning(bp->name);
787 if (c == EOF) unexpected_EOF();
788 if (!isalpha(c) && c != '_' && c != '.' && c != '$')
789 syntax_error(lineno, line, cptr);
791 if (bp->class == TERM)
792 terminal_start(bp->name);
793 if (goal && goal != bp)
804 cache = MALLOC(cache_size);
805 if (cache == 0) no_space();
810 if (c == EOF) unexpected_EOF();
811 if (c != '%') syntax_error(lineno, line, cptr);
812 switch (k = keyword())
818 copy_text(prolog_file);
844 pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *));
845 if (pitem == 0) no_space();
854 plhs = (bucket **) MALLOC(maxrules*sizeof(bucket *));
855 if (plhs == 0) no_space();
859 rprec = (short *) MALLOC(maxrules*sizeof(short));
860 if (rprec == 0) no_space();
864 rassoc = (char *) MALLOC(maxrules*sizeof(char));
865 if (rassoc == 0) no_space();
875 pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
876 if (pitem == 0) no_space();
877 memset(pitem+maxitems-300, 0, 300*sizeof(bucket *));
884 plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
885 if (plhs == 0) no_space();
886 rprec = (short *) REALLOC(rprec, maxrules*sizeof(short));
887 if (rprec == 0) no_space();
888 rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char));
889 if (rassoc == 0) no_space();
911 copy_text(local_file);
919 syntax_error(lineno, line, s_cptr);
924 if (!isalpha(c) && c != '_' && c != '.' && c != '_')
925 syntax_error(lineno, line, cptr);
929 if (bp->class == TERM)
930 terminal_start(bp->name);
936 if (c == EOF) unexpected_EOF();
937 if (c != ':') syntax_error(lineno, line, cptr);
938 start_rule(bp, s_lineno);
943 start_rule(bp, s_lineno)
947 if (bp->class == TERM)
948 terminal_lhs(s_lineno);
950 if (nrules >= maxrules)
953 rprec[nrules] = UNDEFINED;
954 rassoc[nrules] = TOKEN;
962 if (nitems >= maxitems) expand_items();
964 if (!last_was_action && plhs[nrules]->tag)
966 for (i = nitems - 1; pitem[i]; --i) continue;
967 if (pitem[i+1] == 0 || pitem[i+1]->tag != plhs[nrules]->tag)
968 default_action_warning(); /** if classes don't match exactly **/
969 } /** bug: could be superclass... **/
980 register bucket *bp, **bpp;
983 sprintf(cache, "$$%d", ++gensym);
984 bp = make_bucket(cache);
985 last_symbol->next = bp;
987 bp->tag = plhs[nrules]->tag;
990 if ((nitems += 2) > maxitems)
992 bpp = pitem + nitems - 1;
994 while (bpp[0] = bpp[-1]) --bpp;
996 if (++nrules >= maxrules)
998 plhs[nrules] = plhs[nrules-1];
1000 rprec[nrules] = rprec[nrules-1];
1001 rprec[nrules-1] = 0;
1002 rassoc[nrules] = rassoc[nrules-1];
1003 rassoc[nrules-1] = TOKEN;
1010 register bucket *bp;
1011 int s_lineno = lineno;
1014 if (c == '\'' || c == '"')
1023 start_rule(bp, s_lineno);
1028 if (last_was_action)
1029 insert_empty_rule();
1030 last_was_action = 0;
1032 if (++nitems > maxitems)
1034 pitem[nitems-1] = bp;
1045 FILE *f = action_file;
1046 int a_lineno = lineno;
1047 char *a_line = dup_line();
1048 char *a_cptr = a_line + (cptr - line);
1049 char buffer [10000];
1051 int comment_lines = 0;
1053 memset (buffer, 0, 10000);
1055 if (last_was_action)
1056 insert_empty_rule();
1057 last_was_action = 1;
1059 fprintf(f, "case %d:\n", nrules - 2);
1060 if (*cptr == '=') ++cptr;
1064 for (i = nitems - 1; pitem[i]; --i) ++n;
1073 int d_lineno = lineno;
1074 char *d_line = dup_line();
1075 char *d_cptr = d_line + (cptr - line);
1082 if (tag && strcmp(tag, "Object")) {
1083 len += sprintf(buffer + len, "((%s)yyVal)", tag);
1085 strcat (buffer + len, "yyVal");
1092 else if (isdigit(c))
1095 if (i > n) dollar_warning(d_lineno, i);
1096 if (tag && strcmp(tag, "Object"))
1097 len += sprintf(buffer + len, "((%s)yyVals[%d+yyTop])", tag, i - n);
1099 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i - n);
1103 else if (c == '-' && isdigit(cptr[1]))
1106 i = -get_number() - n;
1107 if (tag && strcmp(tag, "Object"))
1108 len += sprintf(buffer + len, "((%s)yyVals[%d+yyTop])", tag, i);
1110 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i);
1115 dollar_error(d_lineno, d_line, d_cptr);
1117 else if (cptr[1] == '$')
1119 if (ntags && plhs[nrules]->tag == 0)
1121 strcat (buffer, "yyVal");
1126 else if (isdigit(cptr[1]))
1132 if (i <= 0 || i > n)
1134 tag = pitem[nitems + i - n - 1]->tag;
1136 untyped_rhs(i, pitem[nitems + i - n - 1]->name),
1137 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i - n);
1138 else if (strcmp(tag, "Object"))
1139 len += sprintf(buffer + len, "((%s)yyVals[%d+yyTop])", tag, i - n);
1141 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i - n);
1146 dollar_warning(lineno, i);
1148 len += sprintf(buffer + len,"yyVals[%d+yyTop]", i - n);
1152 else if (cptr[1] == '-')
1158 len += sprintf(buffer + len, "yyVals[%d+yyTop]", -i - n);
1162 if (isalpha(c) || c == '_' || c == '$')
1168 } while (isalnum(c) || c == '_' || c == '$');
1178 if (line) goto loop;
1179 unterminated_action(a_lineno, a_line, a_cptr);
1182 if (depth > 0) goto loop;
1190 if (--depth > 0) goto loop;
1196 int s_lineno = lineno;
1197 char *s_line = dup_line();
1198 char *s_cptr = s_line + (cptr - line - 1);
1211 unterminated_string(s_lineno, s_line, s_cptr);
1220 unterminated_string(s_lineno, s_line, s_cptr);
1230 buffer[len++] = '*';
1231 while ((c = *++cptr) != '\n')
1233 if (c == '*' && cptr[1] == '/'){
1234 buffer[len++] = '*';
1235 buffer[len++] = ' ';
1240 buffer[len++] = '*';
1241 buffer[len++] = '/';
1242 buffer[len++] = '\n';
1247 int c_lineno = lineno;
1248 char *c_line = dup_line();
1249 char *c_cptr = c_line + (cptr - line - 1);
1251 buffer[len++] = '*';
1257 if (c == '*' && *cptr == '/')
1259 buffer[len++] = '/';
1269 unterminated_comment(c_lineno, c_line, c_cptr);
1279 if (comment_lines > 0)
1282 if ((lineno - (a_lineno + comment_lines)) > 2)
1285 char line_define[256];
1287 sprintf(mname, "case_%d()", nrules - 2);
1289 putc(' ', f); putc(' ', f);
1295 methods = NEW2(maxmethods, char *);
1297 else if (nmethods == maxmethods)
1300 methods = REALLOC (methods, maxmethods*sizeof(char *));
1303 sprintf(line_define, line_format, a_lineno, input_file_name);
1305 mbody = NEW2(5+strlen(line_define)+1+strlen(mname)+strlen(buffer)+1, char);
1306 strcpy(mbody, "void ");
1307 strcat(mbody, mname);
1308 strcat(mbody, "\n");
1309 strcat(mbody, line_define);
1310 strcat(mbody, buffer);
1311 methods[nmethods++] = mbody;
1315 fprintf(f, line_format, lineno, input_file_name);
1316 putc(' ', f); putc(' ', f);
1317 fwrite(buffer, 1, len, f);
1320 fprintf(f, "\n break;\n");
1328 register bucket *bp;
1331 if (c == '%' || c == '\\')
1339 else if ((c == 'p' || c == 'P') &&
1340 ((c = cptr[2]) == 'r' || c == 'R') &&
1341 ((c = cptr[3]) == 'e' || c == 'E') &&
1342 ((c = cptr[4]) == 'c' || c == 'C') &&
1343 ((c = cptr[5], !IS_IDENT(c))))
1346 syntax_error(lineno, line, cptr);
1349 if (isalpha(c) || c == '_' || c == '.' || c == '$')
1351 else if (c == '\'' || c == '"')
1355 syntax_error(lineno, line, cptr);
1359 if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules])
1362 rprec[nrules] = bp->prec;
1363 rassoc[nrules] = bp->assoc;
1372 initialize_grammar();
1378 if (c == EOF) break;
1379 if (isalpha(c) || c == '_' || c == '.' || c == '$' || c == '\'' ||
1382 else if (c == '{' || c == '=')
1387 start_rule(plhs[nrules-1], 0);
1392 if (mark_symbol()) break;
1395 syntax_error(lineno, line, cptr);
1405 if (tag_table == 0) return;
1407 for (i = 0; i < ntags; ++i)
1409 assert(tag_table[i]);
1418 register bucket *bp;
1419 register char *p, *s, *t;
1421 name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */
1422 for (bp = first_symbol; bp; bp = bp->next)
1423 name_pool_size += strlen(bp->name) + 1;
1424 name_pool = MALLOC(name_pool_size);
1425 if (name_pool == 0) no_space();
1427 strcpy(name_pool, "$accept");
1428 strcpy(name_pool+8, "$end");
1430 for (bp = first_symbol; bp; bp = bp->next)
1434 while (*t++ = *s++) continue;
1443 register bucket *bp;
1445 if (goal->class == UNKNOWN)
1446 undefined_goal(goal->name);
1448 for (bp = first_symbol; bp; bp = bp->next)
1450 if (bp->class == UNKNOWN)
1452 undefined_symbol_warning(bp->name);
1461 register bucket *bp;
1462 register bucket **v;
1463 register int i, j, k, n;
1467 for (bp = first_symbol; bp; bp = bp->next)
1470 if (bp->class == TERM) ++ntokens;
1472 start_symbol = ntokens;
1473 nvars = nsyms - ntokens;
1475 symbol_name = (char **) MALLOC(nsyms*sizeof(char *));
1476 if (symbol_name == 0) no_space();
1477 symbol_value = (short *) MALLOC(nsyms*sizeof(short));
1478 if (symbol_value == 0) no_space();
1479 symbol_prec = (short *) MALLOC(nsyms*sizeof(short));
1480 if (symbol_prec == 0) no_space();
1481 symbol_assoc = MALLOC(nsyms);
1482 if (symbol_assoc == 0) no_space();
1484 v = (bucket **) MALLOC(nsyms*sizeof(bucket *));
1485 if (v == 0) no_space();
1488 v[start_symbol] = 0;
1491 j = start_symbol + 1;
1492 for (bp = first_symbol; bp; bp = bp->next)
1494 if (bp->class == TERM)
1499 assert(i == ntokens && j == nsyms);
1501 for (i = 1; i < ntokens; ++i)
1504 goal->index = start_symbol + 1;
1505 k = start_symbol + 2;
1515 for (i = start_symbol + 1; i < nsyms; ++i)
1525 for (i = 1; i < ntokens; ++i)
1530 for (j = k++; j > 0 && symbol_value[j-1] > n; --j)
1531 symbol_value[j] = symbol_value[j-1];
1532 symbol_value[j] = n;
1536 if (v[1]->value == UNDEFINED)
1541 for (i = 2; i < ntokens; ++i)
1543 if (v[i]->value == UNDEFINED)
1545 while (j < k && n == symbol_value[j])
1547 while (++j < k && n == symbol_value[j]) continue;
1555 symbol_name[0] = name_pool + 8;
1556 symbol_value[0] = 0;
1558 symbol_assoc[0] = TOKEN;
1559 for (i = 1; i < ntokens; ++i)
1561 symbol_name[i] = v[i]->name;
1562 symbol_value[i] = v[i]->value;
1563 symbol_prec[i] = v[i]->prec;
1564 symbol_assoc[i] = v[i]->assoc;
1566 symbol_name[start_symbol] = name_pool;
1567 symbol_value[start_symbol] = -1;
1568 symbol_prec[start_symbol] = 0;
1569 symbol_assoc[start_symbol] = TOKEN;
1570 for (++i; i < nsyms; ++i)
1573 symbol_name[k] = v[i]->name;
1574 symbol_value[k] = v[i]->value;
1575 symbol_prec[k] = v[i]->prec;
1576 symbol_assoc[k] = v[i]->assoc;
1588 ritem = (short *) MALLOC(nitems*sizeof(short));
1589 if (ritem == 0) no_space();
1590 rlhs = (short *) MALLOC(nrules*sizeof(short));
1591 if (rlhs == 0) no_space();
1592 rrhs = (short *) MALLOC((nrules+1)*sizeof(short));
1593 if (rrhs == 0) no_space();
1594 rprec = (short *) REALLOC(rprec, nrules*sizeof(short));
1595 if (rprec == 0) no_space();
1596 rassoc = REALLOC(rassoc, nrules);
1597 if (rassoc == 0) no_space();
1600 ritem[1] = goal->index;
1605 rlhs[2] = start_symbol;
1611 for (i = 3; i < nrules; ++i)
1613 rlhs[i] = plhs[i]->index;
1619 ritem[j] = pitem[j]->index;
1620 if (pitem[j]->class == TERM)
1622 prec = pitem[j]->prec;
1623 assoc = pitem[j]->assoc;
1629 if (rprec[i] == UNDEFINED)
1644 register int i, j, k;
1646 register FILE *f = verbose_file;
1651 for (i = 2; i < nrules; ++i)
1653 if (rlhs[i] != rlhs[i-1])
1655 if (i != 2) fprintf(f, "\n");
1656 fprintf(f, "%4d %s :", i - 2, symbol_name[rlhs[i]]);
1657 spacing = strlen(symbol_name[rlhs[i]]) + 1;
1661 fprintf(f, "%4d ", i - 2);
1663 while (--j >= 0) putc(' ', f);
1667 while (ritem[k] >= 0)
1669 fprintf(f, " %s", symbol_name[ritem[k]]);
1680 create_symbol_table();
1681 read_declarations();
1683 free_symbol_table();