diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1995-04-20 12:42:51 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1995-04-20 12:42:51 +0000 |
commit | 582c95639dfbd43b2df9fdd142a26acb4a7b62e0 (patch) | |
tree | 39ee48cc0f474cf806f5103c484db59bd8f084d7 /flex.skl | |
parent | 34ba5a8132b45d84277ed880490685e68e68335c (diff) |
rearrange some definitions; fix YY_NO_UNPUT
Diffstat (limited to 'flex.skl')
-rw-r--r-- | flex.skl | 54 |
1 files changed, 30 insertions, 24 deletions
@@ -277,6 +277,30 @@ static void yy_flex_free YY_PROTO(( void * )); %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here +%- Standard (non-C++) definition +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +%* + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ +%% code to fiddle yytext and yyleng for yymore() goes here + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ +%% code to copy yytext_ptr to yytext[] goes here, if %array + yy_c_buf_p = yy_cp; + +%% data tables for the DFA and the user's section 1 definitions go here + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); @@ -285,9 +309,11 @@ extern int yywrap YY_PROTO(( void )); #endif #endif +%- #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif +%* #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); @@ -303,30 +329,6 @@ static int input YY_PROTO(( void )); %* #endif -%- Standard (non-C++) definition -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); -%* - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ -%% code to fiddle yytext and yyleng for yymore() goes here - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ -%% code to copy yytext_ptr to yytext[] goes here, if %array - yy_c_buf_p = yy_cp; - -%% data tables for the DFA and the user's section 1 definitions go here - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; @@ -907,6 +909,7 @@ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) %- +#ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else @@ -951,6 +954,9 @@ void yyFlexLexer::yyunput( int c, register char* yy_bp ) yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } +%- +#endif /* ifndef YY_NO_UNPUT */ +%* %- |