1 (***********************************************************************)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
11 (***********************************************************************)
17 | Pdot
of t
* string * int
24 (Pident id1
, Pident id2
) -> Ident.same id1 id2
25 | (Pdot
(p1
, s1
, pos1
), Pdot
(p2
, s2
, pos2
)) -> s1
= s2
&& same p1 p2
26 | (Papply
(fun1
, arg1
), Papply
(fun2
, arg2
)) ->
27 same fun1 fun2
&& same arg1 arg2
30 let rec isfree id
= function
31 Pident id'
-> Ident.same id id'
32 | Pdot
(p
, s
, pos
) -> isfree id p
33 | Papply
(p1
, p2
) -> isfree id p1
|| isfree id p2
35 let rec binding_time = function
36 Pident id
-> Ident.binding_time id
37 | Pdot
(p
, s
, pos
) -> binding_time p
38 | Papply
(p1
, p2
) -> max
(binding_time p1
) (binding_time p2
)
40 let rec name = function
41 Pident id
-> Ident.name id
42 | Pdot
(p
, s
, pos
) -> name p ^
"." ^ s
43 | Papply
(p1
, p2
) -> name p1 ^
"(" ^
name p2 ^
")"
45 let rec head = function
47 | Pdot
(p
, s
, pos
) -> head p
48 | Papply
(p1
, p2
) -> assert false