⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flexdef.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 3 页
字号:
extern struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE]; extern struct hash_entry *sctbl[START_COND_HASH_SIZE];extern struct hash_entry *ccltab[CCL_HASH_SIZE];/* Variables for flags: * printstats - if true (-v), dump statistics * syntaxerror - true if a syntax error has been found * eofseen - true if we've seen an eof in the input file * ddebug - if true (-d), make a "debug" scanner * trace - if true (-T), trace processing * nowarn - if true (-w), do not generate warnings * spprdflt - if true (-s), suppress the default rule * interactive - if true (-I), generate an interactive scanner * caseins - if true (-i), generate a case-insensitive scanner * lex_compat - if true (-l), maximize compatibility with AT&T lex * useecs - if true (-Ce flag), use equivalence classes * fulltbl - if true (-Cf flag), don't compress the DFA state table * usemecs - if true (-Cm flag), use meta-equivalence classes * fullspd - if true (-F flag), use Jacobson method of table representation * gen_line_dirs - if true (i.e., no -L flag), generate #line directives * performance_report - if > 0 (i.e., -p flag), generate a report relating *   to scanner performance; if > 1 (-p -p), report on minor performance *   problems, too * backing_up_report - if true (i.e., -b flag), generate "lex.backup" file *   listing backing-up states * C_plus_plus - if true (i.e., -+ flag), generate a C++ scanner class; *   otherwise, a standard C scanner * long_align - if true (-Ca flag), favor long-word alignment. * use_read - if true (-f, -F, or -Cr) then use read() for scanner input; *   otherwise, use fread(). * yytext_is_array - if true (i.e., %array directive), then declare *   yytext as a array instead of a character pointer.  Nice and inefficient. * csize - size of character set for the scanner we're generating; *   128 for 7-bit chars and 256 for 8-bit * yymore_used - if true, yymore() is used in input rules * reject - if true, generate back-up tables for REJECT macro * real_reject - if true, scanner really uses REJECT (as opposed to just *   having "reject" set for variable trailing context) * continued_action - true if this rule's action is to "fall through" to *   the next rule's action (i.e., the '|' action) * yymore_really_used - has a REALLY_xxx value indicating whether a *   %used or %notused was used with yymore() * reject_really_used - same for REJECT */extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;extern int interactive, caseins, lex_compat, useecs, fulltbl, usemecs;extern int fullspd, gen_line_dirs, performance_report, backing_up_report;extern int C_plus_plus, long_align, use_read, yytext_is_array, csize;extern int yymore_used, reject, real_reject, continued_action;#define REALLY_NOT_DETERMINED 0#define REALLY_USED 1#define REALLY_NOT_USED 2extern int yymore_really_used, reject_really_used;/* Variables used in the flex input routines: * datapos - characters on current output line * dataline - number of contiguous lines of data in current data * 	statement.  Used to generate readable -f output * linenum - current input line number * skelfile - the skeleton file * skel - compiled-in skeleton array * skel_ind - index into "skel" array, if skelfile is nil * yyin - input file * backing_up_file - file to summarize backing-up states to * infilename - name of input file * input_files - array holding names of input files * num_input_files - size of input_files array * program_name - name with which program was invoked  * * action_array - array to hold the rule actions * action_size - size of action_array * defs1_offset - index where the user's section 1 definitions start *	in action_array * prolog_offset - index where the prolog starts in action_array * action_offset - index where the non-prolog starts in action_array * action_index - index where the next action should go, with respect * 	to "action_array" */extern int datapos, dataline, linenum;extern FILE *skelfile, *yyin, *backing_up_file;extern char *skel[];extern int skel_ind;extern char *infilename;extern char **input_files;extern int num_input_files;extern char *program_name;extern char *action_array;extern int action_size;extern int defs1_offset, prolog_offset, action_offset, action_index;/* Variables for stack of states having only one out-transition: * onestate - state number * onesym - transition symbol * onenext - target state * onedef - default base entry * onesp - stack pointer */extern int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];extern int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;/* Variables for nfa machine data: * current_mns - current maximum on number of NFA states * num_rules - number of the last accepting state; also is number of * 	rules created so far * num_eof_rules - number of <<EOF>> rules * default_rule - number of the default rule * current_max_rules - current maximum number of rules * lastnfa - last nfa state number created * firstst - physically the first state of a fragment * lastst - last physical state of fragment * finalst - last logical state of fragment * transchar - transition character * trans1 - transition state * trans2 - 2nd transition state for epsilons * accptnum - accepting number * assoc_rule - rule associated with this NFA state (or 0 if none) * state_type - a STATE_xxx type identifying whether the state is part * 	of a normal rule, the leading state in a trailing context * 	rule (i.e., the state which marks the transition from * 	recognizing the text-to-be-matched to the beginning of * 	the trailing context), or a subsequent state in a trailing * 	context rule * rule_type - a RULE_xxx type identifying whether this a ho-hum * 	normal rule or one which has variable head & trailing * 	context * rule_linenum - line number associated with rule * rule_useful - true if we've determined that the rule can be matched */extern int current_mns, num_rules, num_eof_rules, default_rule;extern int current_max_rules, lastnfa;extern int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;extern int *accptnum, *assoc_rule, *state_type;extern int *rule_type, *rule_linenum, *rule_useful;/* Different types of states; values are useful as masks, as well, for * routines like check_trailing_context(). */#define STATE_NORMAL 0x1#define STATE_TRAILING_CONTEXT 0x2/* Global holding current type of state we're making. */extern int current_state_type;/* Different types of rules. */#define RULE_NORMAL 0#define RULE_VARIABLE 1/* True if the input rules include a rule with both variable-length head * and trailing context, false otherwise. */extern int variable_trailing_context_rules;/* Variables for protos: * numtemps - number of templates created * numprots - number of protos created * protprev - backlink to a more-recently used proto * protnext - forward link to a less-recently used proto * prottbl - base/def table entry for proto * protcomst - common state of proto * firstprot - number of the most recently used proto * lastprot - number of the least recently used proto * protsave contains the entire state array for protos */extern int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];extern int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];/* Variables for managing equivalence classes: * numecs - number of equivalence classes * nextecm - forward link of Equivalence Class members * ecgroup - class number or backward link of EC members * nummecs - number of meta-equivalence classes (used to compress *   templates) * tecfwd - forward link of meta-equivalence classes members * tecbck - backward link of MEC's *//* Reserve enough room in the equivalence class arrays so that we * can use the CSIZE'th element to hold equivalence class information * for the NUL character.  Later we'll move this information into * the 0th element. */extern int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs;/* Meta-equivalence classes are indexed starting at 1, so it's possible * that they will require positions from 1 .. CSIZE, i.e., CSIZE + 1 * slots total (since the arrays are 0-based).  nextecm[] and ecgroup[] * don't require the extra position since they're indexed from 1 .. CSIZE - 1. */extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1];/* Variables for start conditions: * lastsc - last start condition created * current_max_scs - current limit on number of start conditions * scset - set of rules active in start condition * scbol - set of rules active only at the beginning of line in a s.c. * scxclu - true if start condition is exclusive * sceof - true if start condition has EOF rule * scname - start condition name * actvsc - stack of active start conditions for the current rule; * 	a negative entry means that the start condition is *not* *	active for the current rule.  Start conditions may appear *	multiple times on the stack; the entry for it closest *	to the top of the stack (i.e., actvsc[actvp]) is the *	one to use.  Others are present from "<sc>{" scoping *	constructs. */extern int lastsc, current_max_scs, *scset, *scbol, *scxclu, *sceof, *actvsc;extern char **scname;/* Variables for dfa machine data: * current_max_dfa_size - current maximum number of NFA states in DFA * current_max_xpairs - current maximum number of non-template xtion pairs * current_max_template_xpairs - current maximum number of template pairs * current_max_dfas - current maximum number DFA states * lastdfa - last dfa state number created * nxt - state to enter upon reading character * chk - check value to see if "nxt" applies * tnxt - internal nxt table for templates * base - offset into "nxt" for given state * def - where to go if "chk" disallows "nxt" entry * nultrans - NUL transition for each state * NUL_ec - equivalence class of the NUL character * tblend - last "nxt/chk" table entry being used * firstfree - first empty entry in "nxt/chk" table * dss - nfa state set for each dfa * dfasiz - size of nfa state set for each dfa * dfaacc - accepting set for each dfa state (if using REJECT), or accepting *	number, if not * accsiz - size of accepting set for each dfa state * dhash - dfa state hash value * numas - number of DFA accepting states created; note that this *	is not necessarily the same value as num_rules, which is the analogous *	value for the NFA * numsnpairs - number of state/nextstate transition pairs * jambase - position in base/def where the default jam table starts * jamstate - state number corresponding to "jam" state * end_of_buffer_state - end-of-buffer dfa state number */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 *accsiz, *dhash, numas;extern int numsnpairs, jambase, jamstate;extern int end_of_buffer_state;/* Variables for ccl information: * lastccl - ccl index of the last created ccl * current_maxccls - current limit on the maximum number of unique ccl's * cclmap - maps a ccl index to its set pointer * ccllen - gives the length of a ccl * cclng - true for a given ccl if the ccl is negated * cclreuse - counts how many times a ccl is re-used * current_max_ccl_tbl_size - current limit on number of characters needed *	to represent the unique ccl's * ccltbl - holds the characters in each ccl - indexed by cclmap */extern int lastccl, current_maxccls, *cclmap, *ccllen, *cclng, cclreuse;extern int current_max_ccl_tbl_size;extern Char *ccltbl;/* Variables for miscellaneous information: * nmstr - last NAME scanned by the scanner * sectnum - section number currently being parsed * nummt - number of empty nxt/chk table entries * hshcol - number of hash collisions detected by snstods * dfaeql - number of times a newly created dfa was equal to an old one * numeps - number of epsilon NFA states created * eps2 - number of epsilon states which have 2 out-transitions * num_reallocs - number of times it was necessary to realloc() a group *	  of arrays * tmpuses - number of DFA states that chain to templates * totnst - total number of NFA states used to make DFA states * peakpairs - peak number of transition pairs we had to store internally * numuniq - number of unique transitions

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -