diff options
author | Maxence Guesdon <maxence.guesdon@inria.fr> | 2001-12-03 22:16:03 +0000 |
---|---|---|
committer | Maxence Guesdon <maxence.guesdon@inria.fr> | 2001-12-03 22:16:03 +0000 |
commit | ef3d334d4a207ad31d9c7f74f4cc3d5259047e49 (patch) | |
tree | 45ac1116188ad95167b4c2d621fac2241d2ce9a1 /stdlib/parsing.mli | |
parent | 966c128bc96118fb12c753c01bf5f134c888e61a (diff) | |
download | ocaml-ef3d334d4a207ad31d9c7f74f4cc3d5259047e49.tar.gz |
commentaires après
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4083 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/parsing.mli')
-rw-r--r-- | stdlib/parsing.mli | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/parsing.mli b/stdlib/parsing.mli index 8bb403858a..168089e0b0 100644 --- a/stdlib/parsing.mli +++ b/stdlib/parsing.mli @@ -14,37 +14,37 @@ (** The run-time library for parsers generated by [ocamlyacc]. *) +val symbol_start : unit -> int (** [symbol_start] and {!Parsing.symbol_end} are to be called in the action part of a grammar rule only. They return the position of the string that matches the left-hand side of the rule: [symbol_start()] returns the position of the first character; [symbol_end()] returns the position of the last character, plus one. The first character in a file is at position 0. *) -val symbol_start : unit -> int -(** See {!Parsing.symbol_start}. *) val symbol_end : unit -> int +(** See {!Parsing.symbol_start}. *) +val rhs_start : int -> int (** Same as {!Parsing.symbol_start} and {!Parsing.symbol_end}, but return the position of the string matching the [n]th item on the right-hand side of the rule, where [n] is the integer parameter to [lhs_start] and [lhs_end]. [n] is 1 for the leftmost item. *) -val rhs_start: int -> int +val rhs_end : int -> int (** See {!Parsing.rhs_start}. *) -val rhs_end: int -> int +val clear_parser : unit -> unit (** Empty the parser stack. Call it just after a parsing function has returned, to remove all pointers from the parser stack to structures that were built by semantic actions during parsing. This is optional, but lowers the memory requirements of the programs. *) -val clear_parser : unit -> unit +exception Parse_error (** Raised when a parser encounters a syntax error. Can also be raised from the action part of a grammar rule, to initiate error recovery. *) -exception Parse_error (**/**) @@ -77,7 +77,7 @@ type parse_tables = exception YYexit of Obj.t val yyparse : - parse_tables -> int -> (Lexing.lexbuf -> 'a) -> Lexing.lexbuf -> 'b + parse_tables -> int -> (Lexing.lexbuf -> 'a) -> Lexing.lexbuf -> 'b val peek_val : parser_env -> int -> 'a val is_current_lookahead : 'a -> bool val parse_error : string -> unit |