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

Contents of /parser/ast.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 110 - (hide annotations)
Tue Jul 10 17:07:14 2007 UTC (5 years, 10 months ago) by abate
File size: 1800 byte(s)
[r2002-11-10 22:26:37 by cvscast] Passage au type XML

Original author: cvscast
Date: 2002-11-10 22:26:39+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     ]
21 abate 4
22 abate 43
23 abate 4 and pexpr = pexpr' located
24     and pexpr' =
25 abate 54 | Forget of pexpr * ppat
26 abate 4 (* CDuce is a Lambda-calculus ... *)
27     | Var of string
28     | Apply of pexpr * pexpr
29     | Abstraction of abstr
30    
31     (* Data constructors *)
32     | Cst of Types.const
33     | Pair of pexpr * pexpr
34 abate 110 | Xml of pexpr * pexpr
35 abate 4 | RecordLitt of (Types.label * pexpr) list
36    
37     (* Data destructors *)
38 abate 16 | Op of string * pexpr list
39 abate 4 | Match of pexpr * branches
40     | Map of pexpr * branches
41 abate 26 | Dot of (pexpr* Types.label)
42 abate 64
43     (* Exceptions *)
44     | Try of pexpr * branches
45    
46 abate 4 and abstr = {
47     fun_name : string option;
48     fun_iface : (ppat * ppat) list;
49     fun_body : branches
50     }
51    
52     and branches = (ppat * pexpr) list
53    
54     (* A common syntactic class for patterns and types *)
55    
56     and ppat = ppat' located
57     and ppat' =
58     | PatVar of string
59     | Recurs of ppat * (string * ppat) list
60     | Internal of Types.descr
61     | Or of ppat * ppat
62 abate 54 | And of ppat * ppat * bool
63 abate 4 | Diff of ppat * ppat
64     | Prod of ppat * ppat
65 abate 110 | XmlT of ppat * ppat
66 abate 4 | Arrow of ppat * ppat
67     | Record of Types.label * bool * ppat
68     | Capture of Patterns.capture
69     | Constant of Patterns.capture * Types.const
70     | Regexp of regexp * ppat
71    
72     and regexp =
73     | Epsilon
74     | Elem of ppat
75     | Seq of regexp * regexp
76     | Alt of regexp * regexp
77     | Star of regexp
78     | WeakStar of regexp
79     | SeqCapture of Patterns.capture * regexp
80    

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