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

Contents of /parser/ast.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 225 - (hide annotations)
Tue Jul 10 17:16:34 2007 UTC (5 years, 10 months ago) by abate
File size: 1830 byte(s)
[r2003-03-08 15:10:01 by cvscast] Empty log message

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

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