Module Bmdl (.ml)


module Bmdl: sig .. end
Bombs-Must-Detonate: Linker
Author(s): Brian Go

type provide_environment = string list 
List of provided function names
type type_environment = (string * Linkst.link_type) list 
Association list of function name - function types
exception Linker_error of string
val concat : string list -> string
Shorthand for String.concat ""
val raise_linker_error : string -> 'a
Raises the linker error of string s
val vm_defs : Linkst.link_expr list
VM-Provided Remotable Functions
val extract_code : Linkst.link_expr list -> string
Extracts the assembler code from the linker syntax tree
val extract_provide : Linkst.link_expr -> string list
Extracts a list of the name of a provided function from the linker syntax tree element. Nil otherwise
val extract_provide_type : Linkst.link_expr -> (string * Linkst.link_type) list
Extracts the name/type pair of a provided function from the linker syntax tree element. Nil otherwise
val extract_type : Linkst.link_expr -> (string * Linkst.link_type) list
Extracts a name/type pairs from a linker syntax tree element. Nil otherwisee
val check_duplicates : string list -> unit
Checks for duplicate function definitions. Linker error if found.
val check_require : string list -> Linkst.link_expr -> unit
Check required function against provided functions (just names, not types. Linker error if not fouond
val are_assoclists_compatible : ('a * 'b) list -> ('a * 'b) list -> bool
Checks if two association lists are compatible (do not contain conflicting key/value pairs
val check_unified : Linkst.link_type -> Linkst.link_type -> (string * Linkst.link_type) list
Returns an association list of template types to link_types. Error if types are not unifiable.
val check_types : (string * Linkst.link_type) list -> (string * Linkst.link_type) list -> unit
Checks that the name/type list types is consistent with the name/type list of provided_types
val check_consistent : Linkst.link_expr list -> unit
Checks that all provide/require definitions in the linker syntax tree are consistent with each other

Usage: "bmdl src-file-1 output-file-1 src-file-2 output-file-2" Links src-file-1 and src-file-2 and puts the output (linker header removed) in the output files. We allow up to 2 source files to be specified because this is the max # of AIs on a team. "bmdl src-file output-file" Links a single source file (to the VM definitions) and puts the output in output-file
val main : unit -> unit