(* Abstract syntax as produced by the parsed *) open Location open Ident type pprog = pmodule_item list and pmodule_item = pmodule_item' located and pmodule_item' = | TypeDecl of string * ppat | PatDecl of string * ppat | FunDecl of abstr | LetDecl of ppat * pexpr | EvalStatement of pexpr | Debug of debug_directive and debug_directive = [ `Filter of ppat * ppat | `Sample of ppat | `Accept of ppat | `Compile of ppat * ppat list | `Subtype of ppat * ppat ] and pexpr = | LocatedExpr of loc * pexpr | Forget of pexpr * ppat (* CDuce is a Lambda-calculus ... *) | Var of id | Apply of pexpr * pexpr | Abstraction of abstr (* Data constructors *) | Cst of Types.const | Pair of pexpr * pexpr | Xml of pexpr * pexpr | RecordLitt of pexpr label_map (* Data destructors *) | Op of string * pexpr list | Match of pexpr * branches | Map of bool * pexpr * branches | Xtrans of pexpr * branches | Dot of pexpr* label | RemoveField of pexpr * label (* Exceptions *) | Try of pexpr * branches 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 string | Recurs of ppat * (string * 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 * ppat label_map | Capture of id | Constant of id * Types.const | Regexp of regexp * ppat and regexp = | Epsilon | Elem of ppat | Seq of regexp * regexp | Alt of regexp * regexp | Star of regexp | WeakStar of regexp | SeqCapture of id * regexp