help-flex
[Top][All Lists]
Advanced

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

Re: yylex and yy_scan_string()


From: Bruce Lilly
Subject: Re: yylex and yy_scan_string()
Date: Wed, 23 Mar 2005 20:47:50 -0500
User-agent: KMail/1.8

On Tue March 22 2005 07:57, Nicolas Peyrussie wrote:

> This is my code :
[...]
> void lex_initFile(char *file)
> {  
> 
>   yyin =  fopen(file,"r");
>   printf("%s\n",file);
>   yylex();
> }
[...]
> The problem is that the program stops after the yy_scan_string(), when
> I thought it should start again where it had stopped thanks to the
> yylex().

Each call to yylex returns a single token; it returns zero
at the end of input.

If you want more than one token, you have to call yylex more
than one time.  See any introductory text on lex for details.




reply via email to

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