40 #include <boost/functional/hash.hpp> 48 using boost::hash_combine;
64 return theSymbolTable;
68 strNcmp (CStr a, CStr b,
size_t len)
70 return a == b ? 0 : std::strncmp (a?a:
"", b?b:
"", len);
82 Symbol::Symbol (
string&& definition)
83 :
Literal{symbolTable().internedString (forward<string> (definition))}
90 Symbol Symbol::BOTTOM =
"⟂";
91 Symbol Symbol::FAILURE =
"↯";
104 return 0 == strNcmp (this->str_, charPtr, STRING_MAX_RELEVANT);
119 const char *pos = literal;
120 for ( ; cnt <= STRING_MAX_RELEVANT and *pos ; ++cnt, ++pos )
121 hash_combine(hash, *pos);
size_t hash_value(Symbol sym)
hash value for Symbols is directly based on the symbol table entry
inline string literal This is a marker type to indicate that
bool operator==(CStr cString) const
equality on Literal and Symbol values is defined based on the content, not the address.
const size_t STRING_MAX_RELEVANT
safety guard: maximum number of chars to process.
Implementation namespace for support and library code.
Token or Atom with distinct identity.
Registry table for automatically interned strings.
Marker types to indicate a literal string and a Symbol.
HashVal hash_value(QueryText const &entry)
support using queries in hashtables.
Table for automatically interned strings.