Merge commit 'ocaml3102'
[ocaml.git] / lex / syntax.mli
blob4864b50ee9421a068a403efd984947e7d93be5a9
1 (***********************************************************************)
2 (* *)
3 (* Objective Caml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
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. *)
10 (* *)
11 (***********************************************************************)
13 (* $Id$ *)
15 (* The shallow abstract syntax *)
17 type location =
18 { start_pos: int;
19 end_pos: int;
20 start_line: int;
21 start_col: int }
23 type regular_expression =
24 Epsilon
25 | Characters of Cset.t
26 | Eof
27 | Sequence of regular_expression * regular_expression
28 | Alternative of regular_expression * regular_expression
29 | Repetition of regular_expression
30 | Bind of regular_expression * (string * location)
32 type ('arg,'action) entry =
33 {name:string ;
34 shortest : bool ;
35 args : 'arg ;
36 clauses : (regular_expression * 'action) list}
38 type lexer_definition =
39 { header: location;
40 entrypoints: ((string list, location) entry) list;
41 trailer: location }