refactor: Make functions in gen.c static...

... except make_tables() which is called from outside gen.c.
This commit is contained in:
Explorer09 2017-10-27 22:34:22 +08:00 committed by Will Estes
parent 1f27fff775
commit 3adb336992
3 changed files with 6 additions and 24 deletions

View File

@ -799,8 +799,6 @@ extern void mkechar(int, int[], int[]);
/* from file gen.c */
extern void do_indent(void); /* indent to the current level */
/* Set a conditional amd make it visible in generated code */
extern void visible_define (const char *);
@ -810,21 +808,6 @@ extern void visible_define_str (const char *, const char *);
/* This time the value part is an int */
extern void visible_define_int (const char *, const int);
/* Generate full speed compressed transition table. */
extern void genctbl(void);
/* generate full transition table */
extern void genftbl(void);
/* Generate data statements for the transition tables. */
extern void gentabs(void);
/* Write out a formatted string at the current indentation level. */
extern void indent_put2s(const char *, const char *);
/* Write out a string + newline at the current indentation level. */
extern void indent_puts(const char *);
/* generate transition tables */
extern void make_tables(void);

View File

@ -43,7 +43,7 @@ struct yy_trans_info {int32_t yy_verify; int32_t yy_nxt;};
/* declare functions that have forward references */
void genecs(void);
static void genecs(void);
struct packtype_t *optimize_pack(size_t sz)
{
@ -243,7 +243,7 @@ static struct yytbl_data *mkssltbl (void)
/* genctbl - generates full speed compressed transition table */
void genctbl (void)
static void genctbl(void)
{
int i;
int end_of_buffer_action = num_rules + 1;
@ -363,7 +363,7 @@ static struct yytbl_data *mkecstbl (void)
/* Generate equivalence-class tables. */
void genecs (void)
static void genecs(void)
{
int ch, row;
int numrows;
@ -403,7 +403,7 @@ void genecs (void)
* you should call mkecstbl() after this.
*/
struct yytbl_data *mkftbl (void)
static struct yytbl_data *mkftbl(void)
{
int i;
int end_of_buffer_action = num_rules + 1;
@ -437,7 +437,7 @@ struct yytbl_data *mkftbl (void)
/* genftbl - generate full transition table */
void genftbl (void)
static void genftbl(void)
{
int i;
int end_of_buffer_action = num_rules + 1;
@ -474,7 +474,7 @@ void genftbl (void)
/* gentabs - generate data statements for the transition tables */
void gentabs (void)
static void gentabs(void)
{
int sz, i, j, k, *accset, nacc, *acc_array, total_states;
int end_of_buffer_action = num_rules + 1;

View File

@ -72,7 +72,6 @@ int yytbl_hdr_fwrite (struct yytbl_writer *wr,
const struct yytbl_hdr *th);
int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td);
void yytbl_data_compress (struct yytbl_data *tbl);
struct yytbl_data *mkftbl (void);
#ifdef __cplusplus