1 classmap BigNumClassMap;
2
3 tokens BigNumTokens
4 {
5 (PLUS, "'+'"), (MINUS, "'-'"), (MUL, "'*'"), (DIV, "'/'"), (LPAREN, "'('"), (RPAREN, "')'"), (FLOAT, "'float"), (RATIONAL, "'rational'"), (INTEGER, "'integer'")
6 }
7
8 expressions
9 {
10 ws = "[\n\r\t ]+";
11 sign = "\+|-";
12 digits = "[0-9]+";
13 exponent = "(e|E){sign}?{digits}";
14 floating = "{digits}\.{digits}{exponent}?|{digits}{exponent}";
15 rational = "\[{digits}(/{digits})?\]";
16 integer = "{digits}";
17 }
18
19 lexer BigNumLexer
20 {
21 "{ws}" {}
22 "{floating}" { return FLOAT; }
23 "{rational}" { return RATIONAL; }
24 "{integer}" { return INTEGER; }
25 "\+"{ return PLUS; }
26 "-"{ return MINUS; }
27 "\*"{ return MUL; }
28 "/"{ return DIV; }
29 "\("{ return LPAREN; }
30 "\)"{ return RPAREN; }
31 }