]> granicus.if.org Git - flex/commitdiff
Added %array support
authorVern Paxson <vern@ee.lbl.gov>
Mon, 5 Apr 1993 20:35:08 +0000 (20:35 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Mon, 5 Apr 1993 20:35:08 +0000 (20:35 +0000)
gen.c

diff --git a/gen.c b/gen.c
index 13a8e70bbda6567eee2560154363346d0a76707e..b1f6e98260d282ae12aa2356072bc7a715cc4ff9 100644 (file)
--- a/gen.c
+++ b/gen.c
@@ -1023,6 +1023,18 @@ void make_tables()
     else
        indent_puts( "yyleng = yy_cp - yy_bp; \\" );
 
+    /* now also deal with copying yytext_ptr to yytext if needed */
+    skelout();
+    if ( yytext_is_array )
+       {
+       indent_puts( "if ( yyleng >= YYLMAX ) \\" );
+       indent_up();
+       indent_puts(
+               "YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" );
+       indent_down();
+       indent_puts( "strcpy( yytext, (char *) yytext_ptr ); \\" );
+       }
+
     set_indent( 0 );
     
     skelout();