From: <Wor...@gm...> - 2019-02-27 13:37:04
|
I've replaced the lines 5 and 6 because he matches first the lines with the most matches and that is normaly .|\n but again same problem =(. On 27.02.19 14:00, Wor...@gm... wrote: > Hi everyone, i've got me the book flex&bison and have troubles with > one of the first examples: > > > 1. %{ > > 2. #include <stdio.h> > > 3. %} > > 4. %% > > 5. [_a-zA-Z0-9]+\( { printf("This is a function name %s > (steps=%i)", yytext, steps++); } > 6. .|\n { printf("do nothing"); } > > 7. %% > 8. int main(int argc, char **argv) > 9.{ > 10. yylex(); > 11. return(0); > 12. } > > Now my problem is that also strings like 12342welcome( are beeing > "marked" as beeing functions ... what am i doing wrong here ? the > default route .|\n is said to do nothing, so why does he matches also > digits with my function catching example ? > > > best regards! > > > |