#include "command.h" #include "astbranch.h" #include using namespace Bu; Command::Command() : pAst( NULL ) { } Command::~Command() { delete pAst; } void Command::addLiteral( const Bu::String &sValue ) { lChunks.append( Chunk( true, sValue ) ); } void Command::addParam( const Bu::String &sValue ) { lChunks.append( Chunk( false, sValue ) ); } void Command::setAst( class AstBranch *pAst ) { this->pAst = pAst; } void Command::print() { sio << "command:"; for( ChunkList::iterator i = lChunks.begin(); i; i++ ) { if( (*i).bLiteral ) sio << " \"" << (*i).sValue << "\""; else sio << " " << (*i).sValue; } sio << *pAst << sio.nl; }