49 bool IsList()
const {
return m_type == SEXPR_TYPE::SEXPR_TYPE_LIST; }
50 bool IsSymbol()
const {
return m_type == SEXPR_TYPE::SEXPR_TYPE_ATOM_SYMBOL; }
51 bool IsString()
const {
return m_type == SEXPR_TYPE::SEXPR_TYPE_ATOM_STRING; }
52 bool IsDouble()
const {
return m_type == SEXPR_TYPE::SEXPR_TYPE_ATOM_DOUBLE; }
53 bool IsInteger()
const {
return m_type == SEXPR_TYPE::SEXPR_TYPE_ATOM_INTEGER; }
54 void AddChild(
SEXPR* aChild );
55 SEXPR_VECTOR
const * GetChildren()
const;
56 SEXPR * GetChild(
size_t aIndex )
const;
57 size_t GetNumberOfChildren()
const;
58 int64_t GetLongInteger()
const;
59 int32_t GetInteger()
const;
60 float GetFloat()
const;
61 double GetDouble()
const;
62 std::string
const & GetString()
const;
63 std::string
const & GetSymbol()
const;
65 std::string AsString(
size_t aLevel = 0)
const;
66 size_t GetLineNumber()
const {
return m_lineNumber; }
70 SEXPR( SEXPR_TYPE aType,
size_t aLineNumber );
71 SEXPR( SEXPR_TYPE aType );
159 type( Type::INT ) { u.int_value = aValue; }
162 type( Type::LONGINT ) { u.lint_value = aValue; }
165 type( Type::DOUBLE ) { u.dbl_value = aValue; }
168 type( Type::STRING ) { u.str_value = aValue; }
171 type( Type::SEXPR_STRING ) { u.sexpr_str = &aValue; }
174 type( Type::STRING_COMP ) { str_value = *aValue; }
177 type( Type::STRING_COMP ) { str_value = aValue; }
180 type( Type::STRING_COMP ) { str_value = aValue; }
185 enum class Type :
char { INT, DOUBLE, STRING, LONGINT, STRING_COMP,
SEXPR_STRING };
193 std::string* str_value;
197 std::string str_value;
204 type( Type::INT ) { u.int_value = aValue; }
207 type( Type::LONGINT ) { u.lint_value = aValue; }
210 type( Type::DOUBLE ) { u.dbl_value = aValue; }
213 type( Type::STRING ) { str_value = aValue; }
216 type( Type::STRING ) { str_value = aValue; }
219 type( Type::SEXPR_STRING ) { str_value = aValue._String; u.symbol = aValue._Symbol; }
222 type( Type::SEXPR_ATOM ) { u.sexpr_ptr = aPointer; }
227 enum class Type :
char { INT, DOUBLE, STRING, LONGINT,
SEXPR_STRING, SEXPR_ATOM };
239 std::string str_value;
245 SEXPR_LIST() :
SEXPR( SEXPR_TYPE::SEXPR_TYPE_LIST ), m_inStreamChild( 0 ) {};
248 SEXPR( SEXPR_TYPE::SEXPR_TYPE_LIST, aLineNumber), m_inStreamChild( 0 ) {};
250 template <
typename... Args>
252 SEXPR( SEXPR_TYPE::SEXPR_TYPE_LIST ), m_inStreamChild( 0 )
254 AddChildren(args...);
257 SEXPR_VECTOR m_children;
259 template <
typename... Args>
260 size_t Scan(
const Args&... args )
263 return doScan( arg_array,
sizeof...( Args ) );
266 template <
typename... Args>
267 void AddChildren(
const Args&... args )
270 doAddChildren( arg_array,
sizeof...( Args ) );