help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

YY_FLUSH_BUFFER


From: Vinu V Das
Subject: YY_FLUSH_BUFFER
Date: Sat, 17 Jun 2006 14:08:47 +0530

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 -----------------------

 

address@hidden yytextTest]# ./a.out

good morning

 

The lower case token is = good

The token after flush = od

 

[1]+  Stopped                 ./a.out

address@hidden yytextTest]#


reply via email to

[Prev in Thread] Current Thread [Next in Thread]