Module Fang_translate

Translating Tiger to the intermediate representation (IR).

Translation requires:

A subsequent compiler phase converts this IR to a much nicer (and shorter!) canonical form.

type 'a fragment = label * 'a

A fragment is any labelled thing.

val pp_string_fragment : string fragment Fmt.t

Pretty-print (for human consumption) a labeled string constant.

val pp_frame_fragment : box Fmt.t -> (value Pretty.t * frame_ptr) fragment Fmt.t

Pretty-print (for human consumption) a labeled subroutine consisting of pretty-printed IR and the requirements for the frame pointer.

module type TRANSLATE = sig ... end
module Translate : functor (F : FRAME) -> functor (I : IR with type 'a t = 'a F.ir) -> TRANSLATE with type 'a ir = 'a I.t