## symbolmapstack.api
#
# Nomenclature:
# The central frontend datastructure of a compiler is
# traditionally called its "symbolmapstack". Our symbol
# table is a stack of maps from symbols to various relevant
# types, so we call is out "symbolmapstack" instead.
#
# See overview comments in
#
#
src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack.pkg# Compiled by:
#
src/lib/compiler/front/typer-stuff/typecheckdata.sublib# First-time readers should see OVERVIEW section in:
#
#
src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack.pkgstipulate
package adl = module_level_declarations; # module_level_declarations is from
src/lib/compiler/front/typer-stuff/modules/module-level-declarations.pkg package sxe = symbolmapstack_entry; # symbolmapstack_entry is from
src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack-entry.pkg package sy = symbol; # symbol is from
src/lib/compiler/front/basics/map/symbol.pkgherein
api Symbolmapstack {
#
# Symbol tables now optionally contain modtrees anchored at
# namings. This allows for rapid on-demand construction of
# modmaps (= pickling/unpickling contexts).
#
# March 2000, Matthias Blume
Symbolmapstack;
Entry = sxe::Symbolmapstack_Entry; #
Full_Entry = { entry: Entry,
modtree: Null_Or( adl::Modtree ) #
};
exception UNBOUND;
empty: Symbolmapstack;
get: (Symbolmapstack, sy::Symbol) #
->
Entry;
bind: (sy::Symbol, Entry, Symbolmapstack)
->
Symbolmapstack;
special: ((sy::Symbol -> Entry), (Void -> List( sy::Symbol ) ))
->
Symbolmapstack;
atop: (Symbolmapstack, Symbolmapstack)
->
Symbolmapstack;
consolidate: Symbolmapstack
->
Symbolmapstack;
consolidate_lazy: Symbolmapstack
->
Symbolmapstack;
apply: ((sy::Symbol, Entry) -> Void)
->
Symbolmapstack
->
Void;
map: (Entry -> Entry)
->
Symbolmapstack
->
Symbolmapstack;
fold: ((((sy::Symbol, Entry)), X) -> X)
->
X
->
Symbolmapstack
->
X;
fold_full_entries
:
(((sy::Symbol, Full_Entry), X) -> X)
->
X
->
Symbolmapstack
->
X;
to_sorted_list: Symbolmapstack
->
List ((sy::Symbol, Entry));
bind_full_entry
:
( sy::Symbol,
Full_Entry,
Symbolmapstack
)
->
Symbolmapstack;
symbols: Symbolmapstack
->
List( sy::Symbol );
filter: ( Symbolmapstack,
List( sy::Symbol )
)
->
Symbolmapstack;
}; # Api Symbolmapstack
end; # stipulate
## (C) 2001 Lucent Technologies, Bell Labs
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.