Remove building with NOCRYPTO option
[minix3.git] / external / bsd / flex / dist / examples / manual / expr.lex
blob9adfcaa880bd89a67c093dff311d0566d8c7980a
1 /*
2  * expr.lex : Scanner for a simple
3  *            expression parser.
4  */
6 %{
7 #include "y.tab.h"
9 %}
13 [0-9]+     { yylval.val = atol(yytext);
14              return(NUMBER);
15            }
16 [0-9]+\.[0-9]+ { 
17              sscanf(yytext,"%f",&yylval.val);
18              return(NUMBER);
19            }
20 "+"        return(PLUS);
21 "-"        return(MINUS);
22 "*"        return(MULT);
23 "/"        return(DIV);
24 "^"        return(EXPON);
25 "("        return(LB);
26 ")"        return(RB);
27 \n         return(EOL);
28 [\t ]*     /* throw away whitespace */
29 .          { yyerror("Illegal character"); 
30              return(EOL);
31            }