1 (****************************************************************************)
5 (* INRIA Rocquencourt *)
7 (* Copyright 2006 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed under *)
9 (* the terms of the GNU Library General Public License, with the special *)
10 (* exception on linking described in LICENSE at the top of the Objective *)
11 (* Caml source tree. *)
13 (****************************************************************************)
16 * - Daniel de Rauglaudre: initial version
17 * - Nicolas Pouillard: refactoring
25 match find_tree lev.lsuffix with
27 match find_tree lev.lprefix with
28 [ None -> find_levels levs
33 [ Snterm e -> if e.ename = s then Some e else None
34 | Snterml e _ -> if e.ename = s then Some e else None
35 | Smeta _ sl _ -> find_symbol_list sl
36 | Slist0 s -> find_symbol s
37 | Slist0sep s _ -> find_symbol s
38 | Slist1 s -> find_symbol s
39 | Slist1sep s _ -> find_symbol s
40 | Sopt s -> find_symbol s
41 | Stree t -> find_tree t
42 | Sself | Snext | Stoken _ | Stoken_fun _ -> None ]
46 match find_symbol s with
47 [ None -> find_symbol_list sl
52 [ Node {node = s; brother = bro; son = son} ->
53 match find_symbol s with
55 match find_tree bro with
56 [ None -> find_tree son
59 | LocAct _ _ | DeadEnd -> None ]
63 match find_levels levs with
65 | None -> raise Not_found ]
66 | Dparser _ -> raise Not_found ]