https://github.com/FujiiMaika/fscd21.git
Revision ee3dc2469cc2dff1b6a00be6c96e8ce51997f219 authored by FujiiMaika on 24 June 2021, 05:34:17 UTC, committed by FujiiMaika on 24 June 2021, 05:34:17 UTC
0 parent
Raw File
Tip revision: ee3dc2469cc2dff1b6a00be6c96e8ce51997f219 authored by FujiiMaika on 24 June 2021, 05:34:17 UTC
first commit
Tip revision: ee3dc24
main.ml
(* main *)
let go () =
  let program = Parser.expr Lexer.token (Lexing.from_channel stdin) in
  if Array.length Sys.argv = 1 then begin
    print_string "Parsed : ";
    Syntax.print program;               (* input *)
    print_newline ();
    print_string "Result : "
  end;
  print_string (Value.to_string (Eval.f program)) ;(* result *)
  print_newline ()

(* startup *)
let _ = go ()
back to top