(* Abstract syntax as produced by the parsed *) open Location open Ident type schema_item_kind = [ `Type | `Element | `Attribute | `Any ] type pprog = pmodule_item list and pmodule_item = pmodule_item' located and pmodule_item' = | TypeDecl of U.t * ppat | SchemaDecl of string * Schema_types.schema (* name, schema *) | LetDecl of ppat * pexpr | FunDecl of pexpr | Namespace of U.t * Ns.t | EvalStatement of pexpr | Debug of debug_directive | Directive of toplevel_directive and debug_directive = [ `Filter of ppat * ppat | `Sample of ppat | `Accept of ppat | `Compile of ppat * ppat list | `Subtype of ppat * ppat ] and toplevel_directive = [ `Quit | `Env | `Reinit_ns ] and pconst = | Const_internal of Types.const | Const_atom of U.t and pexpr = | LocatedExpr of loc * pexpr (* CDuce is a Lambda-calculus ... *) | Var of id | Apply of pexpr * pexpr | Abstraction of abstr (* Data constructors *) | Cst of pconst | Pair of pexpr * pexpr | Xml of pexpr * pexpr | RecordLitt of (label * pexpr) list | String of U.uindex * U.uindex * U.t * pexpr (* Data destructors *) | Match of pexpr * branches | Map of pexpr * branches | Transform of pexpr * branches | Xtrans of pexpr * branches | Validate of pexpr * string * string (* exp, schema name, element name *) | Dot of pexpr * label | RemoveField of pexpr * label (* Exceptions *) | Try of pexpr * branches (* Other *) | NamespaceIn of U.t * Ns.t * pexpr | Forget of pexpr * ppat | Op of string * pexpr list | Ref of pexpr * ppat and label = U.t and abstr = { fun_name : id option; fun_iface : (ppat * ppat) list; fun_body : branches } and branches = (ppat * pexpr) list (* A common syntactic class for patterns and types *) and ppat = ppat' located and ppat' = | PatVar of U.t | SchemaVar of (* type/pattern schema variable *) schema_item_kind * string * string | AtomT of U.t | NsT of U.t | Recurs of ppat * (U.t * ppat) list | Internal of Types.descr | Or of ppat * ppat | And of ppat * ppat | Diff of ppat * ppat | Prod of ppat * ppat | XmlT of ppat * ppat | Arrow of ppat * ppat | Optional of ppat | Record of bool * (label * ppat) list | Constant of id * pconst | Regexp of regexp * ppat (* regular expression, continuation: [ re ; cont ], e.g: [ re ; nil ] *) and regexp = | Epsilon | Elem of ppat | Seq of regexp * regexp | Alt of regexp * regexp | Star of regexp | WeakStar of regexp | SeqCapture of id * regexp open Printf