Perk.Var_symbol_tableUtils for the var symbol table
val var_symbol_table :
(Ast.perkident, Ast.perktype) Stdlib.Hashtbl.t list Stdlib.refList of hash tables, one for each scope. The head of the table is the current scope.
Adds a symbol to the symbol_table symbol table. Used for scoping.
Removes the head of the symbol_table symbol table. Used for scoping.
val lookup_var_local :
(Ast.perkident, Ast.perktype) Stdlib.Hashtbl.t list Stdlib.ref ->
Ast.perkident ->
Ast.perktype optionLooks up a variable id in the symbol table symbol_table.
val lookup_var : Ast.perkident -> Ast.perktype optionLooks up a variable in the var symbol table
val print_symbol_table_local :
(string, Ast.perktype) Stdlib.Hashtbl.t list Stdlib.ref ->
unitDebug function for printing a symbol table
val bind_var_local :
(Ast.perkident, Ast.perktype) Stdlib.Hashtbl.t list Stdlib.ref ->
Ast.perkident ->
Ast.perktype ->
unitGiven a symbol table symbol_table, and identifier id and its type t, it binds id in symbol_table with type t if it is not already defined.
val bind_var : Ast.perkident -> Ast.perktype -> unitBinds a variable in the var symbol table.
val rebind_var_local :
(Ast.perkident, Ast.perktype) Stdlib.Hashtbl.t list Stdlib.ref ->
Ast.perkident ->
Ast.perktype ->
unitGiven a symbol table symbol_table, and identifier id and its type t, it checks whether id is already defined in symbol_table, and if so rebinds it with type t.
val rebind_var : Ast.perkident -> Ast.perktype -> unitRebinds a variable in the var_symbol_table