gn build: Extract git() and git_out() functions in sync script
[llvm-complete.git] / examples / OCaml-Kaleidoscope / Chapter2 / toy.ml
blob42b19fec00191c86aea80c6c6f6d4d6d917bf118
1 (*===----------------------------------------------------------------------===
2 * Main driver code.
3 *===----------------------------------------------------------------------===*)
5 let main () =
6 (* Install standard binary operators.
7 * 1 is the lowest precedence. *)
8 Hashtbl.add Parser.binop_precedence '<' 10;
9 Hashtbl.add Parser.binop_precedence '+' 20;
10 Hashtbl.add Parser.binop_precedence '-' 20;
11 Hashtbl.add Parser.binop_precedence '*' 40; (* highest. *)
13 (* Prime the first token. *)
14 print_string "ready> "; flush stdout;
15 let stream = Lexer.lex (Stream.of_channel stdin) in
17 (* Run the main "interpreter loop" now. *)
18 Toplevel.main_loop stream;
21 main ()