From d33cb3ae09c2bed6df2ef950f5aa14ceba428d8b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 21 Oct 2002 05:30:50 +0000 Subject: [PATCH] Remove all uses of PARAMS, since we now assume C89 or better. --- src/LR0.h | 2 +- src/assoc.h | 2 +- src/closure.h | 6 ++-- src/conflicts.h | 10 +++--- src/derives.h | 4 +-- src/files.c | 2 +- src/files.h | 6 ++-- src/getargs.h | 2 +- src/gram.h | 32 ++++++++--------- src/lalr.h | 4 +-- src/muscle_tab.h | 17 +++++---- src/nullable.h | 4 +-- src/output.h | 2 +- src/parse-gram.c | 87 ++++++++++++++++++++++++++--------------------- src/parse-gram.h | 2 +- src/print.h | 2 +- src/print_graph.h | 2 +- src/reader.h | 41 ++++++++++------------ src/reduce.h | 6 ++-- src/relation.h | 8 ++--- src/scan-action.l | 2 +- src/scan-gram.c | 45 ++++++------------------ src/scan-gram.l | 8 ++--- src/scan-skel.l | 2 +- src/state.h | 33 ++++++++---------- src/symlist.h | 16 ++++----- src/symtab.h | 46 ++++++++++++------------- src/tables.h | 4 +-- src/vcg.h | 36 ++++++++++---------- 29 files changed, 203 insertions(+), 230 deletions(-) diff --git a/src/LR0.h b/src/LR0.h index b63bd827..be8cdaa1 100644 --- a/src/LR0.h +++ b/src/LR0.h @@ -23,6 +23,6 @@ # include "state.h" -void generate_states PARAMS ((void)); +void generate_states (void); #endif /* !LR0_H_ */ diff --git a/src/assoc.h b/src/assoc.h index dd62e194..a0bb1850 100644 --- a/src/assoc.h +++ b/src/assoc.h @@ -30,6 +30,6 @@ typedef enum non_assoc } assoc_t; -const char *assoc_to_string PARAMS ((assoc_t assoc)); +const char *assoc_to_string (assoc_t assoc); #endif /* !ASSOC_H_ */ diff --git a/src/closure.h b/src/closure.h index e47d8d38..43eae0f0 100644 --- a/src/closure.h +++ b/src/closure.h @@ -25,7 +25,7 @@ data so that closure can be called. n is the number of elements to allocate for itemset. */ -void new_closure PARAMS ((int n)); +void new_closure (int n); /* Given the kernel (aka core) of a state (a vector of item numbers @@ -42,12 +42,12 @@ void new_closure PARAMS ((int n)); significant). CLOSURE places there the indices of all items which represent units of input that could arrive next. */ -void closure PARAMS ((item_number_t *items, int n)); +void closure (item_number_t *items, int n); /* Frees ITEMSET, RULESET and internal data. */ -void free_closure PARAMS ((void)); +void free_closure (void); extern item_number_t *itemset; extern int nritemset; diff --git a/src/conflicts.h b/src/conflicts.h index 2d814d74..234283a4 100644 --- a/src/conflicts.h +++ b/src/conflicts.h @@ -22,11 +22,11 @@ # define CONFLICTS_H_ # include "state.h" -void conflicts_solve PARAMS ((void)); -void conflicts_print PARAMS ((void)); -int conflicts_total_count PARAMS ((void)); -void conflicts_output PARAMS ((FILE *out)); -void conflicts_free PARAMS ((void)); +void conflicts_solve (void); +void conflicts_print (void); +int conflicts_total_count (void); +void conflicts_output (FILE *out); +void conflicts_free (void); /* Were there conflicts? */ extern int expected_conflicts; diff --git a/src/derives.h b/src/derives.h index c5581243..fdeafba0 100644 --- a/src/derives.h +++ b/src/derives.h @@ -27,7 +27,7 @@ extern rule_t ***derives; /* Compute DERIVES. */ -void derives_compute PARAMS((void)); -void derives_free PARAMS((void)); +void derives_compute (void); +void derives_free (void); #endif /* !DERIVES_H_ */ diff --git a/src/files.c b/src/files.c index c4c223d3..dd3ec818 100644 --- a/src/files.c +++ b/src/files.c @@ -28,7 +28,7 @@ #include "complain.h" /* From basename.c. Almost a lie, as it returns a char *. */ -const char *base_name PARAMS ((char const *name)); +const char *base_name (char const *name); FILE *finput = NULL; diff --git a/src/files.h b/src/files.h index 0e3d7773..4b162ee8 100644 --- a/src/files.h +++ b/src/files.h @@ -52,10 +52,10 @@ extern struct obstack post_prologue_obstack; extern char *infile; -void compute_output_file_names PARAMS((void)); +void compute_output_file_names (void); -FILE *xfopen PARAMS ((const char *name, const char *mode)); -int xfclose PARAMS ((FILE *ptr)); +FILE *xfopen (const char *name, const char *mode); +int xfclose (FILE *ptr); /* Is SUFFIX ending STRING? */ int strsuffix (const char* string, const char* suffix); diff --git a/src/getargs.h b/src/getargs.h index 11b263fc..2384231e 100644 --- a/src/getargs.h +++ b/src/getargs.h @@ -64,6 +64,6 @@ enum report_e }; extern int report_flag; -void getargs PARAMS ((int argc, char *argv[])); +void getargs (int argc, char *argv[]); #endif /* !GETARGS_H_ */ diff --git a/src/gram.h b/src/gram.h index 919efa25..14f54b52 100644 --- a/src/gram.h +++ b/src/gram.h @@ -176,31 +176,31 @@ typedef struct rule_s extern struct rule_s *rules; /* A function that selects a rule. */ -typedef bool (*rule_filter_t) PARAMS ((rule_t *r)); +typedef bool (*rule_filter_t) (rule_t *r); /* Return true IFF the rule has a `number' smaller than NRULES. */ -bool rule_useful_p PARAMS ((rule_t *r)); +bool rule_useful_p (rule_t *r); /* Return true IFF the rule has a `number' higher than NRULES. */ -bool rule_useless_p PARAMS ((rule_t *r)); +bool rule_useless_p (rule_t *r); /* Return true IFF the rule is not flagged as useful *and* is useful. In other words, it was discarded because of conflicts. */ -bool rule_never_reduced_p PARAMS ((rule_t *r)); +bool rule_never_reduced_p (rule_t *r); /* Print this RULE's number and lhs on OUT. If a PREVIOUS_LHS was already displayed (by a previous call for another rule), avoid useless repetitions. */ -void rule_lhs_print PARAMS ((rule_t *rule, symbol_t *previous_lhs, FILE *out)); +void rule_lhs_print (rule_t *rule, symbol_t *previous_lhs, FILE *out); /* Return the length of the RHS. */ -int rule_rhs_length PARAMS ((rule_t *rule)); +int rule_rhs_length (rule_t *rule); /* Print this RULE's RHS on OUT. */ -void rule_rhs_print PARAMS ((rule_t *rule, FILE *out)); +void rule_rhs_print (rule_t *rule, FILE *out); /* Print this RULE on OUT. */ -void rule_print PARAMS ((rule_t *rule, FILE *out)); +void rule_print (rule_t *rule, FILE *out); @@ -228,29 +228,29 @@ extern int glr_parser; extern int pure_parser; /* Dump RITEM for traces. */ -void ritem_print PARAMS ((FILE *out)); +void ritem_print (FILE *out); /* Return the size of the longest rule RHS. */ -size_t ritem_longest_rhs PARAMS ((void)); +size_t ritem_longest_rhs (void); /* Print the grammar's rules numbers from BEGIN (inclusive) to END (exclusive) on OUT under TITLE. */ -void grammar_rules_partial_print PARAMS ((FILE *out, const char *title, - rule_filter_t filter)); +void grammar_rules_partial_print (FILE *out, const char *title, + rule_filter_t filter); /* Print the grammar's rules on OUT. */ -void grammar_rules_print PARAMS ((FILE *out)); +void grammar_rules_print (FILE *out); /* Dump the grammar. */ -void grammar_dump PARAMS ((FILE *out, const char *title)); +void grammar_dump (FILE *out, const char *title); /* Report on STDERR the rules that are not flagged USEFUL, using the MESSAGE (which can be `useless rule' when invoked after grammar reduction, or `never reduced' after conflicts were taken into account). */ -void grammar_rules_never_reduced_report PARAMS ((const char *message)); +void grammar_rules_never_reduced_report (const char *message); /* Free the packed grammar. */ -void grammar_free PARAMS ((void)); +void grammar_free (void); #endif /* !GRAM_H_ */ diff --git a/src/lalr.h b/src/lalr.h index c0ca461c..ca18022d 100644 --- a/src/lalr.h +++ b/src/lalr.h @@ -34,12 +34,12 @@ which rules need lookahead in each state, and which lookahead tokens they accept. */ -void lalr PARAMS ((void)); +void lalr (void); /* Release the information related to lookaheads. Can be performed once the action tables are computed. */ -void lalr_free PARAMS ((void)); +void lalr_free (void); /* lalr() builds these data structures. */ diff --git a/src/muscle_tab.h b/src/muscle_tab.h index 8865538f..3b186c12 100644 --- a/src/muscle_tab.h +++ b/src/muscle_tab.h @@ -27,10 +27,10 @@ typedef struct muscle_entry_s char *value; } muscle_entry_t; -void muscle_init PARAMS ((void)); -void muscle_insert PARAMS ((const char *key, char *value)); -char *muscle_find PARAMS ((const char *key)); -void muscle_free PARAMS ((void)); +void muscle_init (void); +void muscle_insert (const char *key, char *value); +char *muscle_find (const char *key); +void muscle_free (void); /* An obstack dedicated to receive muscle keys and values. */ @@ -68,17 +68,16 @@ extern struct obstack muscle_obstack; previous value. Uses MUSCLE_OBSTACK. De-allocates the previously associated value. VALUE and SEPARATOR are copied. */ -void muscle_grow PARAMS ((const char *key, - const char *value, const char *separator)); +void muscle_grow (const char *key, const char *value, const char *separator); /* MUSCLE is an M4 list of pairs. Create or extend it with the pair (A1, A2). Note that because the muscle values are output *double* quoted, one needs to strip the first level of quotes to reach the list itself. */ -void muscle_pair_list_grow PARAMS ((const char *muscle, - const char *a1, const char *a2)); +void muscle_pair_list_grow (const char *muscle, + const char *a1, const char *a2); -void muscles_m4_output PARAMS ((FILE *out)); +void muscles_m4_output (FILE *out); #endif /* not MUSCLE_TAB_H_ */ diff --git a/src/nullable.h b/src/nullable.h index af46c9c6..dbef4905 100644 --- a/src/nullable.h +++ b/src/nullable.h @@ -26,8 +26,8 @@ extern bool *nullable; /* Set up NULLABLE. */ -extern void nullable_compute PARAMS((void)); +extern void nullable_compute (void); /* Free NULLABLE. */ -extern void nullable_free PARAMS((void)); +extern void nullable_free (void); #endif /* !NULLABLE_H_ */ diff --git a/src/output.h b/src/output.h index 53cef896..ece5b2f7 100644 --- a/src/output.h +++ b/src/output.h @@ -24,6 +24,6 @@ extern int error_verbose; /* Output the parsing tables and the parser code to FTABLE. */ -void output PARAMS ((void)); +void output (void); #endif /* !OUTPUT_H_ */ diff --git a/src/parse-gram.c b/src/parse-gram.c index e4fbae5b..db95d632 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -236,7 +236,7 @@ typedef union { char *string; assoc_t assoc; } yystype; -/* Line 193 of /usr/local/share/bison/yacc.c. */ +/* Line 203 of /tmp/prefix/share/bison/yacc.c. */ #line 241 "parse-gram.c" # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 @@ -257,7 +257,7 @@ typedef struct yyltype /* Copy the second part of user declarations. */ -/* Line 213 of /usr/local/share/bison/yacc.c. */ +/* Line 223 of /tmp/prefix/share/bison/yacc.c. */ #line 262 "parse-gram.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -357,6 +357,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ #define YYLAST 152 /* YYNTOKENS -- Number of terminals. */ @@ -714,9 +715,9 @@ while (0) /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex (&yylval, &yylloc) +# define YYLEX yylex (&yylval, &yylloc) #endif /* Enable debugging if requested. */ @@ -827,12 +828,13 @@ yystpcpy (yydest, yysrc) | Print this symbol on YYOUT. | `-----------------------------*/ -static void #if defined (__STDC__) || defined (__cplusplus) -yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue, YYLTYPE yylocation) +static void +yysymprint (FILE *yyout, int yytype, YYSTYPE yyvalue, YYLTYPE yylocation) #else +static void yysymprint (yyout, yytype, yyvalue, yylocation) - FILE* yyout; + FILE *yyout; int yytype; YYSTYPE yyvalue; YYLTYPE yylocation; @@ -866,10 +868,11 @@ yysymprint (yyout, yytype, yyvalue, yylocation) | Release the memory associated to this symbol. | `-----------------------------------------------*/ -static void #if defined (__STDC__) || defined (__cplusplus) +static void yydestruct (int yytype, YYSTYPE yyvalue, YYLTYPE yylocation) #else +static void yydestruct (yytype, yyvalue, yylocation) int yytype; YYSTYPE yyvalue; @@ -889,40 +892,48 @@ yydestruct (yytype, yyvalue, yylocation) -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL +int yyparse (void *YYPARSE_PARAM); # else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +int yyparse (); # endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); -# endif +#else +int yyparse (); +#endif #endif + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) +#else int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL +yyparse () + +#endif +#endif { /* The lookahead symbol. */ int yychar; @@ -1008,7 +1019,7 @@ YYLTYPE yylloc; yysetstate: *yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; @@ -1040,10 +1051,10 @@ YYLTYPE yylloc; goto yyoverflowlab; # else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) + if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { @@ -1069,7 +1080,7 @@ YYLTYPE yylloc; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } @@ -1201,7 +1212,7 @@ yyreduce: yyn - 1, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) + for (yyi = yyprhs[yyn]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } @@ -1616,8 +1627,8 @@ yyreduce: } -/* Line 1016 of /usr/local/share/bison/yacc.c. */ -#line 1621 "parse-gram.c" +/* Line 1022 of /tmp/prefix/share/bison/yacc.c. */ +#line 1632 "parse-gram.c" yyvsp -= yylen; yyssp -= yylen; @@ -1727,7 +1738,7 @@ yyerrlab1: /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ - while (yyssp > yyss) + while (yyss < yyssp) { YYDPRINTF ((stderr, "Error: popping ")); YYDSYMPRINT ((stderr, diff --git a/src/parse-gram.h b/src/parse-gram.h index 9a0db65a..f9e6296b 100644 --- a/src/parse-gram.h +++ b/src/parse-gram.h @@ -139,7 +139,7 @@ typedef union { char *string; assoc_t assoc; } yystype; -/* Line 1281 of /usr/local/share/bison/yacc.c. */ +/* Line 1287 of /tmp/prefix/share/bison/yacc.c. */ #line 144 "y.tab.h" # define YYSTYPE yystype #endif diff --git a/src/print.h b/src/print.h index ec7299f3..bdddafbe 100644 --- a/src/print.h +++ b/src/print.h @@ -21,6 +21,6 @@ #ifndef PRINT_H_ # define PRINT_H_ -void print_results PARAMS ((void)); +void print_results (void); #endif /* !PRINT_H_ */ diff --git a/src/print_graph.h b/src/print_graph.h index ba2e6d3d..7be8a52d 100644 --- a/src/print_graph.h +++ b/src/print_graph.h @@ -21,6 +21,6 @@ #ifndef PRINT_GRAPH_H_ # define PRINT_GRAPH_H_ -void print_graph PARAMS ((void)); +void print_graph (void); #endif /* !PRINT_GRAPH_H_ */ diff --git a/src/reader.h b/src/reader.h index 8792372e..186b8567 100644 --- a/src/reader.h +++ b/src/reader.h @@ -40,9 +40,9 @@ typedef struct gram_control_s /* From the scanner. */ extern FILE *gram_in; extern int gram__flex_debug; -void scanner_last_string_free PARAMS ((void)); -void scanner_initialize PARAMS ((void)); -void scanner_free PARAMS ((void)); +void scanner_last_string_free (void); +void scanner_initialize (void); +void scanner_free (void); # define YY_DECL \ int gram_lex (yystype *yylval, location_t *yylloc, \ @@ -68,27 +68,22 @@ extern braced_code_t current_braced_code; /* From reader.c. */ -void grammar_start_symbol_set PARAMS ((symbol_t *s, location_t l)); -void prologue_augment PARAMS ((const char *prologue, location_t location)); -void epilogue_set PARAMS ((const char *epilogue, location_t location)); -void grammar_symbol_append PARAMS ((symbol_t *s, location_t l)); -void grammar_rule_begin PARAMS ((symbol_t *lhs, location_t l)); -void grammar_rule_end PARAMS ((location_t l)); -void grammar_midrule_action PARAMS ((void)); -void grammar_current_rule_prec_set PARAMS ((symbol_t *precsym, - location_t l)); -void grammar_current_rule_dprec_set PARAMS ((int dprec, - location_t l)); -void grammar_current_rule_merge_set PARAMS ((const char* name, - location_t l)); - -void grammar_current_rule_symbol_append PARAMS ((symbol_t *symbol, - location_t l)); -void grammar_current_rule_action_append PARAMS ((const char *action, - location_t l)); +void grammar_start_symbol_set (symbol_t *s, location_t l); +void prologue_augment (const char *prologue, location_t location); +void epilogue_set (const char *epilogue, location_t location); +void grammar_symbol_append (symbol_t *s, location_t l); +void grammar_rule_begin (symbol_t *lhs, location_t l); +void grammar_rule_end (location_t l); +void grammar_midrule_action (void); +void grammar_current_rule_prec_set (symbol_t *precsym, location_t l); +void grammar_current_rule_dprec_set (int dprec, location_t l); +void grammar_current_rule_merge_set (const char* name, location_t l); + +void grammar_current_rule_symbol_append (symbol_t *symbol, location_t l); +void grammar_current_rule_action_append (const char *action, location_t l); extern symbol_list_t *current_rule; -void reader PARAMS ((void)); -void free_merger_functions PARAMS ((void)); +void reader (void); +void free_merger_functions (void); extern merger_list *merge_functions; diff --git a/src/reduce.h b/src/reduce.h index a1d8aa4c..8069aca9 100644 --- a/src/reduce.h +++ b/src/reduce.h @@ -21,9 +21,9 @@ #ifndef REDUCE_H_ # define REDUCE_H_ -void reduce_grammar PARAMS ((void)); -void reduce_output PARAMS ((FILE *out)); -void reduce_free PARAMS ((void)); +void reduce_grammar (void); +void reduce_output (FILE *out); +void reduce_free (void); extern symbol_number_t nuseless_nonterminals; extern rule_number_t nuseless_productions; diff --git a/src/relation.h b/src/relation.h index 8a82b854..45a872be 100644 --- a/src/relation.h +++ b/src/relation.h @@ -33,18 +33,16 @@ typedef relation_nodes_t *relation_t; /* Report a RELATION that has SIZE vertices. */ -void relation_print PARAMS ((relation_t relation, size_t size, - FILE *out)); +void relation_print (relation_t relatio, size_t size, FILE *out); /* Compute the transitive closure of the FUNCTION on the RELATION with SIZE vertices. If RELATION (NODE-1, NODE-2) then on exit FUNCTION[NODE-1] was extended (unioned) with FUNCTION[NODE-2]. */ -void relation_digraph PARAMS ((relation_t relation, size_t size, - bitsetv *function)); +void relation_digraph (relation_t relation, size_t size, bitsetv *function); /* Destructively transpose *R_ARG, of size N. */ -void relation_transpose PARAMS ((relation_t *R_arg, int n)); +void relation_transpose (relation_t *R_arg, int n); #endif /* ! RELATION_H_ */ diff --git a/src/scan-action.l b/src/scan-action.l index 8e498a85..c8240ac6 100644 --- a/src/scan-action.l +++ b/src/scan-action.l @@ -24,7 +24,7 @@ %{ #include "system.h" #include "files.h" -int skel_lex PARAMS ((void)); +int skel_lex (void); static int yylineno = 1; %} diff --git a/src/scan-gram.c b/src/scan-gram.c index 6e896ed9..fc1af480 100644 --- a/src/scan-gram.c +++ b/src/scan-gram.c @@ -27,7 +27,7 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#include + /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus @@ -40,15 +40,7 @@ #ifdef __cplusplus #include -#ifndef _WIN32 #include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -837,10 +829,10 @@ static int percent_percent_count = 0; Outside of well-formed rules, RULE_LENGTH has an undefined value. */ static int rule_length; -static void handle_dollar PARAMS ((braced_code_t code_kind, - char *cp, location_t location)); -static void handle_at PARAMS ((braced_code_t code_kind, - char *cp, location_t location)); +static void handle_dollar (braced_code_t code_kind, + char *cp, location_t location); +static void handle_at (braced_code_t code_kind, + char *cp, location_t location); #define SC_COMMENT 1 @@ -854,7 +846,7 @@ static void handle_at PARAMS ((braced_code_t code_kind, #define SC_PROLOGUE 7 #define SC_EPILOGUE 8 -#line 858 "scan-gram.c" +#line 850 "scan-gram.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -954,20 +946,9 @@ YY_MALLOC_DECL YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - } + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1028,7 +1009,7 @@ YY_DECL /*----------------------------. | Scanning Bison directives. | `----------------------------*/ -#line 1032 "scan-gram.c" +#line 1013 "scan-gram.c" if ( yy_init ) { @@ -1908,7 +1889,7 @@ YY_RULE_SETUP #line 533 "scan-gram.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1912 "scan-gram.c" +#line 1893 "scan-gram.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2472,15 +2453,11 @@ YY_BUFFER_STATE b; } -#ifndef _WIN32 -#include -#else #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif -#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) diff --git a/src/scan-gram.l b/src/scan-gram.l index 235272f1..fa24a1aa 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -87,10 +87,10 @@ static int percent_percent_count = 0; Outside of well-formed rules, RULE_LENGTH has an undefined value. */ static int rule_length; -static void handle_dollar PARAMS ((braced_code_t code_kind, - char *cp, location_t location)); -static void handle_at PARAMS ((braced_code_t code_kind, - char *cp, location_t location)); +static void handle_dollar (braced_code_t code_kind, + char *cp, location_t location); +static void handle_at (braced_code_t code_kind, + char *cp, location_t location); %} %x SC_COMMENT diff --git a/src/scan-skel.l b/src/scan-skel.l index 3f98cf7d..e56d3723 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -26,7 +26,7 @@ #include "error.h" #include "getargs.h" #include "files.h" -int skel_lex PARAMS ((void)); +int skel_lex (void); static int yylineno = 1; static char *yyoutname = NULL; %} diff --git a/src/state.h b/src/state.h index f63cc4f8..830d4578 100644 --- a/src/state.h +++ b/src/state.h @@ -154,8 +154,7 @@ typedef struct transtion_s /* Return the state such these TRANSITIONS contain a shift/goto to it on SYMBOL. Aborts if none found. */ struct state_s; -struct state_s *transitions_to PARAMS ((transitions_t *state, - symbol_number_t s)); +struct state_s *transitions_to (transitions_t *state, symbol_number_t s); /*-------. @@ -168,7 +167,7 @@ typedef struct errs_s symbol_t *symbols[1]; } errs_t; -errs_t *errs_new PARAMS ((int num, symbol_t **tokens)); +errs_t *errs_new (int num, symbol_t **tokens); /*-------------. @@ -213,42 +212,38 @@ extern state_number_t nstates; extern state_t *final_state; /* Create a new state with ACCESSING_SYMBOL for those items. */ -state_t *state_new PARAMS ((symbol_number_t accessing_symbol, - size_t core_size, item_number_t *core)); +state_t *state_new (symbol_number_t accessing_symbol, + size_t core_size, item_number_t *core); /* Set the transitions of STATE. */ -void state_transitions_set PARAMS ((state_t *state, - int num, state_t **transitions)); +void state_transitions_set (state_t *state, int num, state_t **transitions); /* Set the reductions of STATE. */ -void state_reductions_set PARAMS ((state_t *state, - int num, rule_t **reductions)); +void state_reductions_set (state_t *state, int num, rule_t **reductions); -int state_reduction_find PARAMS ((state_t *state, rule_t *rule)); +int state_reduction_find (state_t *state, rule_t *rule); /* Set the errs of STATE. */ -void state_errs_set PARAMS ((state_t *state, - int num, symbol_t **errs)); +void state_errs_set (state_t *state, int num, symbol_t **errs); /* Print on OUT all the lookaheads such that this STATE wants to reduce this RULE. */ -void state_rule_lookaheads_print PARAMS ((state_t *state, rule_t *rule, - FILE *out)); +void state_rule_lookaheads_print (state_t *state, rule_t *rule, FILE *out); /* Create/destroy the states hash table. */ -void state_hash_new PARAMS ((void)); -void state_hash_free PARAMS ((void)); +void state_hash_new (void); +void state_hash_free (void); /* Find the state associated to the CORE, and return it. If it does not exist yet, return NULL. */ -state_t *state_hash_lookup PARAMS ((size_t core_size, item_number_t *core)); +state_t *state_hash_lookup (size_t core_size, item_number_t *core); /* Insert STATE in the state hash table. */ -void state_hash_insert PARAMS ((state_t *state)); +void state_hash_insert (state_t *state); /* All the states, indexed by the state number. */ extern state_t **states; /* Free all the states. */ -void states_free PARAMS ((void)); +void states_free (void); #endif /* !STATE_H_ */ diff --git a/src/symlist.h b/src/symlist.h index 6c522d09..4f755701 100644 --- a/src/symlist.h +++ b/src/symlist.h @@ -41,22 +41,22 @@ typedef struct symbol_list_s /* Create a list containing SYMBOL at LOCATION. */ -symbol_list_t *symbol_list_new PARAMS ((symbol_t *sym, location_t location)); +symbol_list_t *symbol_list_new (symbol_t *sym, location_t location); /* Prepend SYMBOL at LOCATION to the LIST. */ -symbol_list_t * symbol_list_prepend PARAMS ((symbol_list_t *list, - symbol_t *symbol, - location_t location)); +symbol_list_t * symbol_list_prepend (symbol_list_t *list, + symbol_t *symbol, + location_t location); /* Free the LIST, but not the symbols it contains. */ -void symbol_list_free PARAMS ((symbol_list_t *list)); +void symbol_list_free (symbol_list_t *list); /* Return its length. */ -unsigned int symbol_list_length PARAMS ((symbol_list_t *list)); +unsigned int symbol_list_length (symbol_list_t *list); /* Get the data type (alternative in the union) of the value for symbol N in rule RULE. */ -char *symbol_list_n_type_name_get PARAMS ((symbol_list_t *rule, - location_t location, int n)); +char *symbol_list_n_type_name_get (symbol_list_t *rule, + location_t location, int n); #endif /* !SYMLIST_H_ */ diff --git a/src/symtab.h b/src/symtab.h index 2c00c72e..7ad63333 100644 --- a/src/symtab.h +++ b/src/symtab.h @@ -84,43 +84,41 @@ struct symbol_s /* Fetch (or create) the symbol associated to KEY. */ -symbol_t *symbol_get PARAMS ((const char *key, location_t location)); +symbol_t *symbol_get (const char *key, location_t location); /* Generate a dummy nonterminal, whose name cannot conflict with the user's names. */ -symbol_t *dummy_symbol_get PARAMS ((location_t location)); +symbol_t *dummy_symbol_get (location_t location); /* Declare the new SYMBOL. Make it an alias of SYMVAL. */ -void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval, - location_t location)); +void symbol_make_alias (symbol_t *symbol, symbol_t *symval, + location_t location); /* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as TYPE_NAME. */ -void symbol_type_set PARAMS ((symbol_t *symbol, - char *type_name, location_t location)); +void symbol_type_set (symbol_t *symbol, + char *type_name, location_t location); /* Set the DESTRUCTOR associated to SYMBOL. */ -void symbol_destructor_set PARAMS ((symbol_t *symbol, - char *destructor, location_t location)); +void symbol_destructor_set (symbol_t *symbol, + char *destructor, location_t location); /* Set the PRINTER associated to SYMBOL. */ -void symbol_printer_set PARAMS ((symbol_t *symbol, - char *printer, location_t location)); +void symbol_printer_set (symbol_t *symbol, + char *printer, location_t location); /* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */ -void symbol_precedence_set PARAMS ((symbol_t *symbol, - int prec, assoc_t assoc, - location_t location)); +void symbol_precedence_set (symbol_t *symbol, + int prec, assoc_t assoc, location_t location); /* Set the CLASS associated to SYMBOL. */ -void symbol_class_set PARAMS ((symbol_t *symbol, - symbol_class class, location_t location)); +void symbol_class_set (symbol_t *symbol, + symbol_class class, location_t location); /* Set the USER_TOKEN_NUMBER associated to SYMBOL. */ -void symbol_user_token_number_set PARAMS ((symbol_t *symbol, - int user_number, - location_t location)); +void symbol_user_token_number_set (symbol_t *symbol, + int user_number, location_t location); /* Distinguished symbols. AXIOM is the real start symbol, that used @@ -140,24 +138,24 @@ extern location_t startsymbol_location; /* Create the symbol table. */ -void symbols_new PARAMS ((void)); +void symbols_new (void); /* A function to apply to each symbol. */ -typedef bool (*symbol_processor) PARAMS ((symbol_t *)); +typedef bool (*symbol_processor) (symbol_t *); /* Apply PROCESSOR to all the symbols. PROCESSOR must return TRUE: on FALSE, the processing stops. */ -void symbols_do PARAMS ((symbol_processor processor, void *processor_data)); +void symbols_do (symbol_processor processor, void *processor_data); /* Free all the memory allocated for symbols. */ -void symbols_free PARAMS ((void)); +void symbols_free (void); /* Check that all the symbols are defined. Report any undefined symbols and consider them nonterminals. */ -void symbols_check_defined PARAMS ((void)); +void symbols_check_defined (void); /* Perform various sanity checks, assign symbol numbers, and set up TOKEN_TRANSLATIONS. */ -void symbols_pack PARAMS ((void)); +void symbols_pack (void); #endif /* !SYMTAB_H_ */ diff --git a/src/tables.h b/src/tables.h index 92b4605e..6d56889d 100644 --- a/src/tables.h +++ b/src/tables.h @@ -113,7 +113,7 @@ extern state_number_t *yydefgoto; extern rule_number_t *yydefact; extern int high; -void tables_generate PARAMS ((void)); -void tables_free PARAMS ((void)); +void tables_generate (void); +void tables_free (void); #endif /* !TABLES_H_ */ diff --git a/src/vcg.h b/src/vcg.h index 8935cc1b..709da0c9 100644 --- a/src/vcg.h +++ b/src/vcg.h @@ -992,28 +992,28 @@ struct graph_s /* Graph typedefs. */ typedef struct graph_s graph_t; -void new_graph PARAMS ((graph_t *g)); -void new_node PARAMS ((node_t *node)); -void new_edge PARAMS ((edge_t *edge)); +void new_graph (graph_t *g); +void new_node (node_t *node); +void new_edge (edge_t *edge); -void add_node PARAMS ((graph_t *graph, node_t *node)); -void add_edge PARAMS ((graph_t *graph, edge_t *edge)); +void add_node (graph_t *graph, node_t *node); +void add_edge (graph_t *graph, edge_t *edge); -void add_colorentry PARAMS ((graph_t *g, int color_idx, int red_cp, - int green_cp, int blue_cp)); -void add_classname PARAMS ((graph_t *g, int val, const char *name)); -void add_infoname PARAMS ((graph_t *g, int val, const char *name)); +void add_colorentry (graph_t *g, int color_idx, int red_cp, + int green_cp, int blue_cp); +void add_classname (graph_t *g, int val, const char *name); +void add_infoname (graph_t *g, int val, const char *name); -void open_node PARAMS ((FILE *fout)); -void output_node PARAMS ((node_t *node, FILE *fout)); -void close_node PARAMS ((FILE *fout)); +void open_node (FILE *fout); +void output_node (node_t *node, FILE *fout); +void close_node (FILE *fout); -void open_edge PARAMS ((edge_t *edge, FILE *fout)); -void output_edge PARAMS ((edge_t *edge, FILE *fout)); -void close_edge PARAMS ((FILE *fout)); +void open_edge (edge_t *edge, FILE *fout); +void output_edge (edge_t *edge, FILE *fout); +void close_edge (FILE *fout); -void open_graph PARAMS ((FILE *fout)); -void output_graph PARAMS ((graph_t *graph, FILE *fout)); -void close_graph PARAMS ((graph_t *graph, FILE *fout)); +void open_graph (FILE *fout); +void output_graph (graph_t *graph, FILE *fout); +void close_graph (graph_t *graph, FILE *fout); #endif /* VCG_H_ */ -- 2.45.2