]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/pxp/tools/ucs2_to_utf8/parser.mly
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / pxp / pxp / tools / ucs2_to_utf8 / parser.mly
1 /******************************************************/
2 /*    Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>   */
3 /*                   14/05/2000                       */
4 /******************************************************/
5
6 %token <int>CHAR
7 %token <string>IDENT
8 %token LET
9 %token EQ
10 %token END_OF_LET
11 %token RBRACKET
12 %token PIPE
13 %token LBRACKET
14 %token RANGE
15 %token EOF
16 %start main
17 %type <Types.definition list> main
18
19 %%
20
21 main:
22    EOF              { [] }
23  | declaration main { $1::$2 }
24 ;
25
26 declaration:
27    LET IDENT EQ regexp END_OF_LET
28       { { Types.id = $2 ; Types.rel = $4 } }
29 ;
30
31 regexp:
32    regexptoken PIPE regexp  { $1::$3 }
33  | regexptoken              { [$1] }
34 ;
35
36 regexptoken:
37    CHAR                               { Types.Char $1 }
38  | LBRACKET CHAR RANGE CHAR RBRACKET  { Types.Interval ($2,$4) }
39  | IDENT                              { Types.Identifier $1 }
40 ;