diff options
-rwxr-xr-x | boot/ocamlc | bin | 1038797 -> 1038908 bytes | |||
-rwxr-xr-x | boot/ocamldep | bin | 287905 -> 287994 bytes | |||
-rwxr-xr-x | boot/ocamllex | bin | 164441 -> 164510 bytes | |||
-rw-r--r-- | byterun/parsing.c | 9 | ||||
-rw-r--r-- | stdlib/parsing.ml | 3 | ||||
-rw-r--r-- | stdlib/parsing.mli | 7 |
6 files changed, 19 insertions, 0 deletions
diff --git a/boot/ocamlc b/boot/ocamlc Binary files differindex fee7c69e8..37d8b3eed 100755 --- a/boot/ocamlc +++ b/boot/ocamlc diff --git a/boot/ocamldep b/boot/ocamldep Binary files differindex 42625ace4..f30800392 100755 --- a/boot/ocamldep +++ b/boot/ocamldep diff --git a/boot/ocamllex b/boot/ocamllex Binary files differindex 6e372b04d..3ef8cc643 100755 --- a/boot/ocamllex +++ b/boot/ocamllex diff --git a/byterun/parsing.c b/byterun/parsing.c index 2d90fa552..23228bf7b 100644 --- a/byterun/parsing.c +++ b/byterun/parsing.c @@ -291,3 +291,12 @@ CAMLprim value caml_parse_engine(struct parser_tables *tables, } } + +/* Control printing of debugging info */ + +CAMLprim value caml_set_parser_trace(value flag) +{ + value oldflag = Val_bool(caml_parser_trace); + caml_parser_trace = Bool_val(flag); + return oldflag; +} diff --git a/stdlib/parsing.ml b/stdlib/parsing.ml index 8df008c5c..2b4d93ddb 100644 --- a/stdlib/parsing.ml +++ b/stdlib/parsing.ml @@ -78,6 +78,9 @@ external parse_engine : parse_tables -> parser_env -> parser_input -> Obj.t -> parser_output = "caml_parse_engine" +external set_trace: bool -> bool + = "caml_set_parser_trace" + let env = { s_stack = Array.create 100 0; v_stack = Array.create 100 (Obj.repr ()); diff --git a/stdlib/parsing.mli b/stdlib/parsing.mli index c6dc8e321..c323922cf 100644 --- a/stdlib/parsing.mli +++ b/stdlib/parsing.mli @@ -59,6 +59,13 @@ exception Parse_error Can also be raised from the action part of a grammar rule, to initiate error recovery. *) +val set_trace: bool -> bool +(** Control debugging support for [ocamlyacc]-generated parsers. + After [Parsing.set_trace true], the pushdown automaton that + executes the parsers prints a trace of its actions (reading a token, + shifting a state, reducing by a rule) on standard output. + [Parsing.set_trace false] turns this debugging trace off. + The boolean returned is the previous state of the trace flag. *) (**/**) |