]> granicus.if.org Git - flex/commitdiff
Added "flex++" feature
authorVern Paxson <vern@ee.lbl.gov>
Sun, 3 Oct 1993 16:01:41 +0000 (16:01 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Sun, 3 Oct 1993 16:01:41 +0000 (16:01 +0000)
Minimized use of YY_CHAR

main.c

diff --git a/main.c b/main.c
index fc9dded3210aeeeb7e2da3cb322b29a9a73e2c4a..5776de4851a67e475f588bd75383cb521ca187b5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -433,6 +433,10 @@ char **argv;
 
        program_name = argv[0];
 
+       if ( program_name[0] != '\0' &&
+            program_name[strlen( program_name ) - 1] == '+' )
+               C_plus_plus = true;
+
        /* read flags */
        for ( --argc, ++argv; argc ; --argc, ++argv )
                {
@@ -758,13 +762,13 @@ char **argv;
 
 void readin()
        {
+       skelout();
+
        if ( csize == 256 )
                puts( "typedef unsigned char YY_CHAR;" );
        else
                puts( "typedef char YY_CHAR;" );
 
-       skelout();
-
        if ( C_plus_plus )
                puts( "#define yytext_ptr yytext" );
 
@@ -815,13 +819,13 @@ void readin()
                        puts( "#define YYLMAX YY_READ_BUF_SIZE" );
                        puts( "#endif YYLMAX\n" );
                        puts( "char yytext[YYLMAX];" );
-                       puts( "YY_CHAR *yytext_ptr;" );
+                       puts( "char *yytext_ptr;" );
                        }
 
                else
                        {
-                       puts( "extern YY_CHAR *yytext;" );
-                       puts( "YY_CHAR *yytext;" );
+                       puts( "extern char *yytext;" );
+                       puts( "char *yytext;" );
                        puts( "#define yytext_ptr yytext" );
                        }
                }