Dear Reders,
 
Please clear my following doubts regarding the YY_FLUSH_BUFFER. The program and its output is given below..........
 
Generally YY_FLUSH_BUFFER flushes out all the content of yytext. But from the following program I understood that it flushes only first two letters from the first token.............
 
If you can spare some time clear this doubts it would be very helpful for me.....................
 
Thanks
 
truly
Vinu V Das,
Lecturer, Dept of Computer,
MES College of Engg.
Kerala, India.
 
-------------------------------------------------
 

%%

 

[a-z]+ { printf("\nThe lower case token is = ");

         ECHO;

         YY_FLUSH_BUFFER;

         printf("\nThe token after flush = ");ECHO;

        }

[a-zA-Z]+ { printf("\nThe mixed token is = ");

            ECHO;

        }

 

%%

 

main()

{

        yylex();

}

 

--------- output -----------------------

 

[EMAIL PROTECTED] yytextTest]# ./a.out

good morning

 

The lower case token is = good

The token after flush = od

 

[1]+  Stopped                 ./a.out

[EMAIL PROTECTED] yytextTest]#

_______________________________________________
help-flex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-flex

Reply via email to