Re: please help on infix yylex.

2005-05-09 Thread Hans Aberg
At 04:09 + 2005/05/09, Laxman Bana wrote: Lex Gurus, I am trying to learn flex and bison and I started with infix calc example specified in the manual. Everything is nomal when I use yylex() function specified in the manual. But I wanted to generate tokens using flex and I created followin

Re: please help on infix yylex.

2005-05-09 Thread 魏政元
I made some change for you, it works > WS [ \t\n] change to WS [ \t], you don't want to eat '\n' > DIGIT [0-9] > %% > {DIGIT}+ { yylval = atoi(yytext); return NUM; } > {WS} ; /* eat empty spaces. */ > . return yytext[0]; add 1 rule, '.' means any char except newline [\n]return yytext[0];