summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot/ocamlcbin1038797 -> 1038908 bytes
-rwxr-xr-xboot/ocamldepbin287905 -> 287994 bytes
-rwxr-xr-xboot/ocamllexbin164441 -> 164510 bytes
-rw-r--r--byterun/parsing.c9
-rw-r--r--stdlib/parsing.ml3
-rw-r--r--stdlib/parsing.mli7
6 files changed, 19 insertions, 0 deletions
diff --git a/boot/ocamlc b/boot/ocamlc
index fee7c69e8..37d8b3eed 100755
--- a/boot/ocamlc
+++ b/boot/ocamlc
Binary files differ
diff --git a/boot/ocamldep b/boot/ocamldep
index 42625ace4..f30800392 100755
--- a/boot/ocamldep
+++ b/boot/ocamldep
Binary files differ
diff --git a/boot/ocamllex b/boot/ocamllex
index 6e372b04d..3ef8cc643 100755
--- a/boot/ocamllex
+++ b/boot/ocamllex
Binary files differ
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. *)
(**/**)