calc.l (273B)
1 %{ 2 #define YYSTYPE double 3 #include "calc.tab.h" 4 extern YYSTYPE yylval; 5 %} 6 7 %% 8 [0-9]+\.?[0-9]* { yylval = atof( yytext ); return NUMBER; }; 9 [ \t] ; /* ignore whitespace */ 10 \n { return yytext[0]; }; 11 . { return yytext[0]; } 12 <<EOF>> { printf("eof\n"); return 0; }; 13 %%