throwTokenException(__FILE__,__LINE__,getFileName()+": "+string("Tried to read a token from ")+this->getName()+string(" but there are no more elements"));
throwTokenException(__FILE__,__LINE__,getFileName()+":"+string("Tried to read a string from '")+this->getLineage()+string("' but there no more elements"));
}
if(!token->isData()){
ostringstreamout;
out<<getFileName()<<": Element is not a string '";
token->toString(out,"");
// throw TokenException(__FILE__, __LINE__, getFileName() + ":" + string(" Element is not a string: "));
throwTokenException(__FILE__,__LINE__,getFileName()+": "+string("Tried to read an int from ")+this->getLineage()+string(" but there are no more elements"));
}
if(!l->isData()){
throwTokenException(__FILE__,__LINE__,getFileName()+":"+string(" Element is not a string"));
throwTokenException(__FILE__,__LINE__,getFileName()+": "+string("Tried to read a double from ")+this->getLineage()+string(" but there no more elements"));
}
if(!l->isData()){
throwTokenException(__FILE__,__LINE__,getFileName()+":"+string(" Element is not a string"));
throwTokenException(__FILE__,__LINE__,getFileName()+": "+string("Tried to read a bool from ")+this->getLineage()+string(" but there no more elements"));
}
if(!l->isData()){
throwTokenException(__FILE__,__LINE__,getFileName()+":"+string(" Element is not a string"));
}
istringstreamis(l->getName());
is>>rhs;
return*this;
}
voidToken::addToken(Token*t){
/*
if (!own){
throw TokenException(__FILE__, __LINE__, "This token does not own its own tokens, so you cannot add tokens to it");
}
*/
tokens.push_back(t);
}
Token*Token::newToken(){
Token*token=newToken();
addToken(token);
returntoken;
}
staticboolneedQuotes(conststd::string&what){
/* ripped from tokenreader.cpp, maybe use a variable for nice sharing.. */