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

Contents of /parser/ast.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 159 - (hide annotations)
Tue Jul 10 17:11:29 2007 UTC (5 years, 10 months ago) by abate
File size: 1841 byte(s)
[r2002-11-26 09:25:47 by cvscast] Empty log message

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

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