Files
lci/bin/main.ml

23 lines
585 B
OCaml
Raw Normal View History

2024-11-20 00:13:05 +01:00
open MiniImp
let () =
let program = "def main with input x output y as
x := 2;
if y < 0 then (
y := x + 3;
x := y;
) else
x := 1 - y;" in
let get_result x = Lexing.from_string x |> Parser.prg Lexer.lex in
let p = get_result program in
2024-11-27 20:18:30 +01:00
let convertedcfg = CfgImp.convert_io p 3 in
Printf.printf "%a" CfgImp.SSCfg.pp convertedcfg;
let convertedrisccfg = CfgRISC.convert convertedcfg in
2024-11-20 00:13:05 +01:00
2024-11-27 20:18:30 +01:00
Printf.printf "%a" CfgRISC.RISCCfg.pp convertedrisccfg