Remove all uses of PARAMS, since we now assume C89 or better.

This commit is contained in:
Paul Eggert
2002-10-21 05:30:50 +00:00
parent b8452344de
commit d33cb3ae09
29 changed files with 202 additions and 229 deletions

View File

@@ -23,6 +23,6 @@
# include "state.h" # include "state.h"
void generate_states PARAMS ((void)); void generate_states (void);
#endif /* !LR0_H_ */ #endif /* !LR0_H_ */

View File

@@ -30,6 +30,6 @@ typedef enum
non_assoc non_assoc
} assoc_t; } assoc_t;
const char *assoc_to_string PARAMS ((assoc_t assoc)); const char *assoc_to_string (assoc_t assoc);
#endif /* !ASSOC_H_ */ #endif /* !ASSOC_H_ */

View File

@@ -25,7 +25,7 @@
data so that closure can be called. n is the number of elements to data so that closure can be called. n is the number of elements to
allocate for itemset. */ 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 /* 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 significant). CLOSURE places there the indices of all items which
represent units of input that could arrive next. */ 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. */ /* Frees ITEMSET, RULESET and internal data. */
void free_closure PARAMS ((void)); void free_closure (void);
extern item_number_t *itemset; extern item_number_t *itemset;
extern int nritemset; extern int nritemset;

View File

@@ -22,11 +22,11 @@
# define CONFLICTS_H_ # define CONFLICTS_H_
# include "state.h" # include "state.h"
void conflicts_solve PARAMS ((void)); void conflicts_solve (void);
void conflicts_print PARAMS ((void)); void conflicts_print (void);
int conflicts_total_count PARAMS ((void)); int conflicts_total_count (void);
void conflicts_output PARAMS ((FILE *out)); void conflicts_output (FILE *out);
void conflicts_free PARAMS ((void)); void conflicts_free (void);
/* Were there conflicts? */ /* Were there conflicts? */
extern int expected_conflicts; extern int expected_conflicts;

View File

@@ -27,7 +27,7 @@ extern rule_t ***derives;
/* Compute DERIVES. */ /* Compute DERIVES. */
void derives_compute PARAMS((void)); void derives_compute (void);
void derives_free PARAMS((void)); void derives_free (void);
#endif /* !DERIVES_H_ */ #endif /* !DERIVES_H_ */

View File

@@ -28,7 +28,7 @@
#include "complain.h" #include "complain.h"
/* From basename.c. Almost a lie, as it returns a char *. */ /* 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; FILE *finput = NULL;

View File

@@ -52,10 +52,10 @@ extern struct obstack post_prologue_obstack;
extern char *infile; 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)); FILE *xfopen (const char *name, const char *mode);
int xfclose PARAMS ((FILE *ptr)); int xfclose (FILE *ptr);
/* Is SUFFIX ending STRING? */ /* Is SUFFIX ending STRING? */
int strsuffix (const char* string, const char* suffix); int strsuffix (const char* string, const char* suffix);

View File

@@ -64,6 +64,6 @@ enum report_e
}; };
extern int report_flag; extern int report_flag;
void getargs PARAMS ((int argc, char *argv[])); void getargs (int argc, char *argv[]);
#endif /* !GETARGS_H_ */ #endif /* !GETARGS_H_ */

View File

