NEST
2.6.0,not_revisioned_source_dir@0
|
#include <dictstack.h>
Public Member Functions | |
DictionaryStack (const Token &=Token()) | |
DictionaryStack (const DictionaryStack &) | |
~DictionaryStack () | |
void | cache_token (const Name &n, const Token *result) |
Add a token to the cache. More... | |
void | basecache_token (const Name &n, const Token *result) |
void | clear_token_from_cache (const Name &n) |
Clear a name from the cache. More... | |
void | clear_token_from_basecache (const Name &n) |
void | clear_dict_from_cache (DictionaryDatum d) |
void | clear_cache () |
Clear the entire cache. More... | |
const Token & | lookup (const Name &n) |
const Token & | lookup2 (const Name &n) |
const Token & | baselookup (const Name &n) |
Lookup a name searching only the bottom level dictionary. More... | |
bool | known (const Name &n) |
Test for a name searching all dictionaries on the stack. More... | |
bool | baseknown (const Name &n) |
Test for a name in the bottom level dictionary. More... | |
void | def (const Name &, const Token &) |
Bind a Token to a Name in the top level dictionary. More... | |
void | undef (const Name &) |
Unbind a previously defined Name from its token. More... | |
void | basedef (const Name &n, const Token &t) |
Bind a Token to a Name in the bottom level dictionary. More... | |
void | def_move (const Name &, Token &) |
Bind a Token to a Name in the top level dictionary. More... | |
void | set_basedict () |
This function must be called once to initialize the systemdict cache. More... | |
void | basedef_move (const Name &n, Token &t) |
Bind a Token to a Name in the bottom level dictionary. More... | |
bool | where (const Name &, Token &) |
void | pop (void) |
void | top (Token &) const |
void | push (const DictionaryDatum &) |
void | push (Token &) |
void | clear (void) |
void | toArray (TokenArray &) const |
size_t | size (void) const |
void | info (std::ostream &) const |
void | top_info (std::ostream &) const |
const DictionaryStack & | operator= (const DictionaryStack &) |
Private Attributes | |
const Token | VoidToken |
std::list< DictionaryDatum > | d |
DictionaryDatum | base_ |
std::vector< const Token * > | cache_ |
std::vector< const Token * > | basecache_ |
DictionaryStack::DictionaryStack | ( | const DictionaryStack & | ds | ) |
DictionaryStack::~DictionaryStack | ( | ) |
References d.
References basecache_, Name::num_handles(), and Name::toIndex().
Referenced by basedef(), basedef_move(), baseknown(), and baselookup().
Bind a Token to a Name in the bottom level dictionary.
The Token is copied.
References base_, basecache_token(), clear_token_from_cache(), and nest::names::n.
Referenced by SLIInterpreter::basedef().
Bind a Token to a Name in the bottom level dictionary.
The Token is moved.
References base_, basecache_token(), and clear_token_from_cache().
Referenced by SLIInterpreter::basedef_move().
|
inline |
Test for a name in the bottom level dictionary.
References base_, basecache_, basecache_token(), cache_token(), Name::toIndex(), and where().
Referenced by SLIInterpreter::baseknown().
Lookup a name searching only the bottom level dictionary.
If the Name is not found, VoidToken is returned.
References base_, basecache_, basecache_token(), cache_token(), Name::toIndex(), VoidToken, and where().
Referenced by SLIInterpreter::baselookup().
Add a token to the cache.
References cache_, Name::num_handles(), and Name::toIndex().
Referenced by baseknown(), baselookup(), def(), def_move(), known(), and lookup2().
void DictionaryStack::clear | ( | void | ) |
References clear_cache(), and d.
|
inline |
|
inline |
References clear_token_from_cache().
Referenced by CleardictFunction::execute(), pop(), and push().
|
inline |
References basecache_, and Name::toIndex().
Referenced by undef().
|
inline |
Clear a name from the cache.
This function should be called in each def variant.
References cache_, and Name::toIndex().
Referenced by basedef(), basedef_move(), clear_dict_from_cache(), DictputFunction::execute(), UndefFunction::execute(), and undef().
Bind a Token to a Name in the top level dictionary.
The Token is copied.
References cache_token(), and d.
Referenced by SLIInterpreter::def().
Bind a Token to a Name in the top level dictionary.
The Token is moved.
References cache_token(), and d.
Referenced by SLIInterpreter::createcommand(), SLIInterpreter::createconstant(), SLIInterpreter::createdouble(), and SLIInterpreter::def_move().
void DictionaryStack::info | ( | std::ostream & | o | ) | const |
References d.
Referenced by WhoFunction::execute(), and top_info().
|
inline |
Test for a name searching all dictionaries on the stack.
References cache_, cache_token(), d, Name::toIndex(), and where().
Referenced by SLIInterpreter::createcommand(), and SLIInterpreter::known().
References lookup2(), and VoidToken.
Referenced by SLIInterpreter::lookup().
References cache_, cache_token(), d, Name::toIndex(), Name::toString(), and where().
Referenced by lookup(), and SLIInterpreter::lookup2().
const DictionaryStack & DictionaryStack::operator= | ( | const DictionaryStack & | ds | ) |
void DictionaryStack::pop | ( | void | ) |
void DictionaryStack::push | ( | const DictionaryDatum & | pd | ) |
void DictionaryStack::push | ( | Token & | d | ) |
References assert(), Token::datum(), and push().
void DictionaryStack::set_basedict | ( | ) |
This function must be called once to initialize the systemdict cache.
Referenced by SLIInterpreter::initdictionaries().
size_t DictionaryStack::size | ( | void | ) | const |
References d.
Referenced by DictendFunction::execute(), CountdictstackFunction::execute(), and CleardictstackFunction::execute().
void DictionaryStack::toArray | ( | TokenArray & | ta | ) | const |
References d, TokenArray::erase(), and TokenArray::push_back().
Referenced by DictstackFunction::execute(), and SLIInterpreter::raiseerror().
void DictionaryStack::top | ( | Token & | t | ) | const |
References d, nest::names::dt, and Token::move().
Referenced by CurrentdictFunction::execute().
void DictionaryStack::top_info | ( | std::ostream & | o | ) | const |
Referenced by DicttopinfoFunction::execute().
void DictionaryStack::undef | ( | const Name & | n | ) |
Unbind a previously defined Name from its token.
Seach in all dictionaries.
References clear_token_from_basecache(), clear_token_from_cache(), d, and Name::toString().
Referenced by SLIInterpreter::undef().
Referenced by baseknown(), baselookup(), known(), and lookup2().
|
private |
Referenced by basedef(), basedef_move(), baseknown(), baselookup(), and set_basedict().
|
private |
Referenced by basecache_token(), baseknown(), baselookup(), and clear_token_from_basecache().
|
private |
Referenced by cache_token(), clear_cache(), clear_token_from_cache(), known(), lookup2(), and operator=().
|
private |
Referenced by clear(), def(), def_move(), info(), known(), lookup2(), operator=(), pop(), push(), set_basedict(), size(), toArray(), top(), top_info(), undef(), and ~DictionaryStack().
|
private |
Referenced by baselookup(), and lookup().