%{
#include<stdio.h>
#include<stdlib.h>
void digi();
%}
dig [0-9]+|([0-9]*)"."([0-9]+)
add "+"
sub "-"
mul "*"
div "/"
pow "^"
ln \n
%%
{dig} {digi();}
{ln} {printf("Result:%f\n\n",a);}
%%
void digi(){
{
a=atof(yytext);
}else{
b=atof(yytext);
case 1: a=a+b; break;
case 2: a=a-b; break;
case 3: a=a*b; break;
case 4: a=a/b; break;
case 5:{
for(i=0;i<b;i++)
{
result*=a;
}
a=result;
break;
}
}
}}
int main(int argc, char *argv[]){
yylex();
return 0;}
int yywrap(){
return 1;}
JXsKI2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8c3RkbGliLmg+CmludCBvcD0wLGk7CmZsb2F0IGEsYjsKdm9pZCBkaWdpKCk7CiV9CgpkaWcgWzAtOV0rfChbMC05XSopIi4iKFswLTldKykKYWRkICIrIgpzdWIgIi0iCm11bCAiKiIKZGl2ICIvIgpwb3cgIl4iCmxuIFxuCgoKJSUKe2RpZ30ge2RpZ2koKTt9CnthZGR9IHtvcD0xO30Ke3N1Yn0ge29wPTI7fQp7bXVsfSB7b3A9Mzt9CntkaXZ9IHtvcD00O30Ke3Bvd30ge29wPTU7fQp7bG59IHtwcmludGYoIlJlc3VsdDolZlxuXG4iLGEpO30KJSUKdm9pZCBkaWdpKCl7CmlmKG9wPT0wKQp7CmE9YXRvZih5eXRleHQpOwp9ZWxzZXsKYj1hdG9mKHl5dGV4dCk7CnN3aXRjaChvcCl7CmNhc2UgMTogYT1hK2I7IGJyZWFrOwpjYXNlIDI6IGE9YS1iOyBicmVhazsKY2FzZSAzOiBhPWEqYjsgYnJlYWs7CmNhc2UgNDogYT1hL2I7IGJyZWFrOwpjYXNlIDU6ewpmbG9hdCByZXN1bHQ9MTsKZm9yKGk9MDtpPGI7aSsrKQp7CnJlc3VsdCo9YTsKfQphPXJlc3VsdDsKYnJlYWs7Cn0KfQpvcD0wOwp9fQppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqYXJndltdKXsKeXlsZXgoKTsKcmV0dXJuIDA7fQppbnQgeXl3cmFwKCl7CnJldHVybiAxO30=