@@ -176,31 +176,31 @@ typedef struct rule_s
extern struct rule_s *rules; extern struct rule_s *rules;
/* A function that selects a rule. */ /* 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. */ /* 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. */ /* 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. /* Return true IFF the rule is not flagged as useful *and* is useful.
In other words, it was discarded because of conflicts. */ 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 /* Print this RULE's number and lhs on OUT. If a PREVIOUS_LHS was
already displayed (by a previous call for another rule), avoid already displayed (by a previous call for another rule), avoid
useless repetitions. */ 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. */ /* 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. */ /* 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. */ /* 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; extern int pure_parser;
/* Dump RITEM for traces. */ /* Dump RITEM for traces. */
void ritem_print PARAMS ((FILE *out)); void ritem_print (FILE *out);
/* Return the size of the longest rule RHS. */ /* 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 /* Print the grammar's rules numbers from BEGIN (inclusive) to END
(exclusive) on OUT under TITLE. */ (exclusive) on OUT under TITLE. */
void grammar_rules_partial_print PARAMS ((FILE *out, const char *title, void grammar_rules_partial_print (FILE *out, const char *title,
rule_filter_t filter)); rule_filter_t filter);
/* Print the grammar's rules on OUT. */ /* Print the grammar's rules on OUT. */
void grammar_rules_print PARAMS ((FILE *out)); void grammar_rules_print (FILE *out);
/* Dump the grammar. */ /* 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 /* Report on STDERR the rules that are not flagged USEFUL, using the
MESSAGE (which can be `useless rule' when invoked after grammar MESSAGE (which can be `useless rule' when invoked after grammar
reduction, or `never reduced' after conflicts were taken into reduction, or `never reduced' after conflicts were taken into
account). */ account). */
void grammar_rules_never_reduced_report PARAMS ((const char *message)); void grammar_rules_never_reduced_report (const char *message);
/* Free the packed grammar. */ /* Free the packed grammar. */
void grammar_free PARAMS ((void)); void grammar_free (void);
#endif /* !GRAM_H_ */ #endif /* !GRAM_H_ */

View File

@@ -34,12 +34,12 @@
which rules need lookahead in each state, and which lookahead which rules need lookahead in each state, and which lookahead
tokens they accept. */ tokens they accept. */
void lalr PARAMS ((void)); void lalr (void);
/* Release the information related to lookaheads. Can be performed /* Release the information related to lookaheads. Can be performed
once the action tables are computed. */ once the action tables are computed. */
void lalr_free PARAMS ((void)); void lalr_free (void);
/* lalr() builds these data structures. */ /* lalr() builds these data structures. */

View File

@@ -27,10 +27,10 @@ typedef struct muscle_entry_s
char *value; char *value;
} muscle_entry_t; } muscle_entry_t;
void muscle_init PARAMS ((void)); void muscle_init (void);
void muscle_insert PARAMS ((const char *key, char *value)); void muscle_insert (const char *key, char *value);
char *muscle_find PARAMS ((const char *key)); char *muscle_find (const char *key);
void muscle_free PARAMS ((void)); void muscle_free (void);
/* An obstack dedicated to receive muscle keys and values. */ /* 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 previous value. Uses MUSCLE_OBSTACK. De-allocates the previously
associated value. VALUE and SEPARATOR are copied. */ associated value. VALUE and SEPARATOR are copied. */
void muscle_grow PARAMS ((const char *key, void muscle_grow (const char *key, const char *value, const char *separator);
const char *value, const char *separator));
/* MUSCLE is an M4 list of pairs. Create or extend it with the pair /* 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* (A1, A2). Note that because the muscle values are output *double*
quoted, one needs to strip the first level of quotes to reach the quoted, one needs to strip the first level of quotes to reach the
list itself. */ list itself. */
void muscle_pair_list_grow PARAMS ((const char *muscle, void muscle_pair_list_grow (const char *muscle,
const char *a1, const char *a2)); const char *a1, const char *a2);
void muscles_m4_output PARAMS ((FILE *out)); void muscles_m4_output (FILE *out);
#endif /* not MUSCLE_TAB_H_ */ #endif /* not MUSCLE_TAB_H_ */

View File

@@ -26,8 +26,8 @@
extern bool *nullable; extern bool *nullable;
/* Set up NULLABLE. */ /* Set up NULLABLE. */
extern void nullable_compute PARAMS((void)); extern void nullable_compute (void);
/* Free NULLABLE. */ /* Free NULLABLE. */
extern void nullable_free PARAMS((void)); extern void nullable_free (void);
#endif /* !NULLABLE_H_ */ #endif /* !NULLABLE_H_ */

View File

@@ -24,6 +24,6 @@
extern int error_verbose; extern int error_verbose;
/* Output the parsing tables and the parser code to FTABLE. */ /* Output the parsing tables and the parser code to FTABLE. */
void output PARAMS ((void)); void output (void);
#endif /* !OUTPUT_H_ */ #endif /* !OUTPUT_H_ */

