|
From: | Nicolas Peyrussie |
Subject: | Re: yylex and yy_scan_string() |
Date: | Thu, 24 Mar 2005 09:09:51 +0100 |
User-agent: | Mozilla Thunderbird 0.9 (X11/20041127) |
Ok, I am now working with the QT library in C++. It works fine, and it is easier to use for what I want to do (like replacing french accents "é" by 'e'). The problem is that it is much slower than parsing with flex. So, I first want to have something that works well and then I will try again with flex and let you know if I found a solution. Tank you really much for your help Bruce Lilly wrote: 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. |
[Prev in Thread] | Current Thread | [Next in Thread] |