First commit

This commit is contained in:
elvis
2024-10-04 19:38:34 +02:00
parent 0ee328edfc
commit c1e513d3dc
12 changed files with 380 additions and 0 deletions

30
bin/main.ml Normal file
View File

@ -0,0 +1,30 @@
(*
open Lang.Exercises
(* let () = Printf.printf "%d\n" (eval_a_exp (Of_bool (Bval true))); *)
let myfsa: fsa = {vertices = (StringMap.add "node 2" true (StringMap.singleton "node 1" false));
edges = (StringMap.add "node 2" ("node 2", 'b') (StringMap.singleton "node 1" ("node 2", 'a')));
state = "node 1"}
let mystr = ['a'; 'b'; 'a'; 'b']
let ret = (Lang.Exercises.ex8 mystr myfsa);;
if ret
then print_endline "true"
else print_endline "false"
*)
open Lang.MiniImp
let program1 =
Main
("a",
"b",
(Sequence
((Assignment "x" (Integer 1)),
(Assignment "b" (Plus (Plus (Variable "a") (Variable "x")) (Variable "y"))))
)
)
Printf.printf "%d\n" (result program1 1)