46 return &
static_cast< SEXPR_LIST const *
>(
this)->m_children;
56 return static_cast< SEXPR_LIST const *
>(
this)->m_children[aIndex];
78 return static_cast< SEXPR_LIST const *
>(
this)->m_children.size();
88 return static_cast< SEXPR_STRING const *
>(
this)->m_value;
112 return static_cast< SEXPR_DOUBLE const *
>(
this)->m_value;
126 return static_cast< float >(
GetDouble() );
133 std::string err_msg(
"GetSymbol(): SEXPR is not a symbol type! error line ");
138 return static_cast< SEXPR_SYMBOL const *
>(
this)->m_value;
163 result.append( aLevel * 2,
' ' );
169 for( std::vector<SEXPR *>::const_iterator it = list->begin(); it != list->end(); ++it )
171 result += (*it)->AsString( aLevel );
173 if( it != list->end() - 1 )
192 std::stringstream out;
198 std::stringstream out;
199 out << std::setprecision( 16 ) <<
GetDouble();
273 list.AddChild(
res );
289 if( child->IsInteger() )
291 inte = child->GetInteger();
296 throw std::invalid_argument(
"SEXPR is not a integer type!" );
306 if( child->IsString() || child->IsSymbol() )
308 str = child->GetString();
313 throw std::invalid_argument(
"SEXPR is not a string type!" );
323 if( child->IsInteger() )
325 lint = child->GetLongInteger();
330 throw std::invalid_argument(
"SEXPR is not a long integer type!");
339 if( child->IsDouble() )
341 fl = child->GetFloat();
346 throw std::invalid_argument(
"SEXPR is not a float type!" );
356 if( child->IsDouble() )
358 dbl = child->GetDouble();
363 throw std::invalid_argument(
"SEXPR is not a double type!" );
375 if( child->IsSymbol() )
377 is.
_String = child->GetSymbol();
382 throw std::invalid_argument(
"operator>>: SEXPR is not a symbol type!" );
387 if( child->IsString() )
389 is.
_String = child->GetString();
394 throw std::invalid_argument(
"SEXPR is not a string type!" );
412 for( i = 0; i < num_args; i++ )
429 if( child->IsSymbol() )
433 else if( child->IsString() )
456 if( child->IsSymbol() )
458 if( child->GetSymbol() != arg.
str_value )
463 else if( child->IsString() )
465 if( child->GetString() != arg.
str_value )
473 throw std::invalid_argument(
"unsupported argument type, this shouldn't have happened" );
489 for( i = 0; i < num_args; i++ )
526 throw std::invalid_argument(
"unexpected argument type, this shouldn't have happened" );
virtual void DeserializeSEXPR(SEXPR &sexp)
virtual SEXPR * SerializeSEXPR() const
union SEXPR::SEXPR_CHILDREN_ARG::@140153117255347061025000322060345331135151360226 u
void doAddChildren(const SEXPR_CHILDREN_ARG *args, size_t num_args)
size_t doScan(const SEXPR_SCAN_ARG *args, size_t num_args)
union SEXPR::SEXPR_SCAN_ARG::@066014047110022234005207275010144102035233327174 u
SEXPR_VECTOR const * GetChildren() const
void AddChild(SEXPR *aChild)
std::string const & GetSymbol() const
std::string AsString(size_t aLevel=0) const
int32_t GetInteger() const
size_t GetNumberOfChildren() const
int64_t GetLongInteger() const
std::string const & GetString() const
SEXPR(SEXPR_TYPE aType, size_t aLineNumber)
SEXPR * GetChild(size_t aIndex) const
size_t GetLineNumber() const
SEXPR_LIST & operator>>(SEXPR_LIST &input, ISEXPRABLE &obj)
SEXPR_LIST & operator<<(SEXPR_LIST &list, const ISEXPRABLE &obj)
std::vector< class SEXPR * > SEXPR_VECTOR
@ SEXPR_TYPE_ATOM_INTEGER
const std::string & _String
wxString result
Test unit parsing edge cases and error handling.