31 #include <boost/functional/hash.hpp> 39 using boost::hash_combine;
55 return theSymbolTable;
59 strNcmp (CStr a, CStr b,
size_t len)
61 return a == b ? 0 : std::strncmp (a?a:
"", b?b:
"", len);
73 Symbol::Symbol (
string&& definition)
74 :
Literal{symbolTable().internedString (forward<string> (definition))}
81 Symbol Symbol::BOTTOM =
"⟂";
82 Symbol Symbol::FAILURE =
"↯";
95 return 0 == strNcmp (this->str_, charPtr, STRING_MAX_RELEVANT);
110 const char *pos = literal;
111 for ( ; cnt <= STRING_MAX_RELEVANT and *pos ; ++cnt, ++pos )
112 hash_combine (hash, *pos);
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.
size_t HashVal
a STL compatible hash value
HashVal hash_value(Symbol sym)
hash value for Symbols is directly based on the symbol table entry