/* file name : list2.l */ %{ #define YYSTYPE double #include "list2.tab.h" %} DIGIT [0-9] %% {DIGIT}+("."{DIGIT}+)? { yylval = atof(yytext); return NUMBER; } [ \t] /* ignore whitespace */ <> yyterminate(); /* signal end of dialogue */ \n return yytext[0]; . return yytext[0]; %%