(parse-to-state-machine body terminators)
Takes an sexpr and returns a hashmap that describes the execution flow of the sexpr as
a series of SSA style blocks.
Source
(defn parse-to-state-machine
"Takes an sexpr and returns a hashmap that describes the execution flow of the sexpr as
a series of SSA style blocks."
[body terminators]
(-> (gen-plan
[_ (push-binding :terminators terminators)
blk (add-block)
_ (set-block blk)
id (item-to-ssa body)
term-id (add-instruction (->Return id))
_ (pop-binding :terminators)]
term-id)
get-plan))