Change to ANSI-C function definitions.

This commit is contained in:
David E. O'Brien 2010-11-07 22:51:54 +00:00
parent bb595df94d
commit f5015507b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214959
13 changed files with 182 additions and 282 deletions

View File

@ -9,6 +9,6 @@ MAN= yacc.1 yyfix.1
LINKS= ${BINDIR}/yacc ${BINDIR}/byacc LINKS= ${BINDIR}/yacc ${BINDIR}/byacc
MLINKS= yacc.1 byacc.1 MLINKS= yacc.1 byacc.1
WARNS?= 2 WARNS?= 6
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -62,7 +62,7 @@ static unsigned *EFF;
static void static void
set_EFF() set_EFF(void)
{ {
unsigned *row; unsigned *row;
int symbol; int symbol;
@ -99,7 +99,7 @@ set_EFF()
void void
set_first_derives() set_first_derives(void)
{ {
unsigned *rrow; unsigned *rrow;
unsigned *vrow; unsigned *vrow;
@ -154,9 +154,7 @@ set_first_derives()
void void
closure(nucleus, n) closure(short *nucleus, int n)
short *nucleus;
int n;
{ {
int ruleno; int ruleno;
unsigned word; unsigned word;
@ -224,7 +222,7 @@ int n;
void void
finalize_closure() finalize_closure(void)
{ {
FREE(itemset); FREE(itemset);
FREE(ruleset); FREE(ruleset);
@ -235,8 +233,7 @@ finalize_closure()
#ifdef DEBUG #ifdef DEBUG
static void static void
print_closure(n) print_closure(int n)
int n;
{ {
short *isp; short *isp;
@ -247,7 +244,7 @@ int n;
static void static void
print_EFF() print_EFF(void)
{ {
int i, j; int i, j;
unsigned *rowp; unsigned *rowp;
@ -279,7 +276,7 @@ print_EFF()
static void static void
print_first_derives() print_first_derives(void)
{ {
int i; int i;
int j; int j;

View File

@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$");
static void print_pos(char *, char *); static void print_pos(char *, char *);
void void
fatal(msg) fatal(const char *msg)
const char *msg;
{ {
warnx("f - %s", msg); warnx("f - %s", msg);
done(2); done(2);
@ -58,7 +57,7 @@ const char *msg;
void void
no_space() no_space(void)
{ {
warnx("f - out of space"); warnx("f - out of space");
done(2); done(2);
@ -66,8 +65,7 @@ no_space()
void void
open_error(filename) open_error(const char *filename)
const char *filename;
{ {
warnx("f - cannot open \"%s\"", filename); warnx("f - cannot open \"%s\"", filename);
done(2); done(2);
@ -75,7 +73,7 @@ const char *filename;
void void
unexpected_EOF() unexpected_EOF(void)
{ {
warnx("e - line %d of \"%s\", unexpected end-of-file", warnx("e - line %d of \"%s\", unexpected end-of-file",
lineno, input_file_name); lineno, input_file_name);
@ -84,9 +82,7 @@ unexpected_EOF()
static void static void
print_pos(st_line, st_cptr) print_pos(char *st_line, char *st_cptr)
char *st_line;
char *st_cptr;
{ {
char *s; char *s;
@ -112,10 +108,7 @@ char *st_cptr;
void void
syntax_error(st_lineno, st_line, st_cptr) syntax_error(int st_lineno, char *st_line, char *st_cptr)
int st_lineno;
char *st_line;
char *st_cptr;
{ {
warnx("e - line %d of \"%s\", syntax error", warnx("e - line %d of \"%s\", syntax error",
st_lineno, input_file_name); st_lineno, input_file_name);
@ -125,10 +118,7 @@ char *st_cptr;
void void
unterminated_comment(c_lineno, c_line, c_cptr) unterminated_comment(int c_lineno, char *c_line, char *c_cptr)
int c_lineno;
char *c_line;
char *c_cptr;
{ {
warnx("e - line %d of \"%s\", unmatched /*", warnx("e - line %d of \"%s\", unmatched /*",
c_lineno, input_file_name); c_lineno, input_file_name);
@ -138,10 +128,7 @@ char *c_cptr;
void void
unterminated_string(s_lineno, s_line, s_cptr) unterminated_string(int s_lineno, char *s_line, char *s_cptr)
int s_lineno;
char *s_line;
char *s_cptr;
{ {
warnx("e - line %d of \"%s\", unterminated string", warnx("e - line %d of \"%s\", unterminated string",
s_lineno, input_file_name); s_lineno, input_file_name);
@ -151,10 +138,7 @@ char *s_cptr;
void void
unterminated_text(t_lineno, t_line, t_cptr) unterminated_text(int t_lineno, char *t_line, char *t_cptr)
int t_lineno;
char *t_line;
char *t_cptr;
{ {
warnx("e - line %d of \"%s\", unmatched %%{", warnx("e - line %d of \"%s\", unmatched %%{",
t_lineno, input_file_name); t_lineno, input_file_name);
@ -164,10 +148,7 @@ char *t_cptr;
void void
unterminated_union(u_lineno, u_line, u_cptr) unterminated_union(int u_lineno, char *u_line, char *u_cptr)
int u_lineno;
char *u_line;
char *u_cptr;
{ {
warnx("e - line %d of \"%s\", unterminated %%union declaration", warnx("e - line %d of \"%s\", unterminated %%union declaration",
u_lineno, input_file_name); u_lineno, input_file_name);
@ -177,8 +158,7 @@ char *u_cptr;
void void
over_unionized(u_cptr) over_unionized(char *u_cptr)
char *u_cptr;
{ {
warnx("e - line %d of \"%s\", too many %%union declarations", warnx("e - line %d of \"%s\", too many %%union declarations",
lineno, input_file_name); lineno, input_file_name);
@ -188,10 +168,7 @@ char *u_cptr;
void void
illegal_tag(t_lineno, t_line, t_cptr) illegal_tag(int t_lineno, char *t_line, char *t_cptr)
int t_lineno;
char *t_line;
char *t_cptr;
{ {
warnx("e - line %d of \"%s\", illegal tag", t_lineno, input_file_name); warnx("e - line %d of \"%s\", illegal tag", t_lineno, input_file_name);
print_pos(t_line, t_cptr); print_pos(t_line, t_cptr);
@ -200,8 +177,7 @@ char *t_cptr;
void void
illegal_character(c_cptr) illegal_character(char *c_cptr)
char *c_cptr;
{ {
warnx("e - line %d of \"%s\", illegal character", lineno, input_file_name); warnx("e - line %d of \"%s\", illegal character", lineno, input_file_name);
print_pos(line, c_cptr); print_pos(line, c_cptr);
@ -210,8 +186,7 @@ char *c_cptr;
void void
used_reserved(s) used_reserved(char *s)
char *s;
{ {
warnx("e - line %d of \"%s\", illegal use of reserved symbol %s", warnx("e - line %d of \"%s\", illegal use of reserved symbol %s",
lineno, input_file_name, s); lineno, input_file_name, s);
@ -220,8 +195,7 @@ char *s;
void void
tokenized_start(s) tokenized_start(char *s)
char *s;
{ {
warnx("e - line %d of \"%s\", the start symbol %s cannot be \ warnx("e - line %d of \"%s\", the start symbol %s cannot be \
declared to be a token", lineno, input_file_name, s); declared to be a token", lineno, input_file_name, s);
@ -230,8 +204,7 @@ declared to be a token", lineno, input_file_name, s);
void void
retyped_warning(s) retyped_warning(char *s)
char *s;
{ {
warnx("w - line %d of \"%s\", the type of %s has been redeclared", warnx("w - line %d of \"%s\", the type of %s has been redeclared",
lineno, input_file_name, s); lineno, input_file_name, s);
@ -239,8 +212,7 @@ char *s;
void void
reprec_warning(s) reprec_warning(char *s)
char *s;
{ {
warnx("w - line %d of \"%s\", the precedence of %s has been redeclared", warnx("w - line %d of \"%s\", the precedence of %s has been redeclared",
lineno, input_file_name, s); lineno, input_file_name, s);
@ -248,8 +220,7 @@ char *s;
void void
revalued_warning(s) revalued_warning(char *s)
char *s;
{ {
warnx("w - line %d of \"%s\", the value of %s has been redeclared", warnx("w - line %d of \"%s\", the value of %s has been redeclared",
lineno, input_file_name, s); lineno, input_file_name, s);
@ -257,8 +228,7 @@ char *s;
void void
terminal_start(s) terminal_start(char *s)
char *s;
{ {
warnx("e - line %d of \"%s\", the start symbol %s is a token", warnx("e - line %d of \"%s\", the start symbol %s is a token",
lineno, input_file_name, s); lineno, input_file_name, s);
@ -267,7 +237,7 @@ char *s;
void void
restarted_warning() restarted_warning(void)
{ {
warnx("w - line %d of \"%s\", the start symbol has been redeclared", warnx("w - line %d of \"%s\", the start symbol has been redeclared",
lineno, input_file_name); lineno, input_file_name);
@ -275,7 +245,7 @@ restarted_warning()
void void
no_grammar() no_grammar(void)
{ {
warnx("e - line %d of \"%s\", no grammar has been specified", warnx("e - line %d of \"%s\", no grammar has been specified",
lineno, input_file_name); lineno, input_file_name);
@ -284,8 +254,7 @@ no_grammar()
void void
terminal_lhs(s_lineno) terminal_lhs(int s_lineno)
int s_lineno;
{ {
warnx("e - line %d of \"%s\", a token appears on the lhs of a production", warnx("e - line %d of \"%s\", a token appears on the lhs of a production",
s_lineno, input_file_name); s_lineno, input_file_name);
@ -294,7 +263,7 @@ int s_lineno;
void void
prec_redeclared() prec_redeclared(void)
{ {
warnx("w - line %d of \"%s\", conflicting %%prec specifiers", warnx("w - line %d of \"%s\", conflicting %%prec specifiers",
lineno, input_file_name); lineno, input_file_name);
@ -302,10 +271,7 @@ prec_redeclared()
void void
unterminated_action(a_lineno, a_line, a_cptr) unterminated_action(int a_lineno, char *a_line, char *a_cptr)
int a_lineno;
char *a_line;
char *a_cptr;
{ {
warnx("e - line %d of \"%s\", unterminated action", warnx("e - line %d of \"%s\", unterminated action",
a_lineno, input_file_name); a_lineno, input_file_name);
@ -315,9 +281,7 @@ char *a_cptr;
void void
dollar_warning(a_lineno, i) dollar_warning(int a_lineno, int i)
int a_lineno;
int i;
{ {
warnx("w - line %d of \"%s\", $%d references beyond the \ warnx("w - line %d of \"%s\", $%d references beyond the \
end of the current rule", a_lineno, input_file_name, i); end of the current rule", a_lineno, input_file_name, i);
@ -325,10 +289,7 @@ end of the current rule", a_lineno, input_file_name, i);
void void
dollar_error(a_lineno, a_line, a_cptr) dollar_error(int a_lineno, char *a_line, char *a_cptr)
int a_lineno;
char *a_line;
char *a_cptr;
{ {
warnx("e - line %d of \"%s\", illegal $-name", a_lineno, input_file_name); warnx("e - line %d of \"%s\", illegal $-name", a_lineno, input_file_name);
print_pos(a_line, a_cptr); print_pos(a_line, a_cptr);
@ -337,7 +298,7 @@ char *a_cptr;
void void
untyped_lhs() untyped_lhs(void)
{ {
warnx("e - line %d of \"%s\", $$ is untyped", lineno, input_file_name); warnx("e - line %d of \"%s\", $$ is untyped", lineno, input_file_name);
done(1); done(1);
@ -345,9 +306,7 @@ untyped_lhs()
void void
untyped_rhs(i, s) untyped_rhs(int i, char *s)
int i;
char *s;
{ {
warnx("e - line %d of \"%s\", $%d (%s) is untyped", warnx("e - line %d of \"%s\", $%d (%s) is untyped",
lineno, input_file_name, i, s); lineno, input_file_name, i, s);
@ -356,8 +315,7 @@ char *s;
void void
unknown_rhs(i) unknown_rhs(int i)
int i;
{ {
warnx("e - line %d of \"%s\", $%d is untyped", lineno, input_file_name, i); warnx("e - line %d of \"%s\", $%d is untyped", lineno, input_file_name, i);
done(1); done(1);
@ -365,7 +323,7 @@ int i;
void void
default_action_warning() default_action_warning(void)
{ {
warnx("w - line %d of \"%s\", the default action assigns an \ warnx("w - line %d of \"%s\", the default action assigns an \
undefined value to $$", lineno, input_file_name); undefined value to $$", lineno, input_file_name);
@ -373,8 +331,7 @@ undefined value to $$", lineno, input_file_name);
void void
undefined_goal(s) undefined_goal(char *s)
char *s;
{ {
warnx("e - the start symbol %s is undefined", s); warnx("e - the start symbol %s is undefined", s);
done(1); done(1);
@ -382,8 +339,7 @@ char *s;
void void
undefined_symbol_warning(s) undefined_symbol_warning(char *s)
char *s;
{ {
warnx("w - the symbol %s is undefined", s); warnx("w - the symbol %s is undefined", s);
} }

View File

@ -96,7 +96,7 @@ static int top;
void void
lalr() lalr(void)
{ {
tokensetsize = WORDSIZE(ntokens); tokensetsize = WORDSIZE(ntokens);
@ -116,7 +116,7 @@ lalr()
static void static void
set_state_table() set_state_table(void)
{ {
core *sp; core *sp;
@ -128,7 +128,7 @@ set_state_table()
static void static void
set_accessing_symbol() set_accessing_symbol(void)
{ {
core *sp; core *sp;
@ -140,7 +140,7 @@ set_accessing_symbol()
static void static void
set_shift_table() set_shift_table(void)
{ {
shifts *sp; shifts *sp;
@ -152,7 +152,7 @@ set_shift_table()
static void static void
set_reduction_table() set_reduction_table(void)
{ {
reductions *rp; reductions *rp;
@ -164,7 +164,7 @@ set_reduction_table()
static void static void
set_maxrhs() set_maxrhs(void)
{ {
short *itemp; short *itemp;
short *item_end; short *item_end;
@ -193,7 +193,7 @@ set_maxrhs()
static void static void
initialize_LA() initialize_LA(void)
{ {
int i, j, k; int i, j, k;
reductions *rp; reductions *rp;
@ -231,7 +231,7 @@ initialize_LA()
static void static void
set_goto_map() set_goto_map(void)
{ {
shifts *sp; shifts *sp;
int i; int i;
@ -301,9 +301,7 @@ set_goto_map()
/* Map_goto maps a state/symbol pair into its numeric representation. */ /* Map_goto maps a state/symbol pair into its numeric representation. */
static int static int
map_goto(state, symbol) map_goto(int state, int symbol)
int state;
int symbol;
{ {
int high; int high;
int low; int low;
@ -330,7 +328,7 @@ int symbol;
static void static void
initialize_F() initialize_F(void)
{ {
int i; int i;
int j; int j;
@ -408,7 +406,7 @@ initialize_F()
static void static void
build_relations() build_relations(void)
{ {
int i; int i;
int j; int j;
@ -501,8 +499,7 @@ build_relations()
static void static void
add_lookback_edge(stateno, ruleno, gotono) add_lookback_edge(int stateno, int ruleno, int gotono)
int stateno, ruleno, gotono;
{ {
int i, k; int i, k;
int found; int found;
@ -529,9 +526,7 @@ int stateno, ruleno, gotono;
static short ** static short **
transpose(R, n) transpose(short **R, int n)
short **R;
int n;
{ {
short **new_R; short **new_R;
short **temp_R; short **temp_R;
@ -587,14 +582,14 @@ int n;
static void static void
compute_FOLLOWS() compute_FOLLOWS(void)
{ {
digraph(includes); digraph(includes);
} }
static void static void
compute_lookaheads() compute_lookaheads(void)
{ {
int i, n; int i, n;
unsigned *fp1, *fp2, *fp3; unsigned *fp1, *fp2, *fp3;
@ -629,8 +624,7 @@ compute_lookaheads()
static void static void
digraph(relation) digraph(short **relation)
short **relation;
{ {
int i; int i;
@ -655,9 +649,7 @@ short **relation;
static void static void
traverse(i, R) traverse(int i, short **R)
int i;
short **R;
{ {
unsigned *fp1; unsigned *fp1;
unsigned *fp2; unsigned *fp2;

View File

@ -91,7 +91,7 @@ static short *kernel_items;
static void static void
allocate_itemsets() allocate_itemsets(void)
{ {
short *itemp; short *itemp;
short *item_end; short *item_end;
@ -134,7 +134,7 @@ allocate_itemsets()
static void static void
allocate_storage() allocate_storage(void)
{ {
allocate_itemsets(); allocate_itemsets();
shiftset = NEW2(nsyms, short); shiftset = NEW2(nsyms, short);
@ -144,7 +144,7 @@ allocate_storage()
static void static void
append_states() append_states(void)
{ {
int i; int i;
int j; int j;
@ -174,7 +174,7 @@ append_states()
static void static void
free_storage() free_storage(void)
{ {
FREE(shift_symbol); FREE(shift_symbol);
FREE(redset); FREE(redset);
@ -188,7 +188,7 @@ free_storage()
static void static void
generate_states() generate_states(void)
{ {
allocate_storage(); allocate_storage();
itemset = NEW2(nitems, short); itemset = NEW2(nitems, short);
@ -216,8 +216,7 @@ generate_states()
static int static int
get_state(symbol) get_state(int symbol)
int symbol;
{ {
int key; int key;
short *isp1; short *isp1;
@ -281,7 +280,7 @@ int symbol;
static void static void
initialize_states() initialize_states(void)
{ {
int i; int i;
short *start_derives; short *start_derives;
@ -309,7 +308,7 @@ initialize_states()
static void static void
new_itemsets() new_itemsets(void)
{ {
int i; int i;
int shiftcount; int shiftcount;
@ -346,8 +345,7 @@ new_itemsets()
static core * static core *
new_state(symbol) new_state(int symbol)
int symbol;
{ {
int n; int n;
core *p; core *p;
@ -387,7 +385,7 @@ int symbol;
#if 0 #if 0
/* show_cores is used for debugging */ /* show_cores is used for debugging */
show_cores() show_cores(void)
{ {
core *p; core *p;
int i, j, k, n; int i, j, k, n;
@ -422,7 +420,7 @@ show_cores()
/* show_ritems is used for debugging */ /* show_ritems is used for debugging */
show_ritems() show_ritems(void)
{ {
int i; int i;
@ -432,7 +430,7 @@ show_ritems()
/* show_rrhs is used for debugging */ /* show_rrhs is used for debugging */
show_rrhs() show_rrhs(void)
{ {
int i; int i;
@ -443,7 +441,7 @@ show_rrhs()
/* show_shifts is used for debugging */ /* show_shifts is used for debugging */
show_shifts() show_shifts(void)
{ {
shifts *p; shifts *p;
int i, j, k; int i, j, k;
@ -463,7 +461,7 @@ show_shifts()
static void static void
save_shifts() save_shifts(void)
{ {
shifts *p; shifts *p;
short *sp1; short *sp1;
@ -498,7 +496,7 @@ save_shifts()
static void static void
save_reductions() save_reductions(void)
{ {
short *isp; short *isp;
short *rp1; short *rp1;
@ -548,7 +546,7 @@ save_reductions()
static void static void
set_derives() set_derives(void)
{ {
int i, k; int i, k;
int lhs; int lhs;
@ -588,7 +586,7 @@ free_derives()
#ifdef DEBUG #ifdef DEBUG
static void static void
print_derives() print_derives(void)
{ {
int i; int i;
short *sp; short *sp;
@ -611,7 +609,7 @@ print_derives()
static void static void
set_nullable() set_nullable(void)
{ {
int i, j; int i, j;
int empty; int empty;
@ -661,7 +659,7 @@ set_nullable()
#if 0 #if 0
free_nullable() free_nullable(void)
{ {
FREE(nullable); FREE(nullable);
} }
@ -669,7 +667,7 @@ free_nullable()
void void
lr0() lr0(void)
{ {
set_derives(); set_derives();
set_nullable(); set_nullable();

View File

@ -115,8 +115,7 @@ static void usage(void);
volatile sig_atomic_t sigdie; volatile sig_atomic_t sigdie;
__dead2 void __dead2 void
done(k) done(int k)
int k;
{ {
if (action_file) { fclose(action_file); unlink(action_file_name); } if (action_file) { fclose(action_file); unlink(action_file_name); }
if (text_file) { fclose(text_file); unlink(text_file_name); } if (text_file) { fclose(text_file); unlink(text_file_name); }
@ -127,8 +126,7 @@ int k;
static void static void
onintr(signo) onintr(int signo __unused)
int signo __unused;
{ {
sigdie = 1; sigdie = 1;
done(1); done(1);
@ -136,7 +134,7 @@ onintr(signo)
static void static void
set_signals() set_signals(void)
{ {
#ifdef SIGINT #ifdef SIGINT
if (signal(SIGINT, SIG_IGN) != SIG_IGN) if (signal(SIGINT, SIG_IGN) != SIG_IGN)
@ -154,7 +152,7 @@ set_signals()
static void static void
usage() usage(void)
{ {
fprintf(stderr, "%s\n%s\n", fprintf(stderr, "%s\n%s\n",
"usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename]", "usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename]",
@ -164,9 +162,7 @@ usage()
static void static void
getargs(argc, argv) getargs(int argc, char *argv[])
int argc;
char *argv[];
{ {
int ch; int ch;
@ -221,8 +217,7 @@ char *argv[];
char * char *
allocate(n) allocate(unsigned n)
unsigned n;
{ {
char *p; char *p;
@ -237,7 +232,7 @@ unsigned n;
static void static void
create_file_names() create_file_names(void)
{ {
int i, len; int i, len;
const char *tmpdir; const char *tmpdir;
@ -357,7 +352,7 @@ create_file_names()
static void static void
open_files() open_files(void)
{ {
int fd; int fd;

View File

@ -73,7 +73,7 @@ static void unused_rules(void);
void void
make_parser() make_parser(void)
{ {
int i; int i;
@ -90,8 +90,7 @@ make_parser()
static action * static action *
parse_actions(stateno) parse_actions(int stateno)
int stateno;
{ {
action *actions; action *actions;
@ -102,8 +101,7 @@ int stateno;
static action * static action *
get_shifts(stateno) get_shifts(int stateno)
int stateno;
{ {
action *actions, *temp; action *actions, *temp;
shifts *sp; shifts *sp;
@ -137,9 +135,7 @@ int stateno;
} }
static action * static action *
add_reductions(stateno, actions) add_reductions(int stateno, action *actions)
int stateno;
action *actions;
{ {
int i, j, m, n; int i, j, m, n;
int ruleno, tokensetsize; int ruleno, tokensetsize;
@ -163,9 +159,7 @@ action *actions;
static action * static action *
add_reduce(actions, ruleno, symbol) add_reduce(action *actions, int ruleno, int symbol)
action *actions;
int ruleno, symbol;
{ {
action *temp, *prev, *next; action *temp, *prev, *next;
@ -204,7 +198,7 @@ int ruleno, symbol;
static void static void
find_final_state() find_final_state(void)
{ {
int goal, i; int goal, i;
short *tostate; short *tostate;
@ -222,7 +216,7 @@ find_final_state()
static void static void
unused_rules() unused_rules(void)
{ {
int i; int i;
action *p; action *p;
@ -256,7 +250,7 @@ unused_rules()
static void static void
remove_conflicts() remove_conflicts(void)
{ {
int i; int i;
int symbol; int symbol;
@ -333,7 +327,7 @@ remove_conflicts()
static void static void
total_conflicts() total_conflicts(void)
{ {
/* Warn if s/r != expect or if any r/r */ /* Warn if s/r != expect or if any r/r */
if ((SRtotal != SRexpect) || RRtotal) if ((SRtotal != SRexpect) || RRtotal)
@ -352,8 +346,7 @@ total_conflicts()
static int static int
sole_reduction(stateno) sole_reduction(int stateno)
int stateno;
{ {
int count, ruleno; int count, ruleno;
action *p; action *p;
@ -381,7 +374,7 @@ int stateno;
static void static void
defreds() defreds(void)
{ {
int i; int i;
@ -391,8 +384,7 @@ defreds()
} }
static void static void
free_action_row(p) free_action_row(action *p)
action *p;
{ {
action *q; action *q;
@ -405,7 +397,7 @@ action *p;
} }
void void
free_parser() free_parser(void)
{ {
int i; int i;

View File

@ -95,7 +95,7 @@ static const char line_format[] = "#line %d \"%s\"\n";
void void
output() output(void)
{ {
free_itemsets(); free_itemsets();
free_shifts(); free_shifts();
@ -119,7 +119,7 @@ output()
static void static void
output_prefix() output_prefix(void)
{ {
if (symbol_prefix == NULL) if (symbol_prefix == NULL)
symbol_prefix = "yy"; symbol_prefix = "yy";
@ -184,7 +184,7 @@ output_prefix()
static void static void
output_rule_data() output_rule_data(void)
{ {
int i; int i;
int j; int j;
@ -232,7 +232,7 @@ output_rule_data()
static void static void
output_yydefred() output_yydefred(void)
{ {
int i, j; int i, j;
@ -260,7 +260,7 @@ output_yydefred()
static void static void
output_actions() output_actions(void)
{ {
nvectors = 2*nstates + nvars; nvectors = 2*nstates + nvars;
@ -289,7 +289,7 @@ output_actions()
static void static void
token_actions() token_actions(void)
{ {
int i, j; int i, j;
int shiftcount, reducecount; int shiftcount, reducecount;
@ -374,7 +374,7 @@ token_actions()
} }
static void static void
goto_actions() goto_actions(void)
{ {
int i, j, k; int i, j, k;
@ -407,8 +407,7 @@ goto_actions()
} }
static int static int
default_goto(symbol) default_goto(int symbol)
int symbol;
{ {
int i; int i;
int m; int m;
@ -444,9 +443,7 @@ int symbol;
static void static void
save_column(symbol, default_state) save_column(int symbol, int default_state)
int symbol;
int default_state;
{ {
int i; int i;
int m; int m;
@ -487,7 +484,7 @@ int default_state;
} }
static void static void
sort_actions() sort_actions(void)
{ {
int i; int i;
int j; int j;
@ -523,7 +520,7 @@ sort_actions()
static void static void
pack_table() pack_table(void)
{ {
int i; int i;
int place; int place;
@ -586,8 +583,7 @@ pack_table()
/* order. */ /* order. */
static int static int
matching_vector(vector) matching_vector(int vector)
int vector;
{ {
int i; int i;
int j; int j;
@ -627,8 +623,7 @@ int vector;
static int static int
pack_vector(vector) pack_vector(int vector)
int vector;
{ {
int i, j, k; int i, j, k;
int t; int t;
@ -705,7 +700,7 @@ int vector;
static void static void
output_base() output_base(void)
{ {
int i, j; int i, j;
@ -773,7 +768,7 @@ output_base()
static void static void
output_table() output_table(void)
{ {
int i; int i;
int j; int j;
@ -806,7 +801,7 @@ output_table()
static void static void
output_check() output_check(void)
{ {
int i; int i;
int j; int j;
@ -836,8 +831,7 @@ output_check()
static int static int
is_C_identifier(name) is_C_identifier(char *name)
char *name;
{ {
char *s; char *s;
int c; int c;
@ -869,7 +863,7 @@ char *name;
static void static void
output_defines() output_defines(void)
{ {
int c, i; int c, i;
char *s; char *s;
@ -928,7 +922,7 @@ output_defines()
static void static void
output_stored_text() output_stored_text(void)
{ {
int c; int c;
FILE *in, *out; FILE *in, *out;
@ -956,7 +950,7 @@ output_stored_text()
static void static void
output_debug() output_debug(void)
{ {
int i, j, k, max; int i, j, k, max;
char **symnam, *s; char **symnam, *s;
@ -1173,7 +1167,7 @@ output_debug()
static void static void
output_stype() output_stype(void)
{ {
if (!unionized && ntags == 0) if (!unionized && ntags == 0)
{ {
@ -1184,7 +1178,7 @@ output_stype()
static void static void
output_trailing_text() output_trailing_text(void)
{ {
int c, last; int c, last;
FILE *in, *out; FILE *in, *out;
@ -1242,7 +1236,7 @@ output_trailing_text()
static void static void
output_semantic_actions() output_semantic_actions(void)
{ {
int c, last; int c, last;
FILE *out; FILE *out;
@ -1280,7 +1274,7 @@ output_semantic_actions()
static void static void
free_itemsets() free_itemsets(void)
{ {
core *cp, *next; core *cp, *next;
@ -1294,7 +1288,7 @@ free_itemsets()
static void static void
free_shifts() free_shifts(void)
{ {
shifts *sp, *next; shifts *sp, *next;
@ -1309,7 +1303,7 @@ free_shifts()
static void static void
free_reductions() free_reductions(void)
{ {
reductions *rp, *next; reductions *rp, *next;

View File

@ -120,8 +120,7 @@ static void skip_comment(void);
static void start_rule(bucket *, int); static void start_rule(bucket *, int);
static void static void
cachec(c) cachec(int c)
int c;
{ {
assert(cinc >= 0); assert(cinc >= 0);
if (cinc >= cache_size) if (cinc >= cache_size)
@ -136,7 +135,7 @@ int c;
static void static void
get_line() get_line(void)
{ {
FILE *f = input_file; FILE *f = input_file;
int c; int c;
@ -183,7 +182,7 @@ get_line()
static char * static char *
dup_line() dup_line(void)
{ {
char *p, *s, *t; char *p, *s, *t;
@ -201,7 +200,7 @@ dup_line()
static void static void
skip_comment() skip_comment(void)
{ {
char *s; char *s;
@ -232,7 +231,7 @@ skip_comment()
static int static int
nextc() nextc(void)
{ {
char *s; char *s;
@ -294,7 +293,7 @@ nextc()
static int static int
keyword() keyword(void)
{ {
int c; int c;
char *t_cptr = cptr; char *t_cptr = cptr;
@ -360,7 +359,7 @@ keyword()
static void static void
copy_ident() copy_ident(void)
{ {
int c; int c;
FILE *f = output_file; FILE *f = output_file;
@ -390,7 +389,7 @@ copy_ident()
static void static void
copy_text() copy_text(void)
{ {
int c; int c;
int quote; int quote;
@ -522,7 +521,7 @@ copy_text()
static void static void
copy_union() copy_union(void)
{ {
int c; int c;
int quote; int quote;
@ -663,8 +662,7 @@ copy_union()
static int static int
hexval(c) hexval(int c)
int c;
{ {
if (c >= '0' && c <= '9') if (c >= '0' && c <= '9')
return (c - '0'); return (c - '0');
@ -677,7 +675,7 @@ int c;
static bucket * static bucket *
get_literal() get_literal(void)
{ {
int c, quote; int c, quote;
int i; int i;
@ -816,8 +814,7 @@ get_literal()
static int static int
is_reserved(name) is_reserved(char *name)
char *name;
{ {
char *s; char *s;
@ -838,7 +835,7 @@ char *name;
static bucket * static bucket *
get_name() get_name(void)
{ {
int c; int c;
@ -854,7 +851,7 @@ get_name()
static int static int
get_number() get_number(void)
{ {
int c; int c;
int n; int n;
@ -868,7 +865,7 @@ get_number()
static char * static char *
get_tag() get_tag(void)
{ {
int c; int c;
int i; int i;
@ -919,8 +916,7 @@ get_tag()
static void static void
declare_tokens(assoc) declare_tokens(int assoc)
int assoc;
{ {
int c; int c;
bucket *bp; bucket *bp;
@ -987,8 +983,7 @@ int assoc;
* grammar only a flag for yacc proper. * grammar only a flag for yacc proper.
*/ */
static void static void
declare_expect(assoc) declare_expect(int assoc)
int assoc;
{ {
int c; int c;
@ -1027,7 +1022,7 @@ int assoc;
static void static void
declare_types() declare_types(void)
{ {
int c; int c;
bucket *bp; bucket *bp;
@ -1056,7 +1051,7 @@ declare_types()
static void static void
declare_start() declare_start(void)
{ {
int c; int c;
bucket *bp; bucket *bp;
@ -1075,7 +1070,7 @@ declare_start()
static void static void
read_declarations() read_declarations(void)
{ {
int c, k; int c, k;
@ -1129,7 +1124,7 @@ read_declarations()
static void static void
initialize_grammar() initialize_grammar(void)
{ {
nitems = 4; nitems = 4;
maxitems = 300; maxitems = 300;
@ -1161,7 +1156,7 @@ initialize_grammar()
static void static void
expand_items() expand_items(void)
{ {
maxitems += 300; maxitems += 300;
pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *)); pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
@ -1170,7 +1165,7 @@ expand_items()
static void static void
expand_rules() expand_rules(void)
{ {
maxrules += 100; maxrules += 100;
plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *)); plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
@ -1183,7 +1178,7 @@ expand_rules()
static void static void
advance_to_start() advance_to_start(void)
{ {
int c; int c;
bucket *bp; bucket *bp;
@ -1234,9 +1229,7 @@ advance_to_start()
static void static void
start_rule(bp, s_lineno) start_rule(bucket *bp, int s_lineno)
bucket *bp;
int s_lineno;
{ {
if (bp->class == TERM) if (bp->class == TERM)
terminal_lhs(s_lineno); terminal_lhs(s_lineno);
@ -1250,7 +1243,7 @@ int s_lineno;
static void static void
end_rule() end_rule(void)
{ {
int i; int i;
@ -1270,7 +1263,7 @@ end_rule()
static void static void
insert_empty_rule() insert_empty_rule(void)
{ {
bucket *bp, **bpp; bucket *bp, **bpp;
@ -1300,7 +1293,7 @@ insert_empty_rule()
static void static void
add_symbol() add_symbol(void)
{ {
int c; int c;
bucket *bp; bucket *bp;
@ -1332,7 +1325,7 @@ add_symbol()
static void static void
copy_action() copy_action(void)
{ {
int c; int c;
int i, n; int i, n;
@ -1556,7 +1549,7 @@ copy_action()
static int static int
mark_symbol() mark_symbol(void)
{ {
int c; int c;
bucket *bp = NULL; bucket *bp = NULL;
@ -1600,7 +1593,7 @@ mark_symbol()
static void static void
read_grammar() read_grammar(void)
{ {
int c; int c;
@ -1634,7 +1627,7 @@ read_grammar()
static void static void
free_tags() free_tags(void)
{ {
int i; int i;
@ -1650,7 +1643,7 @@ free_tags()
static void static void
pack_names() pack_names(void)
{ {
bucket *bp; bucket *bp;
char *p, *s, *t; char *p, *s, *t;
@ -1676,7 +1669,7 @@ pack_names()
static void static void
check_symbols() check_symbols(void)
{ {
bucket *bp; bucket *bp;
@ -1695,7 +1688,7 @@ check_symbols()
static void static void
pack_symbols() pack_symbols(void)
{ {
bucket *bp; bucket *bp;
bucket **v; bucket **v;
@ -1820,7 +1813,7 @@ pack_symbols()
static void static void
pack_grammar() pack_grammar(void)
{ {
int i, j; int i, j;
int assoc, preced; int assoc, preced;
@ -1880,7 +1873,7 @@ pack_grammar()
static void static void
print_grammar() print_grammar(void)
{ {
int i, j, k; int i, j, k;
int spacing; int spacing;
@ -1918,7 +1911,7 @@ print_grammar()
void void
reader() reader(void)
{ {
write_section(banner); write_section(banner);
create_symbol_table(); create_symbol_table();

View File

@ -409,8 +409,7 @@ const char *trailer[] =
void void
write_section(section) write_section(const char *section[])
const char *section[];
{ {
int c; int c;
int i; int i;

View File

@ -60,8 +60,7 @@ bucket *last_symbol;
static int static int
hash(name) hash(const char *name)
const char *name;
{ {
const char *s; const char *s;
int c, k; int c, k;
@ -77,8 +76,7 @@ const char *name;
bucket * bucket *
make_bucket(name) make_bucket(const char *name)
const char *name;
{ {
bucket *bp; bucket *bp;
@ -104,8 +102,7 @@ const char *name;
bucket * bucket *
lookup(name) lookup(char *name)
char *name;
{ {
bucket *bp, **bpp; bucket *bp, **bpp;
@ -128,7 +125,7 @@ char *name;
void void
create_symbol_table() create_symbol_table(void)
{ {
int i; int i;
bucket *bp; bucket *bp;
@ -149,7 +146,7 @@ create_symbol_table()
void void
free_symbol_table() free_symbol_table(void)
{ {
FREE(symbol_table); FREE(symbol_table);
symbol_table = 0; symbol_table = 0;
@ -157,7 +154,7 @@ free_symbol_table()
void void
free_symbols() free_symbols(void)
{ {
bucket *p, *q; bucket *p, *q;

View File

@ -60,7 +60,7 @@ static void print_shifts(action *);
static void print_state(int); static void print_state(int);
void void
verbose() verbose(void)
{ {
int i; int i;
@ -85,7 +85,7 @@ verbose()
static void static void
log_unused() log_unused(void)
{ {
int i; int i;
short *p; short *p;
@ -105,7 +105,7 @@ log_unused()
static void static void
log_conflicts() log_conflicts(void)
{ {
int i; int i;
@ -134,8 +134,7 @@ log_conflicts()
static void static void
print_state(state) print_state(int state)
int state;
{ {
if (state) if (state)
fprintf(verbose_file, "\n\n"); fprintf(verbose_file, "\n\n");
@ -149,8 +148,7 @@ int state;
static void static void
print_conflicts(state) print_conflicts(int state)
int state;
{ {
int symbol, act = 0, number = 0; int symbol, act = 0, number = 0;
action *p; action *p;
@ -198,8 +196,7 @@ int state;
static void static void
print_core(state) print_core(int state)
int state;
{ {
int i; int i;
int k; int k;
@ -235,8 +232,7 @@ int state;
static void static void
print_nulls(state) print_nulls(int state)
int state;
{ {
action *p; action *p;
int i, j, k, nnulls; int i, j, k, nnulls;
@ -280,8 +276,7 @@ int state;
static void static void
print_actions(stateno) print_actions(int stateno)
int stateno;
{ {
action *p; action *p;
shifts *sp; shifts *sp;
@ -308,8 +303,7 @@ int stateno;
static void static void
print_shifts(p) print_shifts(action *p)
action *p;
{ {
int count; int count;
action *q; action *q;
@ -334,9 +328,7 @@ action *p;
static void static void
print_reductions(p, defreduct) print_reductions(action *p, int defreduct)
action *p;
int defreduct;
{ {
int k, anyreds; int k, anyreds;
action *q; action *q;
@ -373,8 +365,7 @@ int defreduct;
static void static void
print_gotos(stateno) print_gotos(int stateno)
int stateno;
{ {
int i, k; int i, k;
int as; int as;

View File

@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
static void transitive_closure(unsigned *, int); static void transitive_closure(unsigned *, int);
static void static void
transitive_closure(R, n) transitive_closure(unsigned *R, int n)
unsigned *R;
int n;
{ {
int rowsize; int rowsize;
unsigned i; unsigned i;
@ -101,9 +99,7 @@ int n;
} }
void void
reflexive_transitive_closure(R, n) reflexive_transitive_closure(unsigned *R, int n)
unsigned *R;
int n;
{ {
int rowsize; int rowsize;
unsigned i; unsigned i;