]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_disambiguation/test_lexer.ml
new experimental cic textual parser: checkin
[helm.git] / helm / ocaml / cic_disambiguation / test_lexer.ml
diff --git a/helm/ocaml/cic_disambiguation/test_lexer.ml b/helm/ocaml/cic_disambiguation/test_lexer.ml
new file mode 100644 (file)
index 0000000..8667953
--- /dev/null
@@ -0,0 +1,11 @@
+let ic = open_in Sys.argv.(1) in
+let token_stream = fst (Lexer.lex.Token.tok_func (Stream.of_channel ic)) in
+let rec dump () =
+  let (a,b) = Stream.next token_stream in
+  if a = "EOI" then raise Stream.Failure;
+  print_endline (Printf.sprintf "%s '%s'" a b);
+  dump ()
+in
+try
+  dump ()
+with Stream.Failure -> ()