| 1 |
let pos_intstr =
|
| 2 |
Sequence.plus (Types.char (Chars.char_class
|
| 3 |
(Chars.mk_char '0')
|
| 4 |
(Chars.mk_char '9')
|
| 5 |
)
|
| 6 |
)
|
| 7 |
|
| 8 |
let neg_intstr =
|
| 9 |
Types.times
|
| 10 |
(Types.cons (Types.char (Chars.atom (Chars.mk_char '-'))))
|
| 11 |
(Types.cons pos_intstr)
|
| 12 |
|
| 13 |
let intstr = Types.cup pos_intstr neg_intstr (* [ '-'? '0'--'9'+ ] *)
|
| 14 |
|
| 15 |
let true_atom = Atoms.mk_ascii "true"
|
| 16 |
let false_atom = Atoms.mk_ascii "false"
|
| 17 |
let true_type = Types.atom (Atoms.atom true_atom)
|
| 18 |
let false_type = Types.atom (Atoms.atom false_atom)
|
| 19 |
|
| 20 |
let bool = Types.cup true_type false_type
|
| 21 |
|
| 22 |
let char_latin1 = Types.char (Chars.mk_classes [ (0,255) ])
|
| 23 |
let string_latin1 = Sequence.star char_latin1
|
| 24 |
|
| 25 |
let types =
|
| 26 |
[
|
| 27 |
"Empty", Types.empty;
|
| 28 |
"Any", Types.any;
|
| 29 |
"Int", Types.Int.any;
|
| 30 |
"Char", Types.char Chars.any;
|
| 31 |
"Byte", char_latin1;
|
| 32 |
"Atom", Types.atom Atoms.any;
|
| 33 |
"Pair", Types.Product.any;
|
| 34 |
"Arrow", Types.Arrow.any;
|
| 35 |
"Record", Types.Record.any;
|
| 36 |
"String", Sequence.string;
|
| 37 |
"Latin1", string_latin1;
|
| 38 |
"Bool", bool
|
| 39 |
];
|