/[svn]/parser/ast.ml
ViewVC logotype

Contents of /parser/ast.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 431 - (show annotations)
Tue Jul 10 17:34:25 2007 UTC (5 years, 10 months ago) by abate
File size: 1874 byte(s)
[r2003-05-25 16:53:21 by cvscast] toplevel

Original author: cvscast
Date: 2003-05-25 16:53:22+00:00
1 (* Abstract syntax as produced by the parsed *)
2
3 open Location
4 open Ident
5
6 type pprog = pmodule_item list
7
8 and pmodule_item = pmodule_item' located
9 and pmodule_item' =
10 | TypeDecl of string * ppat
11 | PatDecl of string * ppat
12 | LetDecl of ppat * pexpr
13 | FunDecl of pexpr
14 | EvalStatement of pexpr
15 | Debug of debug_directive
16 and debug_directive =
17 [ `Filter of ppat * ppat
18 | `Sample of ppat
19 | `Accept of ppat
20 | `Compile of ppat * ppat list
21 | `Subtype of ppat * ppat
22 ]
23
24
25 and pexpr =
26 | LocatedExpr of loc * pexpr
27
28 | Forget of pexpr * ppat
29 | Op of string * pexpr list
30
31 (* CDuce is a Lambda-calculus ... *)
32 | Var of id
33 | Apply of pexpr * pexpr
34 | Abstraction of abstr
35
36 (* Data constructors *)
37 | Cst of Types.const
38 | Pair of pexpr * pexpr
39 | Xml of pexpr * pexpr
40 | RecordLitt of pexpr label_map
41
42 (* Data destructors *)
43 | Match of pexpr * branches
44 | Map of pexpr * branches
45 | Transform of pexpr * branches
46 | Xtrans of pexpr * branches
47 | Dot of pexpr* label
48 | RemoveField of pexpr * label
49
50 (* Exceptions *)
51 | Try of pexpr * branches
52
53 and abstr = {
54 fun_name : id option;
55 fun_iface : (ppat * ppat) list;
56 fun_body : branches
57 }
58
59 and branches = (ppat * pexpr) list
60
61 (* A common syntactic class for patterns and types *)
62
63 and ppat = ppat' located
64 and ppat' =
65 | PatVar of string
66 | Recurs of ppat * (string * ppat) list
67 | Internal of Types.descr
68 | Or of ppat * ppat
69 | And of ppat * ppat
70 | Diff of ppat * ppat
71 | Prod of ppat * ppat
72 | XmlT of ppat * ppat
73 | Arrow of ppat * ppat
74 | Optional of ppat
75 | Record of bool * ppat label_map
76 | Capture of id
77 | Constant of id * Types.const
78 | Regexp of regexp * ppat
79
80 and regexp =
81 | Epsilon
82 | Elem of ppat
83 | Seq of regexp * regexp
84 | Alt of regexp * regexp
85 | Star of regexp
86 | WeakStar of regexp
87 | SeqCapture of id * regexp

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5