Go to the source code of this file.
#define indent_down |
( |
| ) |
(--indent_level) |
Definition at line 51 of file gen.c.
#define indent_up |
( |
| ) |
(++indent_level) |
Definition at line 50 of file gen.c.
#define set_indent |
( |
|
indent_val | ) |
indent_level = indent_val |
Definition at line 52 of file gen.c.
Definition at line 65 of file gen.c.
67 int i = indent_level * 4;
void gen_backtracking |
( |
void |
| ) |
|
Definition at line 85 of file gen.c.
91 indent_puts(
"if ( yy_current_state[-1].yy_nxt )" );
93 indent_puts(
"if ( yy_accept[yy_current_state] )" );
97 indent_puts(
"yy_last_accepting_state = yy_current_state;" );
void gen_bt_action |
( |
void |
| ) |
|
Definition at line 106 of file gen.c.
114 indent_puts(
"/* undo the effects of YY_DO_BEFORE_ACTION */" );
118 indent_puts(
"yy_cp = yy_last_accepting_cpos + 1;" );
125 indent_puts(
"yy_current_state = yy_last_accepting_state;" );
#define set_indent(indent_val)
void gen_find_action |
( |
void |
| ) |
|
Definition at line 271 of file gen.c.
274 indent_puts(
"yy_act = yy_current_state[-1].yy_nxt;" );
277 indent_puts(
"yy_act = yy_accept[yy_current_state];" );
281 indent_puts(
"yy_current_state = *--yy_state_ptr;" );
282 indent_puts(
"yy_lp = yy_accept[yy_current_state];" );
284 puts(
"find_rule: /* we branch to this label when backtracking */" );
286 indent_puts(
"for ( ; ; ) /* until we find what rule we matched */" );
292 indent_puts(
"if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )" );
299 indent_puts(
"if ( yy_act & YY_TRAILING_HEAD_MASK ||" );
304 indent_puts(
"if ( yy_act == yy_looking_for_trail_begin )" );
308 indent_puts(
"yy_act &= ~YY_TRAILING_HEAD_MASK;" );
316 indent_puts(
"else if ( yy_act & YY_TRAILING_MASK )" );
320 "yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;" );
322 "yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;" );
371 indent_puts(
"yy_current_state = *--yy_state_ptr;" );
372 indent_puts(
"yy_lp = yy_accept[yy_current_state];" );
381 indent_puts(
"yy_act = yy_accept[yy_current_state];" );
int variable_trailing_context_rules
void gen_next_compressed_state |
( |
char * |
char_map | ) |
|
Definition at line 424 of file gen.c.
435 "while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )" );
438 indent_puts(
"yy_current_state = yy_def[yy_current_state];" );
462 "yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];" );
void indent_put2s(char[], char[])
void gen_backtracking(void)
void gen_next_match |
( |
void |
| ) |
|
Definition at line 468 of file gen.c.
473 char *char_map =
useecs ?
"yy_ec[(int)*yy_cp]" :
"*yy_cp";
474 char *char_map_2 =
useecs ?
"yy_ec[*++yy_cp]" :
"*++yy_cp";
479 "while ( (yy_current_state = yy_nxt[yy_current_state][%s]) > 0 )",
499 indent_puts(
"yy_current_state = -yy_current_state;" );
505 indent_puts(
"const struct yy_trans_info *yy_trans_info;\n" );
509 " (yy_trans_info = &yy_current_state[yy_c])->yy_verify == yy_c;" );
517 indent_puts(
"yy_current_state += yy_trans_info->yy_nxt;" );
547 printf(
"while ( yy_base[yy_current_state] != %d );\n",
jambase );
555 indent_puts(
"yy_current_state = yy_last_accepting_state;" );
void indent_put2s(char[], char[])
void gen_backtracking(void)
void gen_next_state |
( |
int |
worry_about_NULs | ) |
|
Definition at line 563 of file gen.c.
567 if ( worry_about_NULs && !
nultrans )
570 (void) sprintf( char_map,
"(*yy_cp ? yy_ec[(int)*yy_cp] : %d)",
NUL_ec );
572 (
void) sprintf( char_map,
"(*yy_cp ? *yy_cp : %d)",
NUL_ec );
576 (
void) strcpy( char_map,
useecs ?
"yy_ec[(int)*yy_cp]" :
"*yy_cp" );
590 indent_put2s(
"yy_current_state = yy_nxt[yy_current_state][%s];",
594 indent_put2s(
"yy_current_state += yy_current_state[%s].yy_nxt;",
606 indent_puts(
"yy_current_state = yy_NUL_trans[yy_current_state];" );
614 indent_puts(
"*yy_state_ptr++ = yy_current_state;" );
void indent_put2s(char[], char[])
void gen_backtracking(void)
void gen_next_compressed_state(char *char_map)
void gen_NUL_trans |
( |
void |
| ) |
|
Definition at line 620 of file gen.c.
624 if ( need_backtracking )
632 indent_puts(
"yy_current_state = yy_NUL_trans[yy_current_state];" );
633 indent_puts(
"yy_is_jam = (yy_current_state == 0);" );
639 printf(
"yy_current_state = yy_nxt[yy_current_state][%d];\n",
641 indent_puts(
"yy_is_jam = (yy_current_state <= 0);" );
650 "const struct yy_trans_info *yy_trans_info;\n" );
651 indent_puts(
"yy_trans_info = &yy_current_state[yy_c];" );
652 indent_puts(
"yy_current_state += yy_trans_info->yy_nxt;" );
654 indent_puts(
"yy_is_jam = (yy_trans_info->yy_verify != yy_c);" );
661 (void) sprintf( NUL_ec_str,
"%d",
NUL_ec );
665 indent_puts(
"*yy_state_ptr++ = yy_current_state;" );
670 printf(
"yy_is_jam = (yy_base[yy_current_state] == %d);\n",
void gen_backtracking(void)
void gen_next_compressed_state(char *char_map)
void gen_start_state |
( |
void |
| ) |
|
Definition at line 695 of file gen.c.
698 indent_put2s(
"yy_current_state = yy_start_state_list[yy_start%s];",
699 bol_needed ?
" + (yy_bp[-1] == '\\n' ? 1 : 0)" :
"" );
717 indent_puts(
"*yy_state_ptr++ = yy_current_state;" );
void indent_put2s(char[], char[])
Definition at line 139 of file gen.c.
142 int end_of_buffer_action =
num_rules + 1;
145 printf(
"static const struct yy_trans_info yy_transition[%d] =\n",
180 nxt[base[
i] - 1] = anum;
183 for ( i = 0; i <=
tblend; ++
i )
207 printf(
"static const struct yy_trans_info *yy_start_state_list[%d] =\n",
211 for ( i = 0; i <=
lastsc * 2; ++
i )
union dfaacc_union * dfaacc
void transition_struct_out(int, int)
Definition at line 223 of file gen.c.
226 static char C_char_decl[] =
"static const %s %s[%d] =\n { 0,\n";
235 for ( i = 1; i <
csize; ++
i )
237 if (
caseins && (i >=
'A') && (i <=
'Z') )
250 fputs(
"\n\nEquivalence Classes:\n\n",
stderr );
254 for ( j = 0; j < numrows; ++j )
256 for ( i = j; i <
csize; i = i + numrows )
char * readable_form(int c)
Definition at line 391 of file gen.c.
394 int end_of_buffer_action =
num_rules + 1;
408 fprintf(
stderr,
"state # %d accepts: [%d]\n", i, anum );
union dfaacc_union * dfaacc
Definition at line 729 of file gen.c.
731 int i, j, k, *accset, nacc, *acc_array, total_states;
732 int end_of_buffer_action =
num_rules + 1;
737 static char C_char_decl[] =
738 "static const YY_CHAR %s[%d] =\n { 0,\n";
758 int EOB_accepting_list[2];
761 EOB_accepting_list[0] = 0;
762 EOB_accepting_list[1] = end_of_buffer_action;
780 fprintf(
stderr,
"state # %d accepts: ", i );
782 for ( k = 1; k <= nacc; ++k )
784 int accnum = accset[k];
803 fprintf(
stderr,
"[%d]", accset[k] );
849 printf( C_short_decl,
"yy_accept", k );
856 fprintf(
stderr,
"state # %d accepts: [%d]\n", i, acc_array[i] );
876 fputs(
"\n\nMeta-Equivalence Classes:\n",
stderr );
880 for ( i = 1; i <=
numecs; ++
i )
894 "yy_base", total_states + 1 );
919 for ( ++i ; i <= total_states; ++
i )
928 "yy_def", total_states + 1 );
930 for ( i = 1; i <= total_states; ++
i )
938 for ( i = 1; i <=
tblend; ++
i )
940 if (
nxt[i] == 0 ||
chk[i] == 0 )
951 for ( i = 1; i <=
tblend; ++
i )
int variable_trailing_context_rules
#define YY_TRAILING_HEAD_MASK
union dfaacc_union * dfaacc
#define allocate_integer_array(size)
void indent_put2s |
( |
char |
[], |
|
|
char |
[] |
|
) |
| |
void indent_put2s |
( |
char * |
fmt, |
|
|
char * |
arg |
|
) |
| |
void indent_puts |
( |
char |
[] | ) |
|
void indent_puts |
( |
char * |
str | ) |
|
void make_tables |
( |
void |
| ) |
|
Definition at line 994 of file gen.c.
997 int did_eof_rule =
false;
1025 char *trans_offset_type =
1026 total_table_size >
MAX_SHORT ?
"long" :
"short";
1045 indent_puts(
"typedef const struct yy_trans_info *yy_state_type;" );
1062 indent_puts(
"static yy_state_type yy_last_accepting_state;" );
1063 indent_puts(
"static YY_CHAR *yy_last_accepting_cpos;\n" );
1102 "static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;" );
1103 puts(
"static YY_CHAR *yy_full_match;" );
1104 puts(
"static int yy_lp;" );
1108 puts(
"static int yy_looking_for_trail_begin = 0;" );
1109 puts(
"static int yy_full_lp;" );
1110 puts(
"static int *yy_full_state;" );
1112 printf(
"#define YY_TRAILING_HEAD_MASK 0x%x\n",
1116 puts(
"#define REJECT \\" );
1119 "*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \\" );
1121 "yy_cp = yy_full_match; /* restore poss. backed-over text */ \\" );
1125 puts(
"yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \\" );
1127 "yy_state_ptr = yy_full_state; /* restore orig. state */ \\" );
1129 "yy_current_state = *yy_state_ptr; /* restore curr. state */ \\" );
1132 puts(
"++yy_lp; \\" );
1133 puts(
"goto find_rule; \\" );
1139 puts(
"/* the intent behind this definition is that it'll catch" );
1140 puts(
" * any uses of REJECT which flex missed" );
1142 puts(
"#define REJECT reject_used_but_not_detected" );
1148 indent_puts(
"static int yy_doing_yy_more = 0;" );
1151 "#define yymore() { yy_more_flag = 1; }" );
1153 "#define YY_MORE_ADJ (yy_doing_yy_more ? yy_more_len : 0)" );
1158 indent_puts(
"#define yymore() yymore_used_but_not_detected" );
1165 flexfatal(
"error occurred when writing temporary action file" );
1168 flexfatal(
"error occurred when rewinding temporary action file" );
1180 indent_puts(
"yy_doing_yy_more = yy_more_flag;" );
1195 puts(
"yy_match:" );
1211 indent_puts(
"fprintf( stderr, \"--scanner backtracking\\n\" );" );
1215 printf(
"else if ( yy_act < %d )\n", num_rules );
1218 "fprintf( stderr, \"--accepting rule at line %d (\\\"%s\\\")\\n\"," );
1219 indent_puts(
" yy_rule_linenum[yy_act], yytext );" );
1223 printf(
"else if ( yy_act == %d )\n", num_rules );
1226 "fprintf( stderr, \"--accepting default rule (\\\"%s\\\")\\n\"," );
1231 printf(
"else if ( yy_act == %d )\n", num_rules + 1 );
1233 indent_puts(
"fprintf( stderr, \"--(end of buffer or a NUL)\\n\" );" );
1239 indent_puts(
"fprintf( stderr, \"--EOF\\n\" );" );
1253 for ( i = 1; i <=
lastsc; ++
i )
1258 did_eof_rule =
true;
1286 indent_puts(
"yy_current_state = yy_last_accepting_state;" );
void indent_put2s(char[], char[])
void gen_find_action(void)
int variable_trailing_context_rules
#define YY_TRAILING_HEAD_MASK
void line_directive_out(FILE *)
void gen_start_state(void)
void gen_next_match(void)
#define set_indent(indent_val)