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

Contents of /types/patterns.mli

Parent Directory Parent Directory | Revision Log Revision Log


Revision 243 - (show annotations)
Tue Jul 10 17:18:44 2007 UTC (5 years, 10 months ago) by abate
File size: 1933 byte(s)
[r2003-03-15 10:59:53 by cvscast] map pour les chars et les atoms

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

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