Module Fang
High-level compiler interface.
While most of Fang's internals are architecture-agnostic, all the functionality here is specialized to the x86-64 architecture for convenience.
Unlike the functionality in Fang_x64
, these functions compile Tiger "end-to-end": from parsing to producing output.
Compilation errors
type error
=[
|
`Parsing of parsing_error * source_span
|
`Validation of validation_error * source_span
]
val pp_error : error Fmt.t
Compilation
val compile_to_tiger : Stdlib.Lexing.lexbuf -> (unit Fmt.t, error) Stdlib.result
val compile_to_ir : ?safe:bool -> Stdlib.Lexing.lexbuf -> (unit Fmt.t, error) Stdlib.result
val compile_to_canonical_ir : ?safe:bool -> Stdlib.Lexing.lexbuf -> (unit Fmt.t, error) Stdlib.result
val compile_to_flow : ?safe:bool -> Stdlib.Lexing.lexbuf -> (unit Fmt.t, error) Stdlib.result
val compile_to_allocated_flow : ?safe:bool -> Stdlib.Lexing.lexbuf -> (unit Fmt.t, error) Stdlib.result
val compile_to_asm : ?safe:bool -> Stdlib.Lexing.lexbuf -> (unit Fmt.t, error) Stdlib.result
Advanced interfaces
These interfaces are more flexible then the simple functions above, but most of the time that flexibility shouldn't be required.
module Compile_to_tiger : functor (T : TIGER) -> sig ... end
module Compile_to_ir : functor (I : IR) -> sig ... end
module Compile_to_canonical_ir : functor (I : IR) -> sig ... end
module Compile_to_flow : sig ... end
module Compile_to_allocated_flow : sig ... end