24 Atom(
const std::string & value);
39 bool isNone()
const noexcept;
51 std::string
asSymbol()
const noexcept;
59 enum Type {NoneKind, NumberKind, SymbolKind};
72 void setNumber(
double value);
75 void setSymbol(
const std::string & value);
~Atom()
Atom destructor.
Definition: atom.cpp:64
double asNumber() const noexcept
value of Atom as a number, return 0 if not a Number
Definition: atom.cpp:104
bool isSymbol() const noexcept
predicate to determine if an Atom is of type Symbol
Definition: atom.cpp:80
bool operator==(const Atom &right) const noexcept
equality comparison based on type and value
Definition: atom.cpp:121
Atom & operator=(const Atom &x)
Assign an Atom.
Definition: atom.cpp:48
Value class representing a token.
Definition: token.hpp:15
Atom()
Construct a default Atom of type None.
Definition: atom.cpp:8
double numberValue
Definition: atom.hpp:67
std::ostream & operator<<(std::ostream &out, const Atom &a)
output stream rendering
Definition: atom.cpp:159
bool isNumber() const noexcept
predicate to determine if an Atom is of type Number
Definition: atom.cpp:76
A variant type that may be a Number or Symbol or the default type None.
Definition: atom.hpp:14
std::string stringValue
Definition: atom.hpp:68
bool operator!=(const Atom &left, const Atom &right) noexcept
inequality comparison for Atom
Definition: atom.cpp:153
bool isNone() const noexcept
predicate to determine if an Atom is of type None
Definition: atom.cpp:72
std::string asSymbol() const noexcept
value of Atom as a number, returns empty-string if not a Symbol
Definition: atom.cpp:110