summaryrefslogtreecommitdiff
path: root/flexdef.h
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2002-08-27 18:07:19 +0000
committerWill Estes <wlestes@users.sourceforge.net>2002-08-27 18:07:19 +0000
commit3e58ded5164af663649c86ab3f273310c2c57d37 (patch)
treeb9c93a6215354a21740a2f52eb57a4a1192f5f6b /flexdef.h
parent1dc652849525bdce070d741fbce3c0cc40c81ed2 (diff)
ran the indent target; commit the results
Diffstat (limited to 'flexdef.h')
-rw-r--r--flexdef.h309
1 files changed, 159 insertions, 150 deletions
diff --git a/flexdef.h b/flexdef.h
index c1e8f2b..6a47bac 100644
--- a/flexdef.h
+++ b/flexdef.h
@@ -194,10 +194,10 @@
*/
#define NIL 0
-#define JAM -1 /* to mark a missing DFA transition */
+#define JAM -1 /* to mark a missing DFA transition */
#define NO_TRANSITION NIL
-#define UNIQUE -1 /* marks a symbol as an e.c. representative */
-#define INFINITY -1 /* for x{5,} constructions */
+#define UNIQUE -1 /* marks a symbol as an e.c. representative */
+#define INFINITY -1 /* for x{5,} constructions */
#define INITIAL_MAX_CCLS 100 /* max number of unique character classes */
#define MAX_CCLS_INCREMENT 100
@@ -215,7 +215,7 @@
#define INITIAL_MAX_DFAS 1000 /* default maximum number of dfa states */
#define MAX_DFAS_INCREMENT 1000
-#define JAMSTATE -32766 /* marks a reference to the state that always jams */
+#define JAMSTATE -32766 /* marks a reference to the state that always jams */
/* Maximum number of NFA states. */
#define MAXIMUM_MNS 31999
@@ -240,7 +240,7 @@
#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */
#define ONE_STACK_SIZE 500 /* stack of states with only one out-transition */
-#define SAME_TRANS -1 /* transition is the same as "default" entry for state */
+#define SAME_TRANS -1 /* transition is the same as "default" entry for state */
/* The following percentages are used to tune table compression:
@@ -294,7 +294,7 @@
*/
#define PROT_SAVE_SIZE 2000
-#define MSP 50 /* maximum number of saved protos (protos on the proto queue) */
+#define MSP 50 /* maximum number of saved protos (protos on the proto queue) */
/* Maximum number of out-transitions a state can have that we'll rummage
* around through the interior of the internal fast table looking for a
@@ -369,7 +369,9 @@
* reject_really_used - same for REJECT
*/
-extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
+extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn,
+
+ spprdflt;
extern int interactive, caseins, lex_compat, posix_compat, do_yylineno;
extern int useecs, fulltbl, usemecs, fullspd;
extern int gen_line_dirs, performance_report, backing_up_report;
@@ -384,9 +386,9 @@ extern int yymore_used, reject, real_reject, continued_action, in_rule;
* tablesfilename - filename for external tables
* tablesout - FILE stream for external tables
*/
-extern bool tablesext, tablestoggle;
-extern char* tablesfilename;
-extern FILE* tablesout;
+extern bool tablesext, tablestoggle;
+extern char *tablesfilename;
+extern FILE *tablesout;
extern int yymore_really_used, reject_really_used;
@@ -603,12 +605,13 @@ extern char **scname;
extern int current_max_dfa_size, current_max_xpairs;
extern int current_max_template_xpairs, current_max_dfas;
extern int lastdfa, *nxt, *chk, *tnxt;
-extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
-extern union dfaacc_union
- {
- int *dfaacc_set;
- int dfaacc_state;
- } *dfaacc;
+extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss,
+
+ *dfasiz;
+extern union dfaacc_union {
+ int *dfaacc_set;
+ int dfaacc_state;
+} *dfaacc;
extern int *accsiz, *dhash, numas;
extern int numsnpairs, jambase, jamstate;
extern int end_of_buffer_state;
@@ -655,12 +658,12 @@ extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
extern int num_backing_up, bol_needed;
-void *allocate_array PROTO((int, size_t));
-void *reallocate_array PROTO((void*, int, size_t));
+void *allocate_array PROTO ((int, size_t));
+void *reallocate_array PROTO ((void *, int, size_t));
-void *flex_alloc PROTO((size_t));
-void *flex_realloc PROTO((void*, size_t));
-void flex_free PROTO((void*));
+void *flex_alloc PROTO ((size_t));
+void *flex_realloc PROTO ((void *, size_t));
+void flex_free PROTO ((void *));
#define allocate_integer_array(size) \
(int *) allocate_array( size, sizeof( int ) )
@@ -718,352 +721,357 @@ extern int yylval;
/* from file ccl.c */
-extern void ccladd PROTO((int, int)); /* add a single character to a ccl */
-extern int cclinit PROTO((void)); /* make an empty ccl */
-extern void cclnegate PROTO((int)); /* negate a ccl */
+extern void ccladd PROTO ((int, int)); /* add a single character to a ccl */
+extern int cclinit PROTO ((void)); /* make an empty ccl */
+extern void cclnegate PROTO ((int)); /* negate a ccl */
/* List the members of a set of characters in CCL form. */
-extern void list_character_set PROTO((FILE*, int[]));
+extern void list_character_set PROTO ((FILE *, int[]));
/* from file dfa.c */
/* Check a DFA state for backing up. */
-extern void check_for_backing_up PROTO((int, int[]));
+extern void check_for_backing_up PROTO ((int, int[]));
/* Check to see if NFA state set constitutes "dangerous" trailing context. */
-extern void check_trailing_context PROTO((int*, int, int*, int));
+extern void check_trailing_context PROTO ((int *, int, int *, int));
/* Construct the epsilon closure of a set of ndfa states. */
-extern int *epsclosure PROTO((int*, int*, int[], int*, int*));
+extern int *epsclosure PROTO ((int *, int *, int[], int *, int *));
/* Increase the maximum number of dfas. */
-extern void increase_max_dfas PROTO((void));
+extern void increase_max_dfas PROTO ((void));
-extern void ntod PROTO((void)); /* convert a ndfa to a dfa */
+extern void ntod PROTO ((void)); /* convert a ndfa to a dfa */
/* Converts a set of ndfa states into a dfa state. */
-extern int snstods PROTO((int[], int, int[], int, int, int*));
+extern int snstods PROTO ((int[], int, int[], int, int, int *));
/* from file ecs.c */
/* Convert character classes to set of equivalence classes. */
-extern void ccl2ecl PROTO((void));
+extern void ccl2ecl PROTO ((void));
/* Associate equivalence class numbers with class members. */
-extern int cre8ecs PROTO((int[], int[], int));
+extern int cre8ecs PROTO ((int[], int[], int));
/* Update equivalence classes based on character class transitions. */
-extern void mkeccl PROTO((Char[], int, int[], int[], int, int));
+extern void mkeccl PROTO ((Char[], int, int[], int[], int, int));
/* Create equivalence class for single character. */
-extern void mkechar PROTO((int, int[], int[]));
+extern void mkechar PROTO ((int, int[], int[]));
/* from file gen.c */
-extern void do_indent PROTO((void)); /* indent to the current level */
+extern void do_indent PROTO ((void)); /* indent to the current level */
/* Generate the code to keep backing-up information. */
-extern void gen_backing_up PROTO((void));
+extern void gen_backing_up PROTO ((void));
/* Generate the code to perform the backing up. */
-extern void gen_bu_action PROTO((void));
+extern void gen_bu_action PROTO ((void));
/* Generate full speed compressed transition table. */
-extern void genctbl PROTO((void));
+extern void genctbl PROTO ((void));
/* Generate the code to find the action number. */
-extern void gen_find_action PROTO((void));
+extern void gen_find_action PROTO ((void));
-extern void genftbl PROTO((void)); /* generate full transition table */
+extern void genftbl PROTO ((void)); /* generate full transition table */
/* Generate the code to find the next compressed-table state. */
-extern void gen_next_compressed_state PROTO((char*));
+extern void gen_next_compressed_state PROTO ((char *));
/* Generate the code to find the next match. */
-extern void gen_next_match PROTO((void));
+extern void gen_next_match PROTO ((void));
/* Generate the code to find the next state. */
-extern void gen_next_state PROTO((int));
+extern void gen_next_state PROTO ((int));
/* Generate the code to make a NUL transition. */
-extern void gen_NUL_trans PROTO((void));
+extern void gen_NUL_trans PROTO ((void));
/* Generate the code to find the start state. */
-extern void gen_start_state PROTO((void));
+extern void gen_start_state PROTO ((void));
/* Generate data statements for the transition tables. */
-extern void gentabs PROTO((void));
+extern void gentabs PROTO ((void));
/* Write out a formatted string at the current indentation level. */
-extern void indent_put2s PROTO((const char *, const char *));
+extern void indent_put2s PROTO ((const char *, const char *));
/* Write out a string + newline at the current indentation level. */
-extern void indent_puts PROTO((const char *));
+extern void indent_puts PROTO ((const char *));
-extern void make_tables PROTO((void)); /* generate transition tables */
+extern void make_tables PROTO ((void)); /* generate transition tables */
/* from file main.c */
-extern void check_options PROTO((void));
-extern void flexend PROTO((int));
-extern void usage PROTO((void));
+extern void check_options PROTO ((void));
+extern void flexend PROTO ((int));
+extern void usage PROTO ((void));
/* from file misc.c */
/* Add a #define to the action file. */
-extern void action_define PROTO(( const char *defname, int value ));
+extern void action_define PROTO ((const char *defname, int value));
/* Add the given text to the stored actions. */
-extern void add_action PROTO(( char *new_text ));
+extern void add_action PROTO ((char *new_text));
/* True if a string is all lower case. */
-extern int all_lower PROTO((register char *));
+extern int all_lower PROTO ((register char *));
/* True if a string is all upper case. */
-extern int all_upper PROTO((register char *));
+extern int all_upper PROTO ((register char *));
/* Bubble sort an integer array. */
-extern void bubble PROTO((int [], int));
+extern void bubble PROTO ((int[], int));
/* Check a character to make sure it's in the expected range. */
-extern void check_char PROTO((int c));
+extern void check_char PROTO ((int c));
/* Replace upper-case letter to lower-case. */
-extern Char clower PROTO((int));
+extern Char clower PROTO ((int));
/* Returns a dynamically allocated copy of a string. */
-extern char *copy_string PROTO((register const char *));
+extern char *copy_string PROTO ((register const char *));
/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
-extern Char *copy_unsigned_string PROTO((register Char *));
+extern Char *copy_unsigned_string PROTO ((register Char *));
/* Shell sort a character array. */
-extern void cshell PROTO((Char [], int, int));
+extern void cshell PROTO ((Char[], int, int));
/* Finish up a block of data declarations. */
-extern void dataend PROTO((void));
+extern void dataend PROTO ((void));
/* Flush generated data statements. */
-extern void dataflush PROTO((void));
+extern void dataflush PROTO ((void));
/* Report an error message and terminate. */
-extern void flexerror PROTO((const char *));
+extern void flexerror PROTO ((const char *));
/* Report a fatal error message and terminate. */
-extern void flexfatal PROTO((const char *));
+extern void flexfatal PROTO ((const char *));
/* Convert a hexadecimal digit string to an integer value. */
-extern int htoi PROTO((Char[]));
+extern int htoi PROTO ((Char[]));
/* Report an error message formatted with one integer argument. */
-extern void lerrif PROTO((const char *, int));
+extern void lerrif PROTO ((const char *, int));
/* Report an error message formatted with one string argument. */
-extern void lerrsf PROTO((const char *, const char *));
+extern void lerrsf PROTO ((const char *, const char *));
/* Spit out a "#line" statement. */
-extern void line_directive_out PROTO((FILE*, int));
+extern void line_directive_out PROTO ((FILE *, int));
/* Mark the current position in the action array as the end of the section 1
* user defs.
*/
-extern void mark_defs1 PROTO((void));
+extern void mark_defs1 PROTO ((void));
/* Mark the current position in the action array as the end of the prolog. */
-extern void mark_prolog PROTO((void));
+extern void mark_prolog PROTO ((void));
/* Generate a data statment for a two-dimensional array. */
-extern void mk2data PROTO((int));
+extern void mk2data PROTO ((int));
-extern void mkdata PROTO((int)); /* generate a data statement */
+extern void mkdata PROTO ((int)); /* generate a data statement */
/* Return the integer represented by a string of digits. */
-extern int myctoi PROTO((const char *));
+extern int myctoi PROTO ((const char *));
/* Return character corresponding to escape sequence. */
-extern Char myesc PROTO((Char[]));
+extern Char myesc PROTO ((Char[]));
/* Convert an octal digit string to an integer value. */
-extern int otoi PROTO((Char [] ));
+extern int otoi PROTO ((Char[]));
/* Output a (possibly-formatted) string to the generated scanner. */
-extern void out PROTO((const char *));
-extern void out_dec PROTO((const char *, int));
-extern void out_dec2 PROTO((const char *, int, int));
-extern void out_hex PROTO((const char *, unsigned int));
-extern void out_line_count PROTO((const char *));
-extern void out_str PROTO((const char *, const char *));
+extern void out PROTO ((const char *));
+extern void out_dec PROTO ((const char *, int));
+extern void out_dec2 PROTO ((const char *, int, int));
+extern void out_hex PROTO ((const char *, unsigned int));
+extern void out_line_count PROTO ((const char *));
+extern void out_str PROTO ((const char *, const char *));
extern void out_str3
- PROTO((const char *, const char *, const char *, const char *));
-extern void out_str_dec PROTO((const char *, const char *, int));
-extern void outc PROTO((int));
-extern void outn PROTO((const char *));
+PROTO ((const char *, const char *, const char *, const char *));
+extern void out_str_dec PROTO ((const char *, const char *, int));
+extern void outc PROTO ((int));
+extern void outn PROTO ((const char *));
/* Return a printable version of the given character, which might be
* 8-bit.
*/
-extern char *readable_form PROTO((int));
+extern char *readable_form PROTO ((int));
/* Write out one section of the skeleton file. */
-extern void skelout PROTO((void));
+extern void skelout PROTO ((void));
/* Output a yy_trans_info structure. */
-extern void transition_struct_out PROTO((int, int));
+extern void transition_struct_out PROTO ((int, int));
/* Only needed when using certain broken versions of bison to build parse.c. */
-extern void *yy_flex_xmalloc PROTO(( int ));
+extern void *yy_flex_xmalloc PROTO ((int));
/* Set a region of memory to 0. */
-extern void zero_out PROTO((char *, size_t));
+extern void zero_out PROTO ((char *, size_t));
/* from file nfa.c */
/* Add an accepting state to a machine. */
-extern void add_accept PROTO((int, int));
+extern void add_accept PROTO ((int, int));
/* Make a given number of copies of a singleton machine. */
-extern int copysingl PROTO((int, int));
+extern int copysingl PROTO ((int, int));
/* Debugging routine to write out an nfa. */
-extern void dumpnfa PROTO((int));
+extern void dumpnfa PROTO ((int));
/* Finish up the processing for a rule. */
-extern void finish_rule PROTO((int, int, int, int, int));
+extern void finish_rule PROTO ((int, int, int, int, int));
/* Connect two machines together. */
-extern int link_machines PROTO((int, int));
+extern int link_machines PROTO ((int, int));
/* Mark each "beginning" state in a machine as being a "normal" (i.e.,
* not trailing context associated) state.
*/
-extern void mark_beginning_as_normal PROTO((register int));
+extern void mark_beginning_as_normal PROTO ((register int));
/* Make a machine that branches to two machines. */
-extern int mkbranch PROTO((int, int));
+extern int mkbranch PROTO ((int, int));
-extern int mkclos PROTO((int)); /* convert a machine into a closure */
-extern int mkopt PROTO((int)); /* make a machine optional */
+extern int mkclos PROTO ((int)); /* convert a machine into a closure */
+extern int mkopt PROTO ((int)); /* make a machine optional */
/* Make a machine that matches either one of two machines. */
-extern int mkor PROTO((int, int));
+extern int mkor PROTO ((int, int));
/* Convert a machine into a positive closure. */
-extern int mkposcl PROTO((int));
+extern int mkposcl PROTO ((int));
-extern int mkrep PROTO((int, int, int)); /* make a replicated machine */
+extern int mkrep PROTO ((int, int, int)); /* make a replicated machine */
/* Create a state with a transition on a given symbol. */
-extern int mkstate PROTO((int));
+extern int mkstate PROTO ((int));
-extern void new_rule PROTO((void)); /* initialize for a new rule */
+extern void new_rule PROTO ((void)); /* initialize for a new rule */
/* from file parse.y */
/* Build the "<<EOF>>" action for the active start conditions. */
-extern void build_eof_action PROTO((void));
+extern void build_eof_action PROTO ((void));
/* Write out a message formatted with one string, pinpointing its location. */
-extern void format_pinpoint_message PROTO((const char *, const char *));
+extern void format_pinpoint_message PROTO ((const char *, const char *));
/* Write out a message, pinpointing its location. */
-extern void pinpoint_message PROTO((const char *));
+extern void pinpoint_message PROTO ((const char *));
/* Write out a warning, pinpointing it at the given line. */
-extern void line_warning PROTO(( const char *, int ));
+extern void line_warning PROTO ((const char *, int));
/* Write out a message, pinpointing it at the given line. */
-extern void line_pinpoint PROTO(( const char *, int ));
+extern void line_pinpoint PROTO ((const char *, int));
/* Report a formatted syntax error. */
-extern void format_synerr PROTO((const char *, const char *));
-extern void synerr PROTO((const char *)); /* report a syntax error */
-extern void format_warn PROTO((const char *, const char *));
-extern void warn PROTO((const char *)); /* report a warning */
-extern void yyerror PROTO((const char *)); /* report a parse error */
-extern int yyparse PROTO((void)); /* the YACC parser */
+extern void format_synerr PROTO ((const char *, const char *));
+extern void synerr PROTO ((const char *)); /* report a syntax error */
+extern void format_warn PROTO ((const char *, const char *));
+extern void warn PROTO ((const char *)); /* report a warning */
+extern void yyerror PROTO ((const char *)); /* report a parse error */
+extern int yyparse PROTO ((void)); /* the YACC parser */
/* from file scan.l */
/* The Flex-generated scanner for flex. */
-extern int flexscan PROTO((void));
+extern int flexscan PROTO ((void));
/* Open the given file (if NULL, stdin) for scanning. */
-extern void set_input_file PROTO((char*));
+extern void set_input_file PROTO ((char *));
/* Wrapup a file in the lexical analyzer. */
-extern int yywrap PROTO((void));
+extern int yywrap PROTO ((void));
/* from file sym.c */
/* Save the text of a character class. */
-extern void cclinstal PROTO ((Char [], int));
+extern void cclinstal PROTO ((Char[], int));
/* Lookup the number associated with character class. */
-extern int ccllookup PROTO((Char []));
+extern int ccllookup PROTO ((Char[]));
-extern void ndinstal PROTO((const char *, Char[])); /* install a name definition */
-extern Char *ndlookup PROTO((const char *)); /* lookup a name definition */
+extern void ndinstal PROTO ((const char *, Char[])); /* install a name definition */
+extern Char *ndlookup PROTO ((const char *)); /* lookup a name definition */
/* Increase maximum number of SC's. */
-extern void scextend PROTO((void));
-extern void scinstal PROTO((const char *, int)); /* make a start condition */
+extern void scextend PROTO ((void));
+extern void scinstal PROTO ((const char *, int)); /* make a start condition */
/* Lookup the number associated with a start condition. */
-extern int sclookup PROTO((const char *));
+extern int sclookup PROTO ((const char *));
/* from file tblcmp.c */
/* Build table entries for dfa state. */
-extern void bldtbl PROTO((int[], int, int, int, int));
+extern void bldtbl PROTO ((int[], int, int, int, int));
+
+extern void cmptmps PROTO ((void)); /* compress template table entries */
+extern void expand_nxt_chk PROTO ((void)); /* increase nxt/chk arrays */
-extern void cmptmps PROTO((void)); /* compress template table entries */
-extern void expand_nxt_chk PROTO((void)); /* increase nxt/chk arrays */
/* Finds a space in the table for a state to be placed. */
-extern int find_table_space PROTO((int*, int));
-extern void inittbl PROTO((void)); /* initialize transition tables */
+extern int find_table_space PROTO ((int *, int));
+extern void inittbl PROTO ((void)); /* initialize transition tables */
+
/* Make the default, "jam" table entries. */
-extern void mkdeftbl PROTO((void));
+extern void mkdeftbl PROTO ((void));
/* Create table entries for a state (or state fragment) which has
* only one out-transition.
*/
-extern void mk1tbl PROTO((int, int, int, int));
+extern void mk1tbl PROTO ((int, int, int, int));
/* Place a state into full speed transition table. */
-extern void place_state PROTO((int*, int, int));
+extern void place_state PROTO ((int *, int, int));
/* Save states with only one out-transition to be processed later. */
-extern void stack1 PROTO((int, int, int, int));
+extern void stack1 PROTO ((int, int, int, int));
/* from file yylex.c */
-extern int yylex PROTO((void));
+extern int yylex PROTO ((void));
/* A growable array. See buf.c. */
struct Buf {
- void * elts; /* elements. */
- int nelts; /* number of elements. */
- size_t elt_size; /* in bytes. */
- int nmax; /* max capacity of elements. */
+ void *elts; /* elements. */
+ int nelts; /* number of elements. */
+ size_t elt_size; /* in bytes. */
+ int nmax; /* max capacity of elements. */
};
-extern void buf_init PROTO((struct Buf* buf, size_t elem_size));
-extern void buf_destroy PROTO((struct Buf* buf));
-extern struct Buf* buf_append PROTO((struct Buf* buf, const void* ptr, int n_elem));
-extern struct Buf* buf_strappend PROTO((struct Buf*, const char* str));
-extern struct Buf* buf_strnappend PROTO((struct Buf*, const char* str, int nchars));
-extern struct Buf* buf_strdefine PROTO((struct Buf* buf, const char* str, const char* def));
+extern void buf_init PROTO ((struct Buf * buf, size_t elem_size));
+extern void buf_destroy PROTO ((struct Buf * buf));
+extern struct Buf *buf_append
+PROTO ((struct Buf * buf, const void *ptr, int n_elem));
+extern struct Buf *buf_strappend PROTO ((struct Buf *, const char *str));
+extern struct Buf *buf_strnappend
+PROTO ((struct Buf *, const char *str, int nchars));
+extern struct Buf *buf_strdefine
+PROTO ((struct Buf * buf, const char *str, const char *def));
/* a string buffer for #define's generated by user-options on cmd line. */
extern struct Buf userdef_buf;
@@ -1077,14 +1085,15 @@ extern struct Buf defs_buf;
/* For setjmp/longjmp (instead of calling exit(2)). Linkage in main.c */
extern jmp_buf flex_main_jmp_buf;
+
#define FLEX_EXIT(status) longjmp(flex_main_jmp_buf,(status)+1)
/* Removes all \n and \r chars from tail of str. returns str. */
-extern char* chomp(char* str);
+extern char *chomp (char *str);
/* Tables serialization API declarations. */
#include "tables_shared.h"
-struct yytbl_data * yytbl_data_create (enum yytbl_id id);
+struct yytbl_data *yytbl_data_create (enum yytbl_id id);
struct yytbl_data *mkftbl (void);