本文整理匯總了C++中TList::insere方法的典型用法代碼示例。如果您正苦於以下問題:C++ TList::insere方法的具體用法?C++ TList::insere怎麽用?C++ TList::insere使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TList
的用法示例。
在下文中一共展示了TList::insere方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: syntacticList
/*****************************************************************************************************
* syntacticList -> faz analise de uma lista
* TIL => token com o '~'
* Retorna => tipo especializado
*
****************************************************************************************************/
TList* Syntactic::syntacticList(TokenType *til){
TokenType *buffer, *token;
TList *list = new TList();
list->setList(til); //seta token lista ~
buffer = lex->getToken(); //pega o '('
if(buffer->getToken() == "("){
buffer = lex->getToken(); //pega o primeiro elemento da lista
if(buffer->getToken() == ",") //se for ',' erro
erro->showError(" digito, string, variavel esperado mas: ", buffer->getLine(), buffer->getColumn(), buffer->getToken());
while(buffer->getToken() != ")"){ //enquanto nao for ')'
list->insere(buffer); //coloca o valor na lista
token = lex->getToken(); //pega as virgulas
if(token->getToken() != "," && token->getToken() != ")")
erro->showError(" , esperado mas: ", token->getLine(), token->getColumn(), token->getToken());
else if(token->getToken() != "," && token->getToken() == ")") break;
else buffer = lex->getToken(); //pega os valores
}
buffer = lex->getToken(); //proximo token tem que ser '!'
if(buffer->getClasse() != END_CMD) erro->showError(" ! esperado mas: ", buffer->getLine(), buffer->getColumn(), buffer->getToken());
}
else erro->showError(" ( esperado mas: ", buffer->getLine(), buffer->getColumn(), buffer->getToken());
return list;
}