2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 19:30:04 +01:00
waf/demos/bisonflex/calc.l
2011-09-10 11:13:51 +02:00

14 lines
273 B
Plaintext

%{
#define YYSTYPE double
#include "calc.tab.h"
extern YYSTYPE yylval;
%}
%%
[0-9]+\.?[0-9]* { yylval = atof( yytext ); return NUMBER; };
[ \t] ; /* ignore whitespace */
\n { return yytext[0]; };
. { return yytext[0]; }
<<EOF>> { printf("eof\n"); return 0; };
%%