/[svn]/typing/typed.ml
ViewVC logotype

Contents of /typing/typed.ml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 45 - (hide annotations)
Tue Jul 10 17:00:40 2007 UTC (5 years, 10 months ago) by abate
File size: 1534 byte(s)
[r2002-10-26 16:18:24 by cvscast] Empty log message

Original author: cvscast
Date: 2002-10-26 16:18:25+00:00
1 abate 4 (* Typed abstract syntax *)
2    
3 abate 5 (* Some sub-expression may have to be type-checked several times.
4     We first build the ``skeleton'' of the typed ast
5     (basically the parsed ast with types and patterns replaced with there
6     internal representation), then type check it.
7    
8     The exp_typ and br_typ fields are updated to capture all the possible
9     values than can result from the expression or flow to the branch
10     *)
11    
12 abate 4 open Location
13    
14     type tpat = Patterns.node
15     type ttyp = Types.node
16    
17 abate 9 type texpr = { exp_loc : loc;
18 abate 5 mutable exp_typ : Types.descr;
19     exp_descr : texpr';
20     }
21 abate 4 and texpr' =
22 abate 18 | DebugTyper of ttyp
23    
24 abate 4 (* CDuce is a Lambda-calculus ... *)
25     | Var of string
26     | Apply of texpr * texpr
27     | Abstraction of abstr
28    
29     (* Data constructors *)
30     | Cst of Types.const
31     | Pair of texpr * texpr
32     | RecordLitt of (Types.label * texpr) list
33    
34     (* Data destructors *)
35 abate 16 | Op of string * texpr list
36 abate 4 | Match of texpr * branches
37     | Map of texpr * branches
38 abate 26 | Dot of (texpr * Types.label)
39 abate 4
40     and abstr = {
41     fun_name : string option;
42 abate 9 fun_iface : (Types.descr * Types.descr) list;
43 abate 6 fun_body : branches;
44     fun_typ : Types.descr;
45     fun_fv : string list;
46 abate 4 }
47    
48 abate 9 and branches = {
49     mutable br_typ : Types.descr;
50 abate 19 br_accept : Types.descr;
51 abate 45 br_branches: branch list;
52    
53     mutable br_compiled : compiled_branches option;
54 abate 9 }
55     and branch = {
56     mutable br_used : bool;
57     br_pat : tpat;
58     br_body : texpr
59     }
60 abate 45 and compiled_branches = {
61     actions : Patterns.Compile.actions;
62     rhs : (texpr * (string * int) list) array
63     }

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