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

Contents of /parser/ast.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 43 - (hide annotations)
Tue Jul 10 17:00:25 2007 UTC (5 years, 10 months ago) by abate
File size: 1730 byte(s)
[r2002-10-26 01:35:24 by cvscast] Empty log message

Original author: cvscast
Date: 2002-10-26 01:35:24+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     | `Compile of ppat * ppat list ]
19 abate 4
20 abate 43
21 abate 4 and pexpr = pexpr' located
22     and pexpr' =
23 abate 18 (* For debugging the typer: an expression with prescribed type *)
24     | DebugTyper of ppat
25 abate 4
26     (* 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     | RecordLitt of (Types.label * pexpr) list
35    
36     (* Data destructors *)
37 abate 16 | Op of string * pexpr list
38 abate 4 | Match of pexpr * branches
39     | Map of pexpr * branches
40 abate 26 | Dot of (pexpr* Types.label)
41 abate 4 and abstr = {
42     fun_name : string option;
43     fun_iface : (ppat * ppat) list;
44     fun_body : branches
45     }
46    
47     and branches = (ppat * pexpr) list
48    
49     (* A common syntactic class for patterns and types *)
50    
51     and ppat = ppat' located
52     and ppat' =
53     | PatVar of string
54     | Recurs of ppat * (string * ppat) list
55     | Internal of Types.descr
56     | Or of ppat * ppat
57     | And of ppat * ppat
58     | Diff of ppat * ppat
59     | Prod of ppat * ppat
60     | Arrow of ppat * ppat
61     | Record of Types.label * bool * ppat
62     | Capture of Patterns.capture
63     | Constant of Patterns.capture * Types.const
64     | Regexp of regexp * ppat
65    
66     and regexp =
67     | Epsilon
68     | Elem of ppat
69     | Seq of regexp * regexp
70     | Alt of regexp * regexp
71     | Star of regexp
72     | WeakStar of regexp
73     | SeqCapture of Patterns.capture * regexp
74    

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