2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-23 10:20:24 +01:00
waf/demos/bisonflex/calc.l

14 lines
273 B
Plaintext
Raw Normal View History

2011-09-10 11:13:51 +02:00
%{
#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; };
%%