| 3 |
open Location |
open Location |
| 4 |
open Ident |
open Ident |
| 5 |
|
|
| 6 |
|
type schema_item_kind = |
| 7 |
|
[ `Type | `Element | `Attribute | `Attribute_group | `Model_group ] option |
| 8 |
|
|
| 9 |
type pprog = pmodule_item list |
type pprog = pmodule_item list |
| 10 |
|
|
| 11 |
and pmodule_item = pmodule_item' located |
and pmodule_item = pmodule_item' located |
| 12 |
and pmodule_item' = |
and pmodule_item' = |
| 13 |
| TypeDecl of string * ppat |
| TypeDecl of id * ppat |
| 14 |
| PatDecl of string * ppat |
| SchemaDecl of string * Schema_types.schema (* name, schema *) |
|
| FunDecl of abstr |
|
| 15 |
| LetDecl of ppat * pexpr |
| LetDecl of ppat * pexpr |
| 16 |
|
| FunDecl of pexpr |
| 17 |
|
| Namespace of U.t * Ns.t |
| 18 |
|
| Using of U.t * Types.CompUnit.t |
| 19 |
| EvalStatement of pexpr |
| EvalStatement of pexpr |
| 20 |
| Debug of debug_directive |
| Debug of debug_directive |
| 21 |
|
| Directive of toplevel_directive |
| 22 |
and debug_directive = |
and debug_directive = |
| 23 |
[ `Filter of ppat * ppat |
[ `Filter of ppat * ppat |
| 24 |
|
| `Sample of ppat |
| 25 |
| `Accept of ppat |
| `Accept of ppat |
| 26 |
| `Compile of ppat * ppat list |
| `Compile of ppat * ppat list |
|
| `Normal_record of ppat |
|
|
| `Compile2 of ppat * ppat list |
|
| 27 |
| `Subtype of ppat * ppat |
| `Subtype of ppat * ppat |
| 28 |
|
| `Explain of ppat * pexpr |
| 29 |
|
] |
| 30 |
|
and toplevel_directive = |
| 31 |
|
[ `Quit |
| 32 |
|
| `Env |
| 33 |
|
| `Reinit_ns |
| 34 |
|
| `Help |
| 35 |
|
| `Dump of pexpr |
| 36 |
] |
] |
| 37 |
|
|
| 38 |
|
|
| 39 |
and pexpr = |
and pexpr = |
| 40 |
| LocatedExpr of loc * pexpr |
| LocatedExpr of loc * pexpr |
| 41 |
|
|
|
| Forget of pexpr * ppat |
|
|
|
|
| 42 |
(* CDuce is a Lambda-calculus ... *) |
(* CDuce is a Lambda-calculus ... *) |
| 43 |
| Var of id |
| Var of U.t |
| 44 |
| Apply of pexpr * pexpr |
| Apply of pexpr * pexpr |
| 45 |
| Abstraction of abstr |
| Abstraction of abstr |
| 46 |
|
|
| 47 |
(* Data constructors *) |
(* Data constructors *) |
| 48 |
| Cst of Types.const |
| Const of Types.Const.t |
| 49 |
|
| Integer of Intervals.V.t |
| 50 |
|
| Char of Chars.V.t |
| 51 |
| Pair of pexpr * pexpr |
| Pair of pexpr * pexpr |
| 52 |
|
| Atom of U.t |
| 53 |
| Xml of pexpr * pexpr |
| Xml of pexpr * pexpr |
| 54 |
| RecordLitt of pexpr label_map |
| RecordLitt of (label * pexpr) list |
| 55 |
|
| String of U.uindex * U.uindex * U.t * pexpr |
| 56 |
|
|
| 57 |
(* Data destructors *) |
(* Data destructors *) |
|
| Op of string * pexpr list |
|
| 58 |
| Match of pexpr * branches |
| Match of pexpr * branches |
| 59 |
| Map of bool * pexpr * branches |
| Map of pexpr * branches |
| 60 |
|
| Transform of pexpr * branches |
| 61 |
| Xtrans of pexpr * branches |
| Xtrans of pexpr * branches |
| 62 |
|
| Validate of pexpr * string * string (* exp, schema name, element name *) |
| 63 |
| Dot of pexpr* label |
| Dot of pexpr* label |
| 64 |
| RemoveField of pexpr * label |
| RemoveField of pexpr * label |
| 65 |
|
|
| 66 |
(* Exceptions *) |
(* Exceptions *) |
| 67 |
| Try of pexpr * branches |
| Try of pexpr * branches |
| 68 |
|
|
| 69 |
|
(* Other *) |
| 70 |
|
| NamespaceIn of U.t * Ns.t * pexpr |
| 71 |
|
| Forget of pexpr * ppat |
| 72 |
|
| Op of string * pexpr list |
| 73 |
|
| Ref of pexpr * ppat |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
and label = U.t |
| 78 |
|
|
| 79 |
and abstr = { |
and abstr = { |
| 80 |
fun_name : id option; |
fun_name : id option; |
| 81 |
fun_iface : (ppat * ppat) list; |
fun_iface : (ppat * ppat) list; |
| 88 |
|
|
| 89 |
and ppat = ppat' located |
and ppat = ppat' located |
| 90 |
and ppat' = |
and ppat' = |
| 91 |
| PatVar of string |
| PatVar of U.t |
| 92 |
| Recurs of ppat * (string * ppat) list |
| SchemaVar of (* type/pattern schema variable *) |
| 93 |
|
schema_item_kind * string * string |
| 94 |
|
| Cst of pexpr |
| 95 |
|
| NsT of U.t |
| 96 |
|
| Recurs of ppat * (id * ppat) list |
| 97 |
| Internal of Types.descr |
| Internal of Types.descr |
| 98 |
| Or of ppat * ppat |
| Or of ppat * ppat |
| 99 |
| And of ppat * ppat |
| And of ppat * ppat |
| 102 |
| XmlT of ppat * ppat |
| XmlT of ppat * ppat |
| 103 |
| Arrow of ppat * ppat |
| Arrow of ppat * ppat |
| 104 |
| Optional of ppat |
| Optional of ppat |
| 105 |
| Record of bool * ppat label_map |
| Record of bool * (label * ppat) list |
| 106 |
| Capture of id |
| Constant of id * pexpr |
|
| Constant of id * Types.const |
|
| 107 |
| Regexp of regexp * ppat |
| Regexp of regexp * ppat |
| 108 |
|
(* regular expression, continuation: [ re ; cont ], e.g: [ re ; nil ] *) |
| 109 |
|
|
| 110 |
and regexp = |
and regexp = |
| 111 |
| Epsilon |
| Epsilon |
| 115 |
| Star of regexp |
| Star of regexp |
| 116 |
| WeakStar of regexp |
| WeakStar of regexp |
| 117 |
| SeqCapture of id * regexp |
| SeqCapture of id * regexp |
| 118 |
|
|
| 119 |
|
|