blob: 9988ddd2baa504533f6d4a6bbbe19de820d31bb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
%{
#include <math.h>
#include <string.h>
#include "regn.tab.h"
%}
realtal ([0-9]+|([0-9]*\.[0-9]+))([eE][-+]?[0-9]+)?
op_log log
op_exp exp
op_sqrt sqrt
%%
{realtal} {yylval.dval = atof(yytext);
return TAL;}
{op_log} {return LOG;}
{op_exp} {return EXP;}
{op_sqrt} {return SQRT;}
[ \t] ;
'$' {return 0;}
\n|. {return yytext[0];}
%%
|