2002-10-30 02:33:50 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
2002-10-30 02:33:50 -08:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
2012-10-15 10:50:56 -07:00
|
|
|
(* This apparently useless implementation file is in fact required
|
2002-10-30 02:33:50 -08:00
|
|
|
by the pa_ocamllex syntax extension *)
|
|
|
|
|
|
|
|
(* The shallow abstract syntax *)
|
|
|
|
|
2013-09-04 08:12:37 -07:00
|
|
|
type location = {
|
|
|
|
loc_file : string;
|
|
|
|
start_pos : int;
|
|
|
|
end_pos : int;
|
|
|
|
start_line : int;
|
|
|
|
start_col : int;
|
|
|
|
}
|
2002-10-30 02:33:50 -08:00
|
|
|
|
|
|
|
type regular_expression =
|
|
|
|
Epsilon
|
|
|
|
| Characters of Cset.t
|
|
|
|
| Eof
|
|
|
|
| Sequence of regular_expression * regular_expression
|
|
|
|
| Alternative of regular_expression * regular_expression
|
|
|
|
| Repetition of regular_expression
|
2007-01-29 08:44:16 -08:00
|
|
|
| Bind of regular_expression * (string * location)
|
2002-10-30 02:33:50 -08:00
|
|
|
|
|
|
|
type ('arg,'action) entry =
|
|
|
|
{name:string ;
|
|
|
|
shortest : bool ;
|
|
|
|
args : 'arg ;
|
|
|
|
clauses : (regular_expression * 'action) list}
|
|
|
|
|
2014-03-14 08:39:32 -07:00
|
|
|
type lexer_definition = {
|
|
|
|
header: location;
|
|
|
|
entrypoints: ((string list, location) entry) list;
|
|
|
|
trailer: location;
|
|
|
|
refill_handler : location option;
|
|
|
|
}
|