summaryrefslogtreecommitdiff
path: root/src/bin/transcriptor.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/transcriptor.ml')
-rw-r--r--src/bin/transcriptor.ml23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/bin/transcriptor.ml b/src/bin/transcriptor.ml
new file mode 100644
index 0000000..2378c5d
--- /dev/null
+++ b/src/bin/transcriptor.ml
@@ -0,0 +1,23 @@
+module T = Translator
+module P = T.Parser
+
+module Parser = P.Make(T.Sounds)
+module I = Parser.MenhirInterpreter
+
+let process (optional_line : string option) =
+ match optional_line with
+ | None -> ()
+ | Some line ->
+ match T.Reader.process line with
+ | Ok response -> print_endline response
+ | Error err -> print_endline err
+
+let rec repeat channel =
+ (* Attempt to read one line. *)
+ let optional_line, continue = T.Lexer.line channel in
+ process optional_line;
+ if continue then
+ repeat channel
+
+let () =
+ repeat (Lexing.from_channel stdin)