/* file name : list1.l */ %{ #define YYSTYPE double #include "list1.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]; %%