From 5bc38338c79ef313f639696ec85e424c5d9c0b0c Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 24 Oct 2019 09:17:29 +0200 Subject: Added regn2 --- sem1/osc/mm11/regn2/regn.l | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sem1/osc/mm11/regn2/regn.l (limited to 'sem1/osc/mm11/regn2/regn.l') diff --git a/sem1/osc/mm11/regn2/regn.l b/sem1/osc/mm11/regn2/regn.l new file mode 100644 index 0000000..9988ddd --- /dev/null +++ b/sem1/osc/mm11/regn2/regn.l @@ -0,0 +1,27 @@ +%{ +#include +#include +#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];} + +%% + -- cgit v1.2.3