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

Contents of /parser/ast.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 433 - (show annotations)
Tue Jul 10 17:34:42 2007 UTC (5 years, 10 months ago) by abate
File size: 1845 byte(s)
[r2003-05-25 17:58:11 by cvscast] Display toplevel

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

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