1 (**************************************************************************)
5 (* François Pottier, INRIA Rocquencourt *)
6 (* Yann Régis-Gianas, PPS, Université Paris Diderot *)
8 (* Copyright 2005-2008 Institut National de Recherche en Informatique *)
9 (* et en Automatique. All rights reserved. This file is distributed *)
10 (* under the terms of the Q Public License version 1.0, with the change *)
11 (* described in file LICENSE. *)
13 (**************************************************************************)
15 (* This module provides some type and function definitions
16 that help deal with the keywords that we recognize within
19 (* The user can request position information either at type
20 [int] (a simple offset) or at type [Lexing.position]. *)
26 (* The user can request position information about the
27 start or end of a symbol. *)
33 (* The user can request position information about a production's
34 left-hand side or about one of the symbols in its right-hand
35 side, which he can refer to by position or by name. *)
40 | RightNamed
of string
42 (* Keywords inside semantic actions. They allow access to semantic
43 values or to position information. *)
47 | Position
of subject
* where
* flavor
51 (* This maps a [Position] keyword to the name of the variable that the
52 keyword is replaced with. *)
54 val posvar
: subject
-> where
-> flavor
-> string
56 (* Sets of keywords. *)
61 (* This converts a list of keywords with positions into a set of keywords. *)
62 val from_list
: elt list
-> t
64 end with type elt
= keyword
66 (* (\* TEMPORARY These functions are replaced by the ones found *)
67 (* in [Action]. *\) *)
68 (* (\* These iterate over a list of keywords with positions, disregarding *)
69 (* the positions, and making sure that duplicate elements are not *)
72 (* val iter: (keyword -> unit) -> (keyword * 'a * 'b) list -> unit *)
73 (* val fold: (keyword -> 'c -> 'c) -> (keyword * 'a * 'b) list -> 'c -> 'c *)
75 (* (\* These tell whether a list of keywords with positions contains *)
76 (* a certain keyword. *\) *)
78 (* val has_previouserror: (keyword * 'a * 'b) list -> bool *)
79 (* val has_syntaxerror: (keyword * 'a * 'b) list -> bool *)
80 (* val has_leftstart: (keyword * 'a * 'b) list -> bool *)
81 (* val has_leftend: (keyword * 'a * 'b) list -> bool *)
82 (* val has_dollar: int -> (keyword * 'a * 'b) list -> bool *)