本文整理汇总了C++中ParamList::push_front方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::push_front方法的具体用法?C++ ParamList::push_front怎么用?C++ ParamList::push_front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamList
的用法示例。
在下文中一共展示了ParamList::push_front方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: i_list_prime
/**
* Function representing the <i_list_prime> productions
*/
ParamList* RecursiveDescentParser::i_list_prime() {
ParamList* pList = NULL;
if(errorCondition) return pList;
if(token == TK_COMMA)
{
#if DEBUG_PARSER
std::cout << "<i_list_prime> --> ,<var><i_list_prime>\n";
#endif
token = scanner->getToken();
VariableEntry* ve = var();
pList = i_list_prime();
pList->push_front(ve);
}
else if(token == TK_SEMICOLON)
{
#if DEBUG_PARSER
std::cout << "<i_list_prime> --> e\n";
#endif
pList = new ParamList();
}
else
{
errorHandler();
}
return pList;
}
示例2: par_dec_list
/**
* Function representing <par_dec_list> prods
*/
ParamList* RecursiveDescentParser::par_dec_list() {
ParamList* retVal = NULL;
if(errorCondition) return retVal;
if(token == TK_INT || token == TK_CHAR)
{
#if DEBUG_PARSER
std::cout << "<par_dec_list> --> <type><par_spec><par_dec_list_prime>;<par_dec_list>\n";
#endif
Type t = type();
VariableEntry* va = par_spec(t);
retVal = par_dec_list_prime(t);
retVal->push_front(va);
match(TK_SEMICOLON);
ParamList* pList = par_dec_list();
retVal->splice(retVal->end(), *pList);
delete(pList);
}
else if(token == TK_LEFT_BRACE)
{
#if DEBUG_PARSER
std::cout << "<par_dec_list> --> e\n";
#endif
retVal = new ParamList();
}
else
{
errorHandler();
}
return retVal;
}
示例3: i_list
/**
* Function representing the <i_list> productions
*/
ParamList* RecursiveDescentParser::i_list() {
ParamList* pList = NULL;
if(errorCondition) return pList;
if(token == TK_IDENTIFIER) {
#if DEBUG_PARSER
std::cout << "<i_list> --> <var><i_list_prime>\n";
#endif
VariableEntry* ve = var();
pList = i_list_prime();
pList->push_front(ve);
}
else
{
errorHandler();
}
return pList;
}
示例4: par_dec_list_prime
/**
* Function representing the <par_dec_list_prime> prods
*/
ParamList* RecursiveDescentParser::par_dec_list_prime(Type type) {
ParamList* paramList = NULL;
if(errorCondition) return paramList;
if(token == TK_COMMA)
{
#if DEBUG_PARSER
std::cout << "<par_dec_list_prime> --> ,<par_spec><par_dec_list_prime>\n";
#endif
token = scanner->getToken();
VariableEntry* ve = par_spec(type);
ve->setParamFlag();
if(!ve) {
// error recovery: consume tokens until we find another comma or a semicolon
while(token != TK_EOF)
{
if(token == TK_LEFT_BRACE) {
break;
}
if(token == TK_COMMA || token == TK_SEMICOLON)
{
return par_dec_list_prime(type);
}
token = scanner->getToken();
}
return new ParamList();
}
paramList = par_dec_list_prime(type);
paramList->push_front(ve);
}
else if(token == TK_SEMICOLON)
{
#if DEBUG_PARSER
std::cout << "<par_dec_list_prime> --> e\n";
#endif
paramList = new ParamList();
}
else
{ //errorHandler();
errorHandler("missing semicolon at the end of parameter declaration", token);
}
return paramList;
}