Initial state - basic lexer + parser + interpreter

This commit is contained in:
Emin Arslan
2025-10-12 21:33:57 +03:00
committed by Emin Arslan
commit aa066f87d0
12 changed files with 301 additions and 0 deletions

17
bin/main.ml Normal file
View File

@@ -0,0 +1,17 @@
open Lisp.Ast;;
open Printf;;
open Lisp;;
open Eval;;
open Read;;
let rec repl c =
let () = printf ">>> "; Out_channel.flush Out_channel.stdout; in
match In_channel.input_line c with
| None -> ()
| Some l ->
let vals = (parse_str l) in
(* dbg_print_all vals; *)
dbg_print_all (eval_all vals);
Out_channel.flush Out_channel.stdout;
repl c;;
let _ = repl (In_channel.stdin)