module Bmdtc:Bombs-Must-Detonate: BMDLang Type Checkersig..end
Bombs-Must-Detonate: BMDLang Type Checker Signature
Author(s): Brian Go, Brian Go
type bmdtype =
| |
TyInt |
| |
TyFloat |
| |
TyString |
| |
TyBool |
| |
TyVoid |
| |
TyList of |
| |
TyEnumType of |
| |
TyEnum of |
| |
TyStruct of |
| |
TyArray of |
| |
TyArrow of |
| |
TyRef of |
| |
TyTemplate of |
type typeenvdef =
| |
TyEnumDef of |
| |
TyStructDef of |
| |
TyFunDef of |
| |
TyVarDef of |
| |
TyTemplateDef of |
| |
TyIncludeDef of |
Used to keep track of the typing environment during typechecking
exception Type_error of string
val elim_repeats : 'a list -> 'a listval link_buffer : string list Pervasives.refval reset_link_buffer : unit -> unit
Resets the buffer which stores the linker header information generated by the typechecker.
val get_link_buffer : unit -> string
Gets the linker header information.
val append_link_buffer : string -> unitval raise_type_error : string list -> 'aval concat : string list -> stringval concat_commas : string list -> stringval get_first : ('a * 'b) list -> 'a listval get_second : ('a * 'b) list -> 'b listval isdef_struct : string -> typeenvdef list -> boolval isdef_enum : string -> typeenvdef list -> boolval isdef_var : string -> typeenvdef list -> boolval isdef_fun : string -> typeenvdef list -> boolval isdef_templated : string -> typeenvdef list -> boolval remove_template_def : typeenvdef list -> typeenvdef listval isdef_ident : string -> typeenvdef list -> boolval gettype_var : string -> typeenvdef list -> bmdtypeval gettype_fun : string -> typeenvdef list -> bmdtypeval is_enum_value : string -> string -> typeenvdef list -> boolval isdef_include : string -> typeenvdef list -> boolval indexof : 'a -> 'a list -> int -> intval get_enum_value : string -> string -> typeenvdef list -> intval get_nvalues_enum : string -> typeenvdef list -> intval is_struct_value : string -> string -> typeenvdef list -> boolval gettype_struct : string -> string -> typeenvdef list -> bmdtypeval getfield_struct : string -> string -> typeenvdef list -> intval getfields_struct : string -> typeenvdef list -> (string * bmdtype) listval nfields_struct : string -> typeenvdef list -> intval get_struct_data_type_list : string -> typeenvdef list -> Ast.data_type listval annotate_data_type : Ast.data_type -> typeenvdef list -> unitval make_struct_type_list : Ast.var_declare list -> typeenvdef list -> Ast.data_type listval string_of_type : bmdtype -> string
Gives a string representation of a given type.
val expanded_string_of_enum : string -> typeenvdef list -> stringval expanded_string_of_struct : string -> typeenvdef list -> stringval expanded_string_of_type : bmdtype -> typeenvdef list -> stringval isallowed_binop : Ast.binop -> bmdtype -> bmdtype -> boolval gettype_binop : Ast.binop -> bmdtype -> bmdtype -> bmdtypeval type_data_types : Ast.data_type list -> typeenvdef list -> bmdtype listval type_data_type : Ast.data_type -> typeenvdef list -> bmdtypeval structdef_list : Ast.var_declare list ->
typeenvdef list -> (string * bmdtype) listval vardef_arglist : (Ast.data_type * string) list ->
typeenvdef list -> typeenvdef listval type_value : Ast.value -> typeenvdef list -> bmdtype * typeenvdef listval string_of_type_list : bmdtype list -> stringval are_assoclists_compatible : (string * bmdtype) list -> (string * bmdtype) list -> boolval unify_types : bmdtype -> bmdtype -> (string * bmdtype) listval insert_template_types : (string * bmdtype) list ->
typeenvdef list -> bmdtype -> bmdtypeval apply_arrow_type : bmdtype -> bmdtype list -> typeenvdef list -> bmdtypeval type_function_call_value : Ast.function_call ->
typeenvdef list -> bmdtype * typeenvdef listval type_binop : Ast.value_producer ->
Ast.binop ->
Ast.value_producer ->
typeenvdef list -> bmdtype * typeenvdef listval type_prefix_unop : Ast.pre_unop ->
Ast.value_producer ->
typeenvdef list -> bmdtype * typeenvdef listval type_array_value_producer : Ast.value_producer list ->
typeenvdef list -> bmdtype * typeenvdef listval type_value_producer_list : Ast.value_producer list ->
typeenvdef list -> bmdtype * typeenvdef listelem1; elem2;...) Error if empty or
if values of different types are used.val type_list_value_producer : Ast.list_value_producer ->
typeenvdef list -> bmdtype * typeenvdef listval type_value_producer : Ast.value_producer ->
typeenvdef list -> bmdtype * typeenvdef listval type_value_producer_list_nonuniform : Ast.value_producer list ->
typeenvdef list -> bmdtype list * typeenvdef listval type_variable_identifier : Ast.var_ident ->
typeenvdef list -> bmdtype * typeenvdef listval type_var_assign : Ast.var_assign ->
typeenvdef list -> bmdtype * typeenvdef listval type_var_declaration : Ast.var_declare ->
typeenvdef list -> bmdtype * typeenvdef listval type_conditional : Ast.conditional ->
typeenvdef list ->
bmdtype -> bmdtype * typeenvdef listval type_continued_conditional : Ast.continued_conditional ->
typeenvdef list ->
bmdtype -> bmdtype * typeenvdef listval type_loop : Ast.loop ->
typeenvdef list ->
bmdtype -> bmdtype * typeenvdef listval type_function_call : Ast.function_call ->
typeenvdef list ->
bmdtype -> bmdtype * typeenvdef listval type_expression : Ast.expression ->
typeenvdef list ->
bmdtype -> bmdtype * typeenvdef listval type_expression_list : Ast.expression list ->
typeenvdef list ->
bmdtype -> bmdtype * typeenvdef listval type_program : Ast.src_program ->
typeenvdef list -> bmdtype * typeenvdef listval type_global_expression : Ast.global_expression ->
typeenvdef list -> bmdtype * typeenvdef listval is_typed : Ast.src_program -> bool
Determines whether an AST is validly typed. Prints typing exceptions.