/[svn]/types/patterns.mli
ViewVC logotype

Contents of /types/patterns.mli

Parent Directory Parent Directory | Revision Log Revision Log


Revision 230 - (hide annotations)
Tue Jul 10 17:17:06 2007 UTC (5 years, 10 months ago) by abate
File size: 1887 byte(s)
[r2003-03-10 00:14:19 by cvscast] Empty log message

Original author: cvscast
Date: 2003-03-10 00:14:19+00:00
1 abate 107 exception Error of string
2 abate 225 open Ident
3 abate 1
4     (* Pattern algebra *)
5    
6     type descr
7     type node
8    
9     val make: fv -> node
10     val define: node -> descr -> unit
11    
12 abate 121 val constr : Types.descr -> descr
13 abate 1 val cup : descr -> descr -> descr
14 abate 121 val cap : descr -> descr -> descr
15 abate 1
16     val times : node -> node -> descr
17 abate 110 val xml : node -> node -> descr
18 abate 1 val record : Types.label -> node -> descr
19    
20 abate 225 val capture : id -> descr
21     val constant: id -> Types.const -> descr
22 abate 1
23     val id: node -> int
24     val descr: node -> descr
25     val fv : node -> fv
26    
27     (* Pattern matching: static semantics *)
28    
29     val accept : node -> Types.node
30 abate 225 val filter : Types.descr -> node -> (id * Types.node) list
31 abate 1
32 abate 145
33 abate 146 (*
34 abate 145 module Compiler: sig
35     type dispatcher
36 abate 146 val make_dispatcher :
37     Types.descr ->
38     (node option * Types.descr) SortedList.t -> dispatcher
39 abate 145 val print_disp: Format.formatter -> dispatcher -> unit
40 abate 146 val demo: Format.formatter -> descr -> Types.descr -> unit
41 abate 145 end
42 abate 146 *)
43 abate 145
44 abate 1 (* Pattern matching: compilation *)
45    
46 abate 43 module Compile: sig
47     type dispatcher
48 abate 45
49 abate 56 type actions =
50 abate 172 | AIgnore of result
51     | AKind of actions_kind
52 abate 56 and actions_kind = {
53 abate 45 basic: (Types.descr * result) list;
54     prod: result dispatch dispatch;
55 abate 110 xml: result dispatch dispatch;
56 abate 45 record: record option;
57     }
58 abate 229 and record =
59 abate 230 | RecLabel of Types.label * result dispatch dispatch
60     | RecNolabel of result option * result option
61 abate 45 and 'a dispatch =
62 abate 172 | Dispatch of dispatcher * 'a array
63     | TailCall of dispatcher
64     | Ignore of 'a
65     | Impossible
66 abate 45
67     and result = int * source array
68     and source =
69 abate 172 | Catch | Const of Types.const
70     | Left of int | Right of int | Recompose of int * int
71 abate 45
72     val actions: dispatcher -> actions
73    
74 abate 46 val make_branches :
75 abate 148 Types.descr -> (node * 'a) list ->
76 abate 225 dispatcher * (int id_map * 'a) array
77 abate 149
78 abate 229 val print_dispatcher: Format.formatter -> dispatcher -> unit
79    
80 abate 149 val debug_compile : Format.formatter -> Types.node -> node list -> unit
81 abate 1 end

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