View File

@@ -236,7 +236,7 @@ typedef union {
char *string; char *string;
assoc_t assoc; assoc_t assoc;
} yystype; } yystype;
/* Line 193 of /usr/local/share/bison/yacc.c. */ /* Line 203 of /tmp/prefix/share/bison/yacc.c. */
#line 241 "parse-gram.c" #line 241 "parse-gram.c"
# define YYSTYPE yystype # define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
@@ -257,7 +257,7 @@ typedef struct yyltype
/* Copy the second part of user declarations. */ /* 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" #line 262 "parse-gram.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE #if ! defined (yyoverflow) || YYERROR_VERBOSE
@@ -357,6 +357,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 3 #define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 152 #define YYLAST 152
/* YYNTOKENS -- Number of terminals. */ /* YYNTOKENS -- Number of terminals. */
@@ -714,9 +715,9 @@ while (0)
/* YYLEX -- calling `yylex' with the right arguments. */ /* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM #ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
#else #else
# define YYLEX yylex (&yylval, &yylloc) # define YYLEX yylex (&yylval, &yylloc)
#endif #endif
/* Enable debugging if requested. */ /* Enable debugging if requested. */
@@ -827,12 +828,13 @@ yystpcpy (yydest, yysrc)
| Print this symbol on YYOUT. | | Print this symbol on YYOUT. |
`-----------------------------*/ `-----------------------------*/
static void
#if defined (__STDC__) || defined (__cplusplus) #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 #else
static void
yysymprint (yyout, yytype, yyvalue, yylocation) yysymprint (yyout, yytype, yyvalue, yylocation)
FILE* yyout; FILE *yyout;
int yytype; int yytype;
YYSTYPE yyvalue; YYSTYPE yyvalue;
YYLTYPE yylocation; YYLTYPE yylocation;
@@ -866,10 +868,11 @@ yysymprint (yyout, yytype, yyvalue, yylocation)
| Release the memory associated to this symbol. | | Release the memory associated to this symbol. |
`-----------------------------------------------*/ `-----------------------------------------------*/
static void
#if defined (__STDC__) || defined (__cplusplus) #if defined (__STDC__) || defined (__cplusplus)
static void
yydestruct (int yytype, YYSTYPE yyvalue, YYLTYPE yylocation) yydestruct (int yytype, YYSTYPE yyvalue, YYLTYPE yylocation)
#else #else
static void
yydestruct (yytype, yyvalue, yylocation) yydestruct (yytype, yyvalue, yylocation)
int yytype; int yytype;
YYSTYPE yyvalue; 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 /* Prevent warnings from -Wmissing-prototypes. */
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. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus) # if defined (__STDC__) || defined (__cplusplus)
# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM int yyparse (void *YYPARSE_PARAM);
# define YYPARSE_PARAM_DECL
# else # else
# define YYPARSE_PARAM_ARG YYPARSE_PARAM int yyparse ();
# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif # endif
#else /* !YYPARSE_PARAM */ #else /* ! YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG #if defined (__STDC__) || defined (__cplusplus)
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
# ifdef YYPARSE_PARAM
int yyparse (void *);
# else
int yyparse (void); int yyparse (void);
# endif #else
int yyparse ();
#endif
#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 int
yyparse (YYPARSE_PARAM_ARG) yyparse (void)
YYPARSE_PARAM_DECL #else
int
yyparse ()
#endif
#endif
{ {
/* The lookahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
@@ -1008,7 +1019,7 @@ YYLTYPE yylloc;
yysetstate: yysetstate:
*yyssp = yystate; *yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1) if (yyss + yystacksize - 1 <= yyssp)
{ {
/* Get the current used size of the three stacks, in elements. */ /* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = yyssp - yyss + 1; YYSIZE_T yysize = yyssp - yyss + 1;
@@ -1040,10 +1051,10 @@ YYLTYPE yylloc;
goto yyoverflowlab; goto yyoverflowlab;
# else # else
/* Extend the stack our own way. */ /* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH) if (YYMAXDEPTH <= yystacksize)
goto yyoverflowlab; goto yyoverflowlab;
yystacksize *= 2; yystacksize *= 2;
if (yystacksize > YYMAXDEPTH) if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH; yystacksize = YYMAXDEPTH;
{ {
@@ -1069,7 +1080,7 @@ YYLTYPE yylloc;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize)); (unsigned long int) yystacksize));
if (yyssp >= yyss + yystacksize - 1) if (yyss + yystacksize - 1 <= yyssp)
YYABORT; YYABORT;
} }
@@ -1201,7 +1212,7 @@ yyreduce:
yyn - 1, yyrline[yyn]); yyn - 1, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */ /* 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 ", yytname[yyrhs[yyi]]);
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
} }
@@ -1616,8 +1627,8 @@ yyreduce:
} }
/* Line 1016 of /usr/local/share/bison/yacc.c. */ /* Line 1022 of /tmp/prefix/share/bison/yacc.c. */
#line 1621 "parse-gram.c" #line 1632 "parse-gram.c"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
@@ -1727,7 +1738,7 @@ yyerrlab1:
/* Pop the error token. */ /* Pop the error token. */
YYPOPSTACK; YYPOPSTACK;
/* Pop the rest of the stack. */ /* Pop the rest of the stack. */
while (yyssp > yyss) while (yyss < yyssp)
{ {
YYDPRINTF ((stderr, "Error: popping ")); YYDPRINTF ((stderr, "Error: popping "));
YYDSYMPRINT ((stderr, YYDSYMPRINT ((stderr,

View File

@@ -139,7 +139,7 @@ typedef union {
char *string; char *string;
assoc_t assoc; assoc_t assoc;
} yystype; } yystype;
/* Line 1281 of /usr/local/share/bison/yacc.c. */ /* Line 1287 of /tmp/prefix/share/bison/yacc.c. */
#line 144 "y.tab.h" #line 144 "y.tab.h"
# define YYSTYPE yystype # define YYSTYPE yystype
#endif #endif

View File

@@ -21,6 +21,6 @@
#ifndef PRINT_H_ #ifndef PRINT_H_
# define PRINT_H_ # define PRINT_H_
void print_results PARAMS ((void)); void print_results (void);
#endif /* !PRINT_H_ */ #endif /* !PRINT_H_ */

View File

@@ -21,6 +21,6 @@
#ifndef PRINT_GRAPH_H_ #ifndef PRINT_GRAPH_H_
# define PRINT_GRAPH_H_ # define PRINT_GRAPH_H_
void print_graph PARAMS ((void)); void print_graph (void);
#endif /* !PRINT_GRAPH_H_ */ #endif /* !PRINT_GRAPH_H_ */

View File

@@ -40,9 +40,9 @@ typedef struct gram_control_s
/* From the scanner. */ /* From the scanner. */
extern FILE *gram_in; extern FILE *gram_in;
extern int gram__flex_debug; extern int gram__flex_debug;
void scanner_last_string_free PARAMS ((void)); void scanner_last_string_free (void);
void scanner_initialize PARAMS ((void)); void scanner_initialize (void);
void scanner_free PARAMS ((void)); void scanner_free (void);
# define YY_DECL \ # define YY_DECL \
int gram_lex (yystype *yylval, location_t *yylloc, \ int gram_lex (yystype *yylval, location_t *yylloc, \
@@ -68,27 +68,22 @@ extern braced_code_t current_braced_code;
/* From reader.c. */ /* From reader.c. */
void grammar_start_symbol_set PARAMS ((symbol_t *s, location_t l)); void grammar_start_symbol_set (symbol_t *s, location_t l);
void prologue_augment PARAMS ((const char *prologue, location_t location)); void prologue_augment (const char *prologue, location_t location);
void epilogue_set PARAMS ((const char *epilogue, location_t location)); void epilogue_set (const char *epilogue, location_t location);
void grammar_symbol_append PARAMS ((symbol_t *s, location_t l)); void grammar_symbol_append (symbol_t *s, location_t l);
void grammar_rule_begin PARAMS ((symbol_t *lhs, location_t l)); void grammar_rule_begin (symbol_t *lhs, location_t l);
void grammar_rule_end PARAMS ((location_t l)); void grammar_rule_end (location_t l);
void grammar_midrule_action PARAMS ((void)); void grammar_midrule_action (void);
void grammar_current_rule_prec_set PARAMS ((symbol_t *precsym, void grammar_current_rule_prec_set (symbol_t *precsym, location_t l);
location_t l)); void grammar_current_rule_dprec_set (int dprec, location_t l);
void grammar_current_rule_dprec_set PARAMS ((int dprec, void grammar_current_rule_merge_set (const char* name, location_t l);
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, void grammar_current_rule_symbol_append (symbol_t *symbol, location_t l);
location_t l)); void grammar_current_rule_action_append (const char *action, location_t l);
void grammar_current_rule_action_append PARAMS ((const char *action,
location_t l));
extern symbol_list_t *current_rule; extern symbol_list_t *current_rule;
void reader PARAMS ((void)); void reader (void);
void free_merger_functions PARAMS ((void)); void free_merger_functions (void);
extern merger_list *merge_functions; extern merger_list *merge_functions;

View File

@@ -21,9 +21,9 @@
#ifndef REDUCE_H_ #ifndef REDUCE_H_
# define REDUCE_H_ # define REDUCE_H_
void reduce_grammar PARAMS ((void)); void reduce_grammar (void);
void reduce_output PARAMS ((FILE *out)); void reduce_output (FILE *out);
void reduce_free PARAMS ((void)); void reduce_free (void);
extern symbol_number_t nuseless_nonterminals; extern symbol_number_t nuseless_nonterminals;
extern rule_number_t nuseless_productions; extern rule_number_t nuseless_productions;

View File

@@ -33,18 +33,16 @@ typedef relation_nodes_t *relation_t;
/* Report a RELATION that has SIZE vertices. */ /* Report a RELATION that has SIZE vertices. */
void relation_print PARAMS ((relation_t relation, size_t size, void relation_print (relation_t relatio, size_t size, FILE *out);
FILE *out));
/* Compute the transitive closure of the FUNCTION on the RELATION with /* Compute the transitive closure of the FUNCTION on the RELATION with
SIZE vertices. SIZE vertices.
If RELATION (NODE-1, NODE-2) then on exit FUNCTION[NODE-1] was If RELATION (NODE-1, NODE-2) then on exit FUNCTION[NODE-1] was
extended (unioned) with FUNCTION[NODE-2]. */ extended (unioned) with FUNCTION[NODE-2]. */
void relation_digraph PARAMS ((relation_t relation, size_t size, void relation_digraph (relation_t relation, size_t size, bitsetv *function);
bitsetv *function));
/* Destructively transpose *R_ARG, of size N. */ /* 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_ */ #endif /* ! RELATION_H_ */

View File

@@ -24,7 +24,7 @@
%{ %{
#include "system.h" #include "system.h"
#include "files.h" #include "files.h"
int skel_lex PARAMS ((void)); int skel_lex (void);
static int yylineno = 1; static int yylineno = 1;
%} %}

View File

@@ -27,7 +27,7 @@
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#include <stdio.h> #include <stdio.h>
#include <errno.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus #ifdef c_plusplus
@@ -40,15 +40,7 @@
#ifdef __cplusplus #ifdef __cplusplus
#include <stdlib.h> #include <stdlib.h>
#ifndef _WIN32
#include <unistd.h> #include <unistd.h>
#else
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif
#endif
/* Use prototypes in function declarations. */ /* Use prototypes in function declarations. */
#define YY_USE_PROTOS #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. */ Outside of well-formed rules, RULE_LENGTH has an undefined value. */
static int rule_length; static int rule_length;
static void handle_dollar PARAMS ((braced_code_t code_kind, static void handle_dollar (braced_code_t code_kind,
char *cp, location_t location)); char *cp, location_t location);
static void handle_at PARAMS ((braced_code_t code_kind, static void handle_at (braced_code_t code_kind,
char *cp, location_t location)); char *cp, location_t location);
#define SC_COMMENT 1 #define SC_COMMENT 1
@@ -854,7 +846,7 @@ static void handle_at PARAMS ((braced_code_t code_kind,
#define SC_PROLOGUE 7 #define SC_PROLOGUE 7
#define SC_EPILOGUE 8 #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 /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
@@ -954,20 +946,9 @@ YY_MALLOC_DECL
YY_FATAL_ERROR( "input in flex scanner failed" ); \ YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \ result = n; \
} \ } \
else \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
{ \ && ferror( yyin ) ) \
errno=0; \ YY_FATAL_ERROR( "input in flex scanner failed" );
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); \
} \
}
#endif #endif
/* No semi-colon after return; correct usage is to write "yyterminate();" - /* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -1028,7 +1009,7 @@ YY_DECL
/*----------------------------. /*----------------------------.
| Scanning Bison directives. | | Scanning Bison directives. |
`----------------------------*/ `----------------------------*/
#line 1032 "scan-gram.c" #line 1013 "scan-gram.c"
if ( yy_init ) if ( yy_init )
{ {
@@ -1908,7 +1889,7 @@ YY_RULE_SETUP
#line 533 "scan-gram.l" #line 533 "scan-gram.l"
YY_FATAL_ERROR( "flex scanner jammed" ); YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK YY_BREAK
#line 1912 "scan-gram.c" #line 1893 "scan-gram.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
@@ -2472,15 +2453,11 @@ YY_BUFFER_STATE b;
} }
#ifndef _WIN32
#include <unistd.h>
#else
#ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int )); extern int isatty YY_PROTO(( int ));
#endif #endif
#endif #endif
#endif
#ifdef YY_USE_PROTOS #ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )

View File

@@ -87,10 +87,10 @@ static int percent_percent_count = 0;
Outside of well-formed rules, RULE_LENGTH has an undefined value. */ Outside of well-formed rules, RULE_LENGTH has an undefined value. */
static int rule_length; static int rule_length;
static void handle_dollar PARAMS ((braced_code_t code_kind, static void handle_dollar (braced_code_t code_kind,
char *cp, location_t location)); char *cp, location_t location);
static void handle_at PARAMS ((braced_code_t code_kind, static void handle_at (braced_code_t code_kind,
char *cp, location_t location)); char *cp, location_t location);
%} %}
%x SC_COMMENT %x SC_COMMENT

View File

@@ -26,7 +26,7 @@
#include "error.h" #include "error.h"
#include "getargs.h" #include "getargs.h"
#include "files.h" #include "files.h"
int skel_lex PARAMS ((void)); int skel_lex (void);
static int yylineno = 1; static int yylineno = 1;
static char *yyoutname = NULL; static char *yyoutname = NULL;
%} %}

View File

@@ -154,8 +154,7 @@ typedef struct transtion_s
/* Return the state such these TRANSITIONS contain a shift/goto to it on /* Return the state such these TRANSITIONS contain a shift/goto to it on
SYMBOL. Aborts if none found. */ SYMBOL. Aborts if none found. */
struct state_s; struct state_s;
struct state_s *transitions_to PARAMS ((transitions_t *state, struct state_s *transitions_to (transitions_t *state, symbol_number_t s);
symbol_number_t s));
/*-------. /*-------.
@@ -168,7 +167,7 @@ typedef struct errs_s
symbol_t *symbols[1]; symbol_t *symbols[1];
} errs_t; } 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; extern state_t *final_state;
/* Create a new state with ACCESSING_SYMBOL for those items. */ /* Create a new state with ACCESSING_SYMBOL for those items. */
state_t *state_new PARAMS ((symbol_number_t accessing_symbol, state_t *state_new (symbol_number_t accessing_symbol,
size_t core_size, item_number_t *core)); size_t core_size, item_number_t *core);
/* Set the transitions of STATE. */ /* Set the transitions of STATE. */
void state_transitions_set PARAMS ((state_t *state, void state_transitions_set (state_t *state, int num, state_t **transitions);
int num, state_t **transitions));
/* Set the reductions of STATE. */ /* Set the reductions of STATE. */
void state_reductions_set PARAMS ((state_t *state, void state_reductions_set (state_t *state, int num, rule_t **reductions);
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. */ /* Set the errs of STATE. */
void state_errs_set PARAMS ((state_t *state, void state_errs_set (state_t *state, int num, symbol_t **errs);
int num, symbol_t **errs));
/* Print on OUT all the lookaheads such that this STATE wants to /* Print on OUT all the lookaheads such that this STATE wants to
reduce this RULE. */ reduce this RULE. */
void state_rule_lookaheads_print PARAMS ((state_t *state, rule_t *rule, void state_rule_lookaheads_print (state_t *state, rule_t *rule, FILE *out);
FILE *out));
/* Create/destroy the states hash table. */ /* Create/destroy the states hash table. */
void state_hash_new PARAMS ((void)); void state_hash_new (void);
void state_hash_free PARAMS ((void)); void state_hash_free (void);
/* Find the state associated to the CORE, and return it. If it does /* Find the state associated to the CORE, and return it. If it does
not exist yet, return NULL. */ 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. */ /* 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. */ /* All the states, indexed by the state number. */
extern state_t **states; extern state_t **states;
/* Free all the states. */ /* Free all the states. */
void states_free PARAMS ((void)); void states_free (void);
#endif /* !STATE_H_ */ #endif /* !STATE_H_ */

View File

@@ -41,22 +41,22 @@ typedef struct symbol_list_s
/* Create a list containing SYMBOL at LOCATION. */ /* 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. */ /* Prepend SYMBOL at LOCATION to the LIST. */
symbol_list_t * symbol_list_prepend PARAMS ((symbol_list_t *list, symbol_list_t * symbol_list_prepend (symbol_list_t *list,
symbol_t *symbol, symbol_t *symbol,
location_t location)); location_t location);
/* Free the LIST, but not the symbols it contains. */ /* 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. */ /* 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 /* Get the data type (alternative in the union) of the value for
symbol N in rule RULE. */ symbol N in rule RULE. */
char *symbol_list_n_type_name_get PARAMS ((symbol_list_t *rule, char *symbol_list_n_type_name_get (symbol_list_t *rule,
location_t location, int n)); location_t location, int n);
#endif /* !SYMLIST_H_ */ #endif /* !SYMLIST_H_ */

View File

@@ -84,43 +84,41 @@ struct symbol_s
/* Fetch (or create) the symbol associated to KEY. */ /* 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 /* Generate a dummy nonterminal, whose name cannot conflict with the
user's names. */ 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. */ /* Declare the new SYMBOL. Make it an alias of SYMVAL. */
void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval, void symbol_make_alias (symbol_t *symbol, symbol_t *symval,
location_t location)); location_t location);
/* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as /* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as
TYPE_NAME. */ TYPE_NAME. */
void symbol_type_set PARAMS ((symbol_t *symbol, void symbol_type_set (symbol_t *symbol,
char *type_name, location_t location)); char *type_name, location_t location);
/* Set the DESTRUCTOR associated to SYMBOL. */ /* Set the DESTRUCTOR associated to SYMBOL. */
void symbol_destructor_set PARAMS ((symbol_t *symbol, void symbol_destructor_set (symbol_t *symbol,
char *destructor, location_t location)); char *destructor, location_t location);
/* Set the PRINTER associated to SYMBOL. */ /* Set the PRINTER associated to SYMBOL. */
void symbol_printer_set PARAMS ((symbol_t *symbol, void symbol_printer_set (symbol_t *symbol,
char *printer, location_t location)); char *printer, location_t location);
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a /* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */ terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */
void symbol_precedence_set PARAMS ((symbol_t *symbol, void symbol_precedence_set (symbol_t *symbol,
int prec, assoc_t assoc, int prec, assoc_t assoc, location_t location);
location_t location));
/* Set the CLASS associated to SYMBOL. */ /* Set the CLASS associated to SYMBOL. */
void symbol_class_set PARAMS ((symbol_t *symbol, void symbol_class_set (symbol_t *symbol,
symbol_class class, location_t location)); symbol_class class, location_t location);
/* Set the USER_TOKEN_NUMBER associated to SYMBOL. */ /* Set the USER_TOKEN_NUMBER associated to SYMBOL. */
void symbol_user_token_number_set PARAMS ((symbol_t *symbol, void symbol_user_token_number_set (symbol_t *symbol,
int user_number, int user_number, location_t location);
location_t location));
/* Distinguished symbols. AXIOM is the real start symbol, that used /* Distinguished symbols. AXIOM is the real start symbol, that used
@@ -140,24 +138,24 @@ extern location_t startsymbol_location;
/* Create the symbol table. */ /* Create the symbol table. */
void symbols_new PARAMS ((void)); void symbols_new (void);
/* A function to apply to each symbol. */ /* 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 /* Apply PROCESSOR to all the symbols. PROCESSOR must return TRUE: on
FALSE, the processing stops. */ 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. */ /* 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 /* Check that all the symbols are defined. Report any undefined
symbols and consider them nonterminals. */ 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 /* Perform various sanity checks, assign symbol numbers, and set up
TOKEN_TRANSLATIONS. */ TOKEN_TRANSLATIONS. */
void symbols_pack PARAMS ((void)); void symbols_pack (void);
#endif /* !SYMTAB_H_ */ #endif /* !SYMTAB_H_ */

View File

@@ -113,7 +113,7 @@ extern state_number_t *yydefgoto;
extern rule_number_t *yydefact; extern rule_number_t *yydefact;
extern int high; extern int high;
void tables_generate PARAMS ((void)); void tables_generate (void);
void tables_free PARAMS ((void)); void tables_free (void);
#endif /* !TABLES_H_ */ #endif /* !TABLES_H_ */

View File

@@ -992,28 +992,28 @@ struct graph_s
/* Graph typedefs. */ /* Graph typedefs. */
typedef struct graph_s graph_t; typedef struct graph_s graph_t;
void new_graph PARAMS ((graph_t *g)); void new_graph (graph_t *g);
void new_node PARAMS ((node_t *node)); void new_node (node_t *node);
void new_edge PARAMS ((edge_t *edge)); void new_edge (edge_t *edge);
void add_node PARAMS ((graph_t *graph, node_t *node)); void add_node (graph_t *graph, node_t *node);
void add_edge PARAMS ((graph_t *graph, edge_t *edge)); void add_edge (graph_t *graph, edge_t *edge);
void add_colorentry PARAMS ((graph_t *g, int color_idx, int red_cp, void add_colorentry (graph_t *g, int color_idx, int red_cp,
int green_cp, int blue_cp)); int green_cp, int blue_cp);
void add_classname PARAMS ((graph_t *g, int val, const char *name)); void add_classname (graph_t *g, int val, const char *name);
void add_infoname PARAMS ((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 open_node (FILE *fout);
void output_node PARAMS ((node_t *node, FILE *fout)); void output_node (node_t *node, FILE *fout);
void close_node PARAMS ((FILE *fout)); void close_node (FILE *fout);
void open_edge PARAMS ((edge_t *edge, FILE *fout)); void open_edge (edge_t *edge, FILE *fout);
void output_edge PARAMS ((edge_t *edge, FILE *fout)); void output_edge (edge_t *edge, FILE *fout);
void close_edge PARAMS ((FILE *fout)); void close_edge (FILE *fout);
void open_graph PARAMS ((FILE *fout)); void open_graph (FILE *fout);
void output_graph PARAMS ((graph_t *graph, FILE *fout)); void output_graph (graph_t *graph, FILE *fout);
void close_graph PARAMS ((graph_t *graph, FILE *fout)); void close_graph (graph_t *graph, FILE *fout);
#endif /* VCG_H_ */ #endif /* VCG_H_ */