*/
set_indent( 1 );
- if ( yymore_used )
+ if ( yymore_used && ! yytext_is_array )
{
indent_puts( "yytext_ptr -= yy_more_len; \\" );
indent_puts( "yyleng = (int) (yy_cp - yytext_ptr); \\" );
skelout();
if ( yytext_is_array )
{
- indent_puts( "if ( yyleng >= YYLMAX ) \\" );
+ if ( yymore_used )
+ indent_puts(
+ "if ( yyleng + yy_more_offset >= YYLMAX ) \\" );
+ else
+ indent_puts( "if ( yyleng >= YYLMAX ) \\" );
+
indent_up();
indent_puts(
"YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" );
indent_down();
- indent_puts(
+
+ if ( yymore_used )
+ {
+ indent_puts(
+"yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \\" );
+ indent_puts( "yyleng += yy_more_offset; \\" );
+ indent_puts(
+ "yy_prev_more_offset = yy_more_offset; \\" );
+ indent_puts( "yy_more_offset = 0; \\" );
+ }
+ else
+ {
+ indent_puts(
"yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \\" );
+ }
}
set_indent( 0 );
{
if ( ! C_plus_plus )
{
- indent_puts( "static int yy_more_flag = 0;" );
- indent_puts( "static int yy_more_len = 0;" );
+ if ( yytext_is_array )
+ {
+ indent_puts( "static int yy_more_offset = 0;" );
+ indent_puts(
+ "static int yy_prev_more_offset = 0;" );
+ }
+ else
+ {
+ indent_puts( "static int yy_more_flag = 0;" );
+ indent_puts( "static int yy_more_len = 0;" );
+ }
}
- indent_puts( "#define yymore() (yy_more_flag = 1)" );
- indent_puts( "#define YY_MORE_ADJ yy_more_len" );
+ if ( yytext_is_array )
+ {
+ indent_puts(
+ "#define yymore() (yy_more_offset = yy_flex_strlen( yytext ))" );
+ indent_puts( "#define YY_NEED_STRLEN" );
+ indent_puts( "#define YY_MORE_ADJ 0" );
+ indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET \\" );
+ indent_up();
+ indent_puts( "{ \\" );
+ indent_puts( "yy_more_offset = yy_prev_more_offset; \\" );
+ indent_puts( "yyleng -= yy_more_offset; \\" );
+ indent_puts( "}" );
+ indent_down();
+ }
+ else
+ {
+ indent_puts( "#define yymore() (yy_more_flag = 1)" );
+ indent_puts( "#define YY_MORE_ADJ yy_more_len" );
+ indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" );
+ }
}
else
{
indent_puts( "#define yymore() yymore_used_but_not_detected" );
indent_puts( "#define YY_MORE_ADJ 0" );
+ indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" );
}
if ( ! C_plus_plus )
set_indent( 2 );
- if ( yymore_used )
+ if ( yymore_used && ! yytext_is_array )
{
indent_puts( "yy_more_len = 0;" );
indent_puts( "if ( yy_more_flag )" );
indent_up();
indent_puts( "{" );
- indent_puts( "yy_more_len = yyleng;" );
+ indent_puts( "yy_more_len = yy_c_buf_p - yytext_ptr;" );
indent_puts( "yy_more_flag = 0;" );
indent_puts( "}" );
indent_down();