Go to the source code of this file.
|
int | dupmachine (int) |
|
void | mkxtion (int, int) |
|
void | add_accept (int mach, int accepting_number) |
|
int | copysingl (int singl, int num) |
|
void | dumpnfa (int state1) |
|
void | finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt) |
|
int | link_machines (int first, int last) |
|
void | mark_beginning_as_normal (int mach) |
|
int | mkbranch (int first, int second) |
|
int | mkclos (int state) |
|
int | mkopt (int mach) |
|
int | mkor (int first, int second) |
|
int | mkposcl (int state) |
|
int | mkrep (int mach, int lb, int ub) |
|
int | mkstate (int sym) |
|
void | new_rule (void) |
|
void add_accept |
( |
int |
mach, |
|
|
int |
accepting_number |
|
) |
| |
Definition at line 55 of file nfa.c.
int link_machines(int first, int last)
int copysingl |
( |
int |
singl, |
|
|
int |
num |
|
) |
| |
Definition at line 86 of file nfa.c.
92 for ( i = 1; i <= num; ++
i )
void copy(PVValueArray< T > &pvFrom, size_t fromOffset, size_t fromStride, PVValueArray< T > &pvTo, size_t toOffset, size_t toStride, size_t count)
Copy a subarray from one scalar array to another.
int link_machines(int first, int last)
void dumpnfa |
( |
int |
state1 | ) |
|
Definition at line 106 of file nfa.c.
108 int sym, tsp1, tsp2, anum, ns;
110 fprintf(
stderr,
"\n\n********** beginning dump of nfa with start state %d\n",
120 for ( ns = 1; ns <=
lastnfa; ++ns )
122 fprintf(
stderr,
"state # %4d\t", ns );
129 fprintf(
stderr,
"%3d: %4d, %4d", sym, tsp1, tsp2 );
132 fprintf(
stderr,
" [%d]", anum );
137 fprintf(
stderr,
"********** end of dump\n" );
int dupmachine |
( |
int |
mach | ) |
|
Definition at line 158 of file nfa.c.
160 int i, init, state_offset;
164 for ( i =
firstst[mach]; i <= last; ++
i )
180 flexfatal(
"empty machine in dupmachine()" );
182 state_offset = state - i + 1;
184 init = mach + state_offset;
void finish_rule |
( |
int |
mach, |
|
|
int |
variable_trail_rule, |
|
|
int |
headcnt, |
|
|
int |
trailcnt |
|
) |
| |
Definition at line 209 of file nfa.c.
226 if ( variable_trail_rule )
231 fprintf(
stderr,
"Variable trailing context rule at line %d\n",
241 if ( headcnt > 0 || trailcnt > 0 )
244 char *scanner_cp =
"yy_c_buf_p = yy_cp";
245 char *scanner_bp =
"yy_bp";
248 "*yy_cp = yy_hold_char; /* undo effects of setting up yytext */\n" );
252 scanner_cp, scanner_bp, headcnt );
256 "%s -= %d;\n", scanner_cp, trailcnt );
259 "YY_DO_BEFORE_ACTION; /* set up yytext again */\n" );
int variable_trailing_context_rules
void add_accept(int mach, int accepting_number)
void line_directive_out(FILE *)
int link_machines |
( |
int |
first, |
|
|
int |
last |
|
) |
| |
Definition at line 283 of file nfa.c.
288 else if ( last ==
NIL )
void mark_beginning_as_normal |
( |
int |
mach | ) |
|
Definition at line 316 of file nfa.c.
338 flexerror(
"bad state type in mark_beginning_as_normal()" );
#define STATE_TRAILING_CONTEXT
void mark_beginning_as_normal(int mach)
void flexerror(char[]) NORETURN
int mkbranch |
( |
int |
first, |
|
|
int |
second |
|
) |
| |
Definition at line 405 of file nfa.c.
int link_machines(int first, int last)
#define SUPER_FREE_EPSILON(state)
int mkor |
( |
int |
first, |
|
|
int |
second |
|
) |
| |
Definition at line 442 of file nfa.c.
449 else if ( second ==
NIL )
int link_machines(int first, int last)
#define SUPER_FREE_EPSILON(state)
Definition at line 501 of file nfa.c.
int link_machines(int first, int last)
#define SUPER_FREE_EPSILON(state)
int mkrep |
( |
int |
mach, |
|
|
int |
lb, |
|
|
int |
ub |
|
) |
| |
Definition at line 532 of file nfa.c.
534 int base_mach, tail,
copy,
i;
549 for ( i = lb; i < ub; ++
i )
void copy(PVValueArray< T > &pvFrom, size_t fromOffset, size_t fromStride, PVValueArray< T > &pvTo, size_t toOffset, size_t toStride, size_t count)
Copy a subarray from one scalar array to another.
int link_machines(int first, int last)
int copysingl(int singl, int num)
Definition at line 578 of file nfa.c.
583 lerrif(
"input rules are too complicated (>= %d NFA states)",
#define reallocate_integer_array(array, size)
void mkechar(int tch, int fwd[], int bck[])
void mkxtion |
( |
int |
statefrom, |
|
|
int |
stateto |
|
) |
| |
Definition at line 648 of file nfa.c.
651 trans1[statefrom] = stateto;
655 flexfatal(
"found too many transitions in mkxtion()" );
660 trans2[statefrom] = stateto;
Definition at line 674 of file nfa.c.
#define MAX_RULES_INCREMENT
#define reallocate_integer_array(array, size)