module Bmdfc:Bombs-Must-Detonate: Final Compilersig..end
Bombs-Must-Detonate: Final Compiler Signature
Author(s): : Brian Go, : Brian Go
typeinstruction =Bmdirc.instruction
type location =
| |
StackLoc of |
|||
| |
GlobalLoc of |
|||
| |
FunctionLoc of |
(* | Function types are stored internally as strings. The VM uses a reflection-esque mechanism to call a string. This is safe b/c the typechecker is awesome. | *) |
type loop_info =
| |
LoopBreakContinue of |
| |
LoopNoInfo |
type environment =
| |
EnvTopLevel of |
| |
EnvFrame of |
exception Compile_error of string
val raise_compile_error : string list -> 'aval make_env : unit -> environmentval get_cur_defs : environment -> (string * location) listval get_loc : string -> environment -> locationval add_loc : string * location -> environment -> environmentval isdef : string -> environment -> boolval offset_locs : int -> environment -> environmentval add_frame : environment -> environmentval remove_frame : environment -> environmentval repeat_list : 'a list -> int -> 'a listval get_restore_code : environment -> Bmdirc.instruction listval set_loop_info : loop_info -> environment -> environmentval get_break_label : environment -> stringval get_breakcontinue_restore : environment -> Bmdirc.instruction listval get_continue_label : environment -> stringval make_label : string -> stringval get_stack_offset : Bmdirc.instruction -> intval n_globals : environment -> intval compile_ir_instruction : Bmdirc.ir_instruction ->
environment -> Bmdirc.instruction list * environmentval compile_ir_instruction_list : Bmdirc.ir_buffer ->
environment -> Bmdirc.instruction list * environmentval compile_buffer : Bmdirc.ir_buffer -> Bmdirc.instruction list
Compiles an IR instruction buffer to a final instruction buffer
val string_of_buffer : Bmdirc.instruction list -> stringval print_buffer : Pervasives.out_channel -> Bmdirc.instruction list -> unit
Prints the final instruction buffer to the given output channel