Complete 1.02.p.1: Tiger lexer
[tiger.ml.git] / tiger / src / exe / tigerc.ml
1 open Printf
2
3 let () =
4 let path_to_program_file = Sys.argv.(1) in
5 let ic = open_in path_to_program_file in
6 let lexbuf = Lexing.from_channel ic in
7 let rec parse_and_print () =
8 let token = Tiger.Lexer.token lexbuf in
9 printf "%s\n" (Tiger.Parser.Token.to_string token);
10 match token with
11 | Tiger.Parser.Token.EOF -> ()
12 | _ -> parse_and_print ()
13 in
14 parse_and_print ();
15 close_in ic;
This page took 0.043036 seconds and 4 git commands to generate.