1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (* This apparently useless implementation file is in fact required
17 by the pa_ocamllex syntax extension *)
18
19 (* The shallow abstract syntax *)
20
21 type location = {
22 loc_file : string;
23 start_pos : int;
24 end_pos : int;
25 start_line : int;
26 start_col : int;
27 }
28
29 type regular_expression =
30 Epsilon
31 | Characters of Cset.t
32 | Eof
33 | Sequence of regular_expression * regular_expression
34 | Alternative of regular_expression * regular_expression
35 | Repetition of regular_expression
36 | Bind of regular_expression * (string * location)
37
38 type ('arg,'action) entry =
39 {name:string ;
40 shortest : bool ;
41 args : 'arg ;
42 clauses : (regular_expression * 'action) list}
43
44 type lexer_definition = {
45 header: location;
46 entrypoints: ((string list, location) entry) list;
47 trailer: location;
48 refill_handler : location option;
49 }
50