diff options
Diffstat (limited to 'examples/manual/pas_include.lex')
-rw-r--r-- | examples/manual/pas_include.lex | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/manual/pas_include.lex b/examples/manual/pas_include.lex index 58cf590..b0a0a48 100644 --- a/examples/manual/pas_include.lex +++ b/examples/manual/pas_include.lex @@ -19,13 +19,13 @@ int include_count = -1; %% -"{" BEGIN(COMMENT); +"{" yybegin(COMMENT); -<COMMENT>"}" BEGIN(INITIAL); -<COMMENT>"$include"[ \t]*"(" BEGIN(INCLUDE); +<COMMENT>"}" yybegin(INITIAL); +<COMMENT>"$include"[ \t]*"(" yybegin(INCLUDE); <COMMENT>[ \t]* /* skip whitespace */ -<INCLUDE>")" BEGIN(COMMENT); +<INCLUDE>")" yybegin(COMMENT); <INCLUDE>[ \t]* /* skip whitespace */ <INCLUDE>[^ \t\n() ]+ { /* get the include file name */ if ( include_count >= MAX_NEST){ @@ -33,7 +33,7 @@ int include_count = -1; exit( 1 ); } - include_stack[++include_count] = YY_CURRENT_BUFFER; + include_stack[++include_count] = yy_current_buffer(); yyin = fopen( yytext, "r" ); if ( ! yyin ){ @@ -43,7 +43,7 @@ int include_count = -1; yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE)); - BEGIN(INITIAL); + yybegin(INITIAL); } <INCLUDE><<EOF>> { @@ -61,11 +61,11 @@ int include_count = -1; } else { yy_delete_buffer(include_stack[include_count--] ); yy_switch_to_buffer(include_stack[include_count] ); - BEGIN(INCLUDE); + yybegin(INCLUDE); } } -[a-z]+ ECHO; -.|\n ECHO; +[a-z]+ yyecho(); +.|\n yyecho(); |