本文整理汇总了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;
}