1 /* $NetBSD: reader.c,v 1.8 2013/04/06 14:52:24 christos Exp $ */
3 /* Id: reader.c,v 1.36 2012/05/26 16:05:41 tom Exp */
8 __RCSID("$NetBSD: reader.c,v 1.8 2013/04/06 14:52:24 christos Exp $");
10 /* The line size must be a positive integer. One hundred was chosen */
11 /* because few lines in Yacc input grammars exceed 100 characters. */
12 /* Note that if a line exceeds LINESIZE characters, the line buffer */
13 /* will be expanded to accomodate it. */
20 static void start_rule(bucket
*bp
, int s_lineno
);
23 static int cinc
, cache_size
;
27 static char **tag_table
;
37 static char last_was_action
;
40 static bucket
**pitem
;
45 static size_t name_pool_size
;
46 static char *name_pool
;
48 char line_format
[] = "#line %d \"%s\"\n";
57 if (cinc
>= cache_size
)
60 cache
= TREALLOC(char, cache
, cache_size
);
63 cache
[cinc
] = (char)c
;
74 if (saw_eof
|| (c
= getc(f
)) == EOF
)
86 if (line
== 0 || linesize
!= (LINESIZE
+ 1))
90 linesize
= LINESIZE
+ 1;
91 line
= TMALLOC(char, linesize
);
107 linesize
+= LINESIZE
;
108 line
= TREALLOC(char, line
, linesize
);
132 p
= TMALLOC(char, s
- line
+ 1);
137 while ((*t
++ = *s
++) != '\n')
147 int st_lineno
= lineno
;
148 char *st_line
= dup_line();
149 char *st_cptr
= st_line
+ (cptr
- line
);
154 if (*s
== '*' && s
[1] == '/')
164 unterminated_comment(st_lineno
, st_line
, st_cptr
);
218 else if (s
[1] == '/')
236 * Compare keyword to cached token, treating '_' and '-' the same. Some
237 * grammars rely upon this misfeature.
240 matchec(const char *name
)
242 const char *p
= cache
;
243 const char *q
= name
;
244 int code
= 0; /* assume mismatch */
246 while (*p
!= '\0' && *q
!= '\0')
256 if (*p
== '\0' && *q
== '\0')
299 if (matchec("token") || matchec("term"))
305 if (matchec("right"))
307 if (matchec("nonassoc") || matchec("binary"))
309 if (matchec("start"))
311 if (matchec("union"))
313 if (matchec("ident"))
315 if (matchec("expect"))
317 if (matchec("expect-rr"))
319 if (matchec("pure-parser"))
320 return (PURE_PARSER
);
321 if (matchec("parse-param"))
322 return (PARSE_PARAM
);
323 if (matchec("lex-param"))
333 if (c
== '%' || c
== '\\')
344 syntax_error(lineno
, line
, t_cptr
);
353 FILE *f
= output_file
;
359 syntax_error(lineno
, line
, cptr
);
361 fprintf(f
, "#ident \"");
386 int need_newline
= 0;
387 int t_lineno
= lineno
;
388 char *t_line
= dup_line();
389 char *t_cptr
= t_line
+ (cptr
- line
- 2);
395 unterminated_text(t_lineno
, t_line
, t_cptr
);
398 fprintf(f
, line_format
, lineno
, input_file_name
);
411 unterminated_text(t_lineno
, t_line
, t_cptr
);
416 int s_lineno
= lineno
;
417 char *s_line
= dup_line();
418 char *s_cptr
= s_line
+ (cptr
- line
- 1);
433 unterminated_string(s_lineno
, s_line
, s_cptr
);
442 unterminated_string(s_lineno
, s_line
, s_cptr
);
455 while ((c
= *++cptr
) != '\n')
457 if (c
== '*' && cptr
[1] == '/')
467 int c_lineno
= lineno
;
468 char *c_line
= dup_line();
469 char *c_cptr
= c_line
+ (cptr
- line
- 1);
477 if (c
== '*' && *cptr
== '/')
488 unterminated_comment(c_lineno
, c_line
, c_cptr
);
515 puts_both(const char *s
)
519 fputs(s
, union_file
);
536 int u_lineno
= lineno
;
537 char *u_line
= dup_line();
538 char *u_cptr
= u_line
+ (cptr
- line
- 6);
541 over_unionized(cptr
- 6);
545 fprintf(text_file
, line_format
, lineno
, input_file_name
);
547 puts_both("#ifdef YYSTYPE\n");
548 puts_both("#undef YYSTYPE_IS_DECLARED\n");
549 puts_both("#define YYSTYPE_IS_DECLARED 1\n");
550 puts_both("#endif\n");
551 puts_both("#ifndef YYSTYPE_IS_DECLARED\n");
552 puts_both("#define YYSTYPE_IS_DECLARED 1\n");
553 puts_both("typedef union");
565 unterminated_union(u_lineno
, u_line
, u_cptr
);
575 puts_both(" YYSTYPE;\n");
576 puts_both("#endif /* !YYSTYPE_IS_DECLARED */\n");
585 int s_lineno
= lineno
;
586 char *s_line
= dup_line();
587 char *s_cptr
= s_line
+ (cptr
- line
- 1);
600 unterminated_string(s_lineno
, s_line
, s_cptr
);
609 unterminated_string(s_lineno
, s_line
, s_cptr
);
620 while ((c
= *++cptr
) != '\n')
622 if (c
== '*' && cptr
[1] == '/')
636 int c_lineno
= lineno
;
637 char *c_line
= dup_line();
638 char *c_cptr
= c_line
+ (cptr
- line
- 1);
646 if (c
== '*' && *cptr
== '/')
657 unterminated_comment(c_lineno
, c_line
, c_cptr
);
669 * Keep a linked list of parameters
693 buf
= TMALLOC(char, linesize
);
696 for (i
= 0; (c
= *cptr
++) != '}'; i
++)
709 while (i
>= 0 && isspace(UCH(buf
[i
])))
715 while (i
>= 0 && level
> 0 && buf
[i
] != '[')
719 else if (buf
[i
] == '[')
732 while (i
>= 0 && (isalnum(UCH(buf
[i
])) ||
736 if (!isspace(UCH(buf
[i
])) && buf
[i
] != '*')
741 p
= TMALLOC(param
, 1);
744 p
->type2
= strdup(buf
+ type2
);
749 p
->name
= strdup(buf
+ name
);
777 syntax_error(lineno
, line
, cptr
);
783 if (c
>= '0' && c
<= '9')
785 if (c
>= 'A' && c
<= 'F')
786 return (c
- 'A' + 10);
787 if (c
>= 'a' && c
<= 'f')
788 return (c
- 'a' + 10);
800 int s_lineno
= lineno
;
801 char *s_line
= dup_line();
802 char *s_cptr
= s_line
+ (cptr
- line
);
812 unterminated_string(s_lineno
, s_line
, s_cptr
);
815 char *c_cptr
= cptr
- 1;
823 unterminated_string(s_lineno
, s_line
, s_cptr
);
838 n
= (n
<< 3) + (c
- '0');
842 n
= (n
<< 3) + (c
- '0');
847 illegal_character(c_cptr
);
854 if (n
< 0 || n
>= 16)
855 illegal_character(c_cptr
);
860 if (i
< 0 || i
>= 16)
865 illegal_character(c_cptr
);
898 s
= TMALLOC(char, n
);
901 for (i
= 0; i
< n
; ++i
)
910 for (i
= 0; i
< n
; ++i
)
913 if (c
== '\\' || c
== cache
[0])
947 cachec(((c
>> 6) & 7) + '0');
948 cachec(((c
>> 3) & 7) + '0');
949 cachec((c
& 7) + '0');
963 if (n
== 1 && bp
->value
== UNDEFINED
)
971 is_reserved(char *name
)
975 if (strcmp(name
, ".") == 0 ||
976 strcmp(name
, "$accept") == 0 ||
977 strcmp(name
, "$end") == 0)
980 if (name
[0] == '$' && name
[1] == '$' && isdigit(UCH(name
[2])))
983 while (isdigit(UCH(*s
)))
998 for (c
= *cptr
; IS_IDENT(c
); c
= *++cptr
)
1002 if (is_reserved(cache
))
1003 used_reserved(cache
);
1005 return (lookup(cache
));
1015 for (c
= *cptr
; isdigit(c
); c
= *++cptr
)
1016 n
= (Value_t
) (10 * n
+ (c
- '0'));
1027 int t_lineno
= lineno
;
1028 char *t_line
= dup_line();
1029 char *t_cptr
= t_line
+ (cptr
- line
);
1035 if (!isalpha(c
) && c
!= '_' && c
!= '$')
1036 illegal_tag(t_lineno
, t_line
, t_cptr
);
1044 while (IS_IDENT(c
));
1051 illegal_tag(t_lineno
, t_line
, t_cptr
);
1054 for (i
= 0; i
< ntags
; ++i
)
1056 if (strcmp(cache
, tag_table
[i
]) == 0)
1059 return (tag_table
[i
]);
1063 if (ntags
>= tagmax
)
1068 ? TREALLOC(char *, tag_table
, tagmax
)
1069 : TMALLOC(char *, tagmax
));
1070 NO_SPACE(tag_table
);
1073 s
= TMALLOC(char, cinc
);
1077 tag_table
[ntags
] = s
;
1084 declare_tokens(int assoc
)
1107 if (isalpha(c
) || c
== '_' || c
== '.' || c
== '$')
1109 else if (c
== '\'' || c
== '"')
1115 tokenized_start(bp
->name
);
1120 if (bp
->tag
&& tag
!= bp
->tag
)
1121 retyped_warning(bp
->name
);
1127 if (bp
->prec
&& prec
!= bp
->prec
)
1128 reprec_warning(bp
->name
);
1129 bp
->assoc
= (Assoc_t
) assoc
;
1139 value
= get_number();
1140 if (bp
->value
!= UNDEFINED
&& value
!= bp
->value
)
1141 revalued_warning(bp
->name
);
1151 * %expect requires special handling
1152 * as it really isn't part of the yacc
1153 * grammar only a flag for yacc proper.
1156 declare_expect(int assoc
)
1160 if (assoc
!= EXPECT
&& assoc
!= EXPECT_RR
)
1164 * Stay away from nextc - doesn't
1165 * detect EOL and will read to EOF.
1175 if (assoc
== EXPECT
)
1176 SRexpect
= get_number();
1178 RRexpect
= get_number();
1182 * Looking for number before EOL.
1183 * Spaces, tabs, and numbers are ok,
1184 * words, punc., etc. are syntax errors.
1186 else if (c
== '\n' || isalpha(c
) || !isspace(c
))
1188 syntax_error(lineno
, line
, cptr
);
1210 syntax_error(lineno
, line
, cptr
);
1216 if (isalpha(c
) || c
== '_' || c
== '.' || c
== '$')
1218 else if (c
== '\'' || c
== '"')
1223 if (bp
->tag
&& tag
!= bp
->tag
)
1224 retyped_warning(bp
->name
);
1238 if (!isalpha(c
) && c
!= '_' && c
!= '.' && c
!= '$')
1239 syntax_error(lineno
, line
, cptr
);
1241 if (bp
->class == TERM
)
1242 terminal_start(bp
->name
);
1243 if (goal
&& goal
!= bp
)
1244 restarted_warning();
1249 read_declarations(void)
1254 cache
= TMALLOC(char, cache_size
);
1263 syntax_error(lineno
, line
, cptr
);
1264 switch (k
= keyword())
1311 /* noop for bison compatibility. byacc is already designed to be posix
1312 * yacc compatible. */
1319 initialize_grammar(void)
1324 pitem
= TMALLOC(bucket
*, maxitems
);
1335 plhs
= TMALLOC(bucket
*, maxrules
);
1342 rprec
= TMALLOC(Value_t
, maxrules
);
1349 rassoc
= TMALLOC(Assoc_t
, maxrules
);
1361 pitem
= TREALLOC(bucket
*, pitem
, maxitems
);
1370 plhs
= TREALLOC(bucket
*, plhs
, maxrules
);
1373 rprec
= TREALLOC(Value_t
, rprec
, maxrules
);
1376 rassoc
= TREALLOC(Assoc_t
, rassoc
, maxrules
);
1381 advance_to_start(void)
1408 syntax_error(lineno
, line
, s_cptr
);
1413 if (!isalpha(c
) && c
!= '_' && c
!= '.' && c
!= '_')
1414 syntax_error(lineno
, line
, cptr
);
1418 if (bp
->class == TERM
)
1419 terminal_start(bp
->name
);
1428 syntax_error(lineno
, line
, cptr
);
1429 start_rule(bp
, s_lineno
);
1434 start_rule(bucket
*bp
, int s_lineno
)
1436 if (bp
->class == TERM
)
1437 terminal_lhs(s_lineno
);
1438 bp
->class = NONTERM
;
1439 if (nrules
>= maxrules
)
1442 rprec
[nrules
] = UNDEFINED
;
1443 rassoc
[nrules
] = TOKEN
;
1451 if (!last_was_action
&& plhs
[nrules
]->tag
)
1453 if (pitem
[nitems
- 1])
1455 for (i
= nitems
- 1; (i
> 0) && pitem
[i
]; --i
)
1457 if (pitem
[i
+ 1] == 0 || pitem
[i
+ 1]->tag
!= plhs
[nrules
]->tag
)
1458 default_action_warning();
1462 default_action_warning();
1466 last_was_action
= 0;
1467 if (nitems
>= maxitems
)
1475 insert_empty_rule(void)
1480 sprintf(cache
, "$$%d", ++gensym
);
1481 bp
= make_bucket(cache
);
1482 last_symbol
->next
= bp
;
1484 bp
->tag
= plhs
[nrules
]->tag
;
1485 bp
->class = NONTERM
;
1487 if ((nitems
+= 2) > maxitems
)
1489 bpp
= pitem
+ nitems
- 1;
1491 while ((bpp
[0] = bpp
[-1]) != 0)
1494 if (++nrules
>= maxrules
)
1496 plhs
[nrules
] = plhs
[nrules
- 1];
1497 plhs
[nrules
- 1] = bp
;
1498 rprec
[nrules
] = rprec
[nrules
- 1];
1499 rprec
[nrules
- 1] = 0;
1500 rassoc
[nrules
] = rassoc
[nrules
- 1];
1501 rassoc
[nrules
- 1] = TOKEN
;
1509 int s_lineno
= lineno
;
1512 if (c
== '\'' || c
== '"')
1521 start_rule(bp
, s_lineno
);
1526 if (last_was_action
)
1527 insert_empty_rule();
1528 last_was_action
= 0;
1530 if (++nitems
> maxitems
)
1532 pitem
[nitems
- 1] = bp
;
1536 after_blanks(char *s
)
1538 while (*s
!= '\0' && isspace(UCH(*s
)))
1551 FILE *f
= action_file
;
1552 int a_lineno
= lineno
;
1553 char *a_line
= dup_line();
1554 char *a_cptr
= a_line
+ (cptr
- line
);
1556 if (last_was_action
)
1557 insert_empty_rule();
1558 last_was_action
= 1;
1560 fprintf(f
, "case %d:\n", nrules
- 2);
1562 fprintf(f
, line_format
, lineno
, input_file_name
);
1566 /* avoid putting curly-braces in first column, to ease editing */
1567 if (*after_blanks(cptr
) == L_CURL
)
1570 cptr
= after_blanks(cptr
);
1574 for (i
= nitems
- 1; pitem
[i
]; --i
)
1584 int d_lineno
= lineno
;
1585 char *d_line
= dup_line();
1586 char *d_cptr
= d_line
+ (cptr
- line
);
1593 fprintf(f
, "yyval.%s", tag
);
1598 else if (isdigit(c
))
1602 dollar_warning(d_lineno
, i
);
1603 fprintf(f
, "yystack.l_mark[%d].%s", i
- n
, tag
);
1607 else if (c
== '-' && isdigit(UCH(cptr
[1])))
1610 i
= -get_number() - n
;
1611 fprintf(f
, "yystack.l_mark[%d].%s", i
, tag
);
1616 dollar_error(d_lineno
, d_line
, d_cptr
);
1618 else if (cptr
[1] == '$')
1622 tag
= plhs
[nrules
]->tag
;
1625 fprintf(f
, "yyval.%s", tag
);
1628 fprintf(f
, "yyval");
1632 else if (isdigit(UCH(cptr
[1])))
1638 if (i
<= 0 || i
> n
)
1640 tag
= pitem
[nitems
+ i
- n
- 1]->tag
;
1642 untyped_rhs(i
, pitem
[nitems
+ i
- n
- 1]->name
);
1643 fprintf(f
, "yystack.l_mark[%d].%s", i
- n
, tag
);
1648 dollar_warning(lineno
, i
);
1649 fprintf(f
, "yystack.l_mark[%d]", i
- n
);
1653 else if (cptr
[1] == '-')
1659 fprintf(f
, "yystack.l_mark[%d]", -i
- n
);
1663 if (isalpha(c
) || c
== '_' || c
== '$')
1670 while (isalnum(c
) || c
== '_' || c
== '$');
1682 unterminated_action(a_lineno
, a_line
, a_cptr
);
1687 fprintf(f
, "\nbreak;\n");
1698 fprintf(f
, "\nbreak;\n");
1705 int s_lineno
= lineno
;
1706 char *s_line
= dup_line();
1707 char *s_cptr
= s_line
+ (cptr
- line
- 1);
1720 unterminated_string(s_lineno
, s_line
, s_cptr
);
1729 unterminated_string(s_lineno
, s_line
, s_cptr
);
1740 while ((c
= *++cptr
) != '\n')
1742 if (c
== '*' && cptr
[1] == '/')
1752 int c_lineno
= lineno
;
1753 char *c_line
= dup_line();
1754 char *c_cptr
= c_line
+ (cptr
- line
- 1);
1762 if (c
== '*' && *cptr
== '/')
1773 unterminated_comment(c_lineno
, c_line
, c_cptr
);
1791 if (c
== '%' || c
== '\\')
1799 else if ((c
== 'p' || c
== 'P') &&
1800 ((c
= cptr
[2]) == 'r' || c
== 'R') &&
1801 ((c
= cptr
[3]) == 'e' || c
== 'E') &&
1802 ((c
= cptr
[4]) == 'c' || c
== 'C') &&
1803 ((c
= cptr
[5], !IS_IDENT(c
))))
1806 syntax_error(lineno
, line
, cptr
);
1809 if (isalpha(c
) || c
== '_' || c
== '.' || c
== '$')
1811 else if (c
== '\'' || c
== '"')
1815 syntax_error(lineno
, line
, cptr
);
1819 if (rprec
[nrules
] != UNDEFINED
&& bp
->prec
!= rprec
[nrules
])
1822 rprec
[nrules
] = bp
->prec
;
1823 rassoc
[nrules
] = bp
->assoc
;
1832 initialize_grammar();
1847 else if (c
== L_CURL
|| c
== '=')
1852 start_rule(plhs
[nrules
- 1], 0);
1861 syntax_error(lineno
, line
, cptr
);
1874 for (i
= 0; i
< ntags
; ++i
)
1876 assert(tag_table
[i
]);
1888 name_pool_size
= 13; /* 13 == sizeof("$end") + sizeof("$accept") */
1889 for (bp
= first_symbol
; bp
; bp
= bp
->next
)
1890 name_pool_size
+= strlen(bp
->name
) + 1;
1892 name_pool
= TMALLOC(char, name_pool_size
);
1893 NO_SPACE(name_pool
);
1895 strlcpy(name_pool
, "$accept", name_pool_size
);
1896 strlcpy(name_pool
+ 8, "$end", name_pool_size
- 8);
1898 for (bp
= first_symbol
; bp
; bp
= bp
->next
)
1902 while ((*t
++ = *s
++) != 0)
1914 if (goal
->class == UNKNOWN
)
1915 undefined_goal(goal
->name
);
1917 for (bp
= first_symbol
; bp
; bp
= bp
->next
)
1919 if (bp
->class == UNKNOWN
)
1921 undefined_symbol_warning(bp
->name
);
1928 protect_string(char *src
, char **des
)
1941 if ('\\' == *s
|| '"' == *s
)
1947 *des
= d
= TMALLOC(char, len
);
1953 if ('\\' == *s
|| '"' == *s
)
1970 for (bp
= first_symbol
; bp
; bp
= bp
->next
)
1973 if (bp
->class == TERM
)
1976 start_symbol
= (Value_t
) ntokens
;
1977 nvars
= nsyms
- ntokens
;
1979 symbol_name
= TMALLOC(char *, nsyms
);
1980 NO_SPACE(symbol_name
);
1982 symbol_value
= TMALLOC(Value_t
, nsyms
);
1983 NO_SPACE(symbol_value
);
1985 symbol_prec
= TMALLOC(short, nsyms
);
1986 NO_SPACE(symbol_prec
);
1988 symbol_assoc
= TMALLOC(char, nsyms
);
1989 NO_SPACE(symbol_assoc
);
1991 v
= TMALLOC(bucket
*, nsyms
);
1995 v
[start_symbol
] = 0;
1998 j
= (Value_t
) (start_symbol
+ 1);
1999 for (bp
= first_symbol
; bp
; bp
= bp
->next
)
2001 if (bp
->class == TERM
)
2006 assert(i
== ntokens
&& j
== nsyms
);
2008 for (i
= 1; i
< ntokens
; ++i
)
2011 goal
->index
= (Index_t
) (start_symbol
+ 1);
2012 k
= (Value_t
) (start_symbol
+ 2);
2022 for (i
= (Value_t
) (start_symbol
+ 1); i
< nsyms
; ++i
)
2032 for (i
= 1; i
< ntokens
; ++i
)
2037 for (j
= k
++; j
> 0 && symbol_value
[j
- 1] > n
; --j
)
2038 symbol_value
[j
] = symbol_value
[j
- 1];
2039 symbol_value
[j
] = n
;
2045 if (v
[1]->value
== UNDEFINED
)
2050 for (i
= 2; i
< ntokens
; ++i
)
2052 if (v
[i
]->value
== UNDEFINED
)
2054 while (j
< k
&& n
== symbol_value
[j
])
2056 while (++j
< k
&& n
== symbol_value
[j
])
2065 symbol_name
[0] = name_pool
+ 8;
2066 symbol_value
[0] = 0;
2068 symbol_assoc
[0] = TOKEN
;
2069 for (i
= 1; i
< ntokens
; ++i
)
2071 symbol_name
[i
] = v
[i
]->name
;
2072 symbol_value
[i
] = v
[i
]->value
;
2073 symbol_prec
[i
] = v
[i
]->prec
;
2074 symbol_assoc
[i
] = v
[i
]->assoc
;
2076 symbol_name
[start_symbol
] = name_pool
;
2077 symbol_value
[start_symbol
] = -1;
2078 symbol_prec
[start_symbol
] = 0;
2079 symbol_assoc
[start_symbol
] = TOKEN
;
2080 for (++i
; i
< nsyms
; ++i
)
2083 symbol_name
[k
] = v
[i
]->name
;
2084 symbol_value
[k
] = v
[i
]->value
;
2085 symbol_prec
[k
] = v
[i
]->prec
;
2086 symbol_assoc
[k
] = v
[i
]->assoc
;
2091 symbol_pname
= TMALLOC(char *, nsyms
);
2092 NO_SPACE(symbol_pname
);
2094 for (i
= 0; i
< nsyms
; ++i
)
2095 protect_string(symbol_name
[i
], &(symbol_pname
[i
]));
2109 ritem
= TMALLOC(Value_t
, nitems
);
2112 rlhs
= TMALLOC(Value_t
, nrules
);
2115 rrhs
= TMALLOC(Value_t
, nrules
+ 1);
2118 rprec
= TREALLOC(Value_t
, rprec
, nrules
);
2121 rassoc
= TREALLOC(Assoc_t
, rassoc
, nrules
);
2125 ritem
[1] = goal
->index
;
2130 rlhs
[2] = start_symbol
;
2136 for (i
= 3; i
< nrules
; ++i
)
2138 rlhs
[i
] = plhs
[i
]->index
;
2144 ritem
[j
] = pitem
[j
]->index
;
2145 if (pitem
[j
]->class == TERM
)
2147 prec2
= pitem
[j
]->prec
;
2148 assoc
= pitem
[j
]->assoc
;
2152 ritem
[j
] = (Value_t
) - i
;
2154 if (rprec
[i
] == UNDEFINED
)
2170 size_t j
, spacing
= 0;
2171 FILE *f
= verbose_file
;
2177 for (i
= 2; i
< nrules
; ++i
)
2179 if (rlhs
[i
] != rlhs
[i
- 1])
2183 fprintf(f
, "%4d %s :", i
- 2, symbol_name
[rlhs
[i
]]);
2184 spacing
= strlen(symbol_name
[rlhs
[i
]]) + 1;
2188 fprintf(f
, "%4d ", i
- 2);
2195 while (ritem
[k
] >= 0)
2197 fprintf(f
, " %s", symbol_name
[ritem
[k
]]);
2208 write_section(code_file
, banner
);
2209 create_symbol_table();
2210 read_declarations();
2212 free_symbol_table();
2224 free_declarations(param
* list
)
2228 param
*next
= list
->next
;
2241 lex_param
= free_declarations(lex_param
);
2242 parse_param
= free_declarations(parse_param
);
2252 DO_FREE(symbol_name
);
2253 DO_FREE(symbol_prec
);
2254 DO_FREE(symbol_assoc
);
2255 DO_FREE(symbol_value
);