PreviousUpNext

15.3.251  src/lib/compiler/front/typer-stuff/basics/symbol-hashtable-stack.api

## symbol-hashtable-stack.api 

# Compiled by:
#     src/lib/compiler/front/typer-stuff/typecheckdata.sublib



# Implementation for the eight individual subtables
# of the symbol table (one per namespace).
#
# The core implementation* datastructure is a conventional
# rw_vector-of-bucketchains hashtable.
#
# These hashtables then get layered, one per lexical scope.
#
# For more on the symbol table generally,
# see the OVERVIEW section in:
#
#     src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack.pkg


stipulate
    package sy  =  symbol;                                                                      # symbol        is from   src/lib/compiler/front/basics/map/symbol.pkg
herein

    api Symbol_Hashtable_Stack {
        #
        Symbol_Hashtable_Stack(Y);
        #
        exception UNBOUND;  

        empty: Symbol_Hashtable_Stack(Y);
        get:  (Symbol_Hashtable_Stack(Y), sy::Symbol) -> Y;
        bind: (sy::Symbol, Y, Symbol_Hashtable_Stack(Y)) -> Symbol_Hashtable_Stack(Y);

        special: ((sy::Symbol -> Y), (Void -> List(sy::Symbol))) -> Symbol_Hashtable_Stack(Y);

        atop: (Symbol_Hashtable_Stack(Y), Symbol_Hashtable_Stack(Y)) -> Symbol_Hashtable_Stack(Y);              # Atop (t1, t2): place t1 on top of t2 

        consolidate:            Symbol_Hashtable_Stack(Y) -> Symbol_Hashtable_Stack(Y);
        consolidate_lazy:       Symbol_Hashtable_Stack(Y) -> Symbol_Hashtable_Stack(Y);

        apply:  ((sy::Symbol, Y) -> Void) -> Symbol_Hashtable_Stack(Y) -> Void;
        map:    (Y -> Y) -> Symbol_Hashtable_Stack(Y) -> Symbol_Hashtable_Stack(Y);
        fold:   ((((sy::Symbol, Y)), X) -> X) -> X -> Symbol_Hashtable_Stack(Y) -> X;

        symbols:  Symbol_Hashtable_Stack(Y) -> List( sy::Symbol );                                      # May contain duplicate symbols 
    };                                                                                          # api Symbol_Hashtable_Stack
end;

## Copyright 1996 by AT&T Bell Laboratories 
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext