repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Remove building with NOCRYPTO option
[minix3.git]
/
external
/
bsd
/
flex
/
dist
/
examples
/
manual
/
expr.lex
blob
9adfcaa880bd89a67c093dff311d0566d8c7980a
1
/*
2
* expr.lex : Scanner for a simple
3
* expression parser.
4
*/
5
6
%{
7
#include "y.tab.h"
8
9
%}
10
11
%%
12
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
}
32
%%
33
34
35