本文整理汇总了C++中ArgumentList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentList::push_back方法的具体用法?C++ ArgumentList::push_back怎么用?C++ ArgumentList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentList
的用法示例。
在下文中一共展示了ArgumentList::push_back方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/* ************************************************************************* */
TEST( wrap, ArgumentList ) {
ArgumentList args;
Argument arg1; arg1.type = "double"; arg1.name = "x";
Argument arg2; arg2.type = "double"; arg2.name = "y";
Argument arg3; arg3.type = "double"; arg3.name = "z";
args.push_back(arg1);
args.push_back(arg2);
args.push_back(arg3);
EXPECT(assert_equal("ddd", args.signature()));
EXPECT(assert_equal("double,double,double", args.types()));
EXPECT(assert_equal("x,y,z", args.names()));
}
示例2: ParseArgumentList
bool ParserThread::ParseArgumentList(ArgumentList &argumentList)
{
// do nothing on the argumentList, just do the loop
if(PeekToken()->type_id() != TKN_LESS)
return true;
// shoud be a (xxxx) or <xxxxx>
Token * tk = ConsumeToken();
TRACE("ParserThread::ParseArgumentList() Enter...");
int level = 1;
argumentList.clear();
argumentList.push_back(*tk); // push <while(true)
while(true)
{
tk = PeekToken();//
if(tk->type_id() == TKN_LESS)
{
ConsumeToken();
argumentList.push_back(*tk);
level++;
}
else if (tk->type_id() == TKN_GREATER)
{
level--;
ConsumeToken();
argumentList.push_back(*tk);
if(level <= 0)
break;
}
else if(tk->type_id()==TKN_SEMICOLON || tk->type_id()==TKN_R_BRACE)
{
m_Context.EndStatement();
return false;
}
else
{
//std::cout<<*tk<<std::endl;
argumentList.push_back(*tk);
ConsumeToken();
}
}
//cout<<"currentToken"<<*(CurrentToken())<<endl;
TRACE("ParserThread::ParseArgumentList() Leave...");
return true;
}
示例3: arguments
Parser::ArgumentList Parser::arguments(istream* input)
{
ArgumentList list;
get_token(input);
for(;;)
{
if(curr_sym.curr_tok == Lexer::RP)
{
return list;
}
else if (curr_sym.curr_tok == Lexer::SEP)
{
get_token(input);
continue;
}
else if (curr_sym.curr_tok == Lexer::PRINT || curr_sym.curr_tok == Lexer::END)
{
throw Error::SyntaxError(") expected");
}
else
{
list.push_back(expr(input, false));
}
}
}
示例4: findUnknownArguments
ArgumentList ArgumentParser::findUnknownArguments() const
{
ArgumentList args;
foreach (auto& arg, m_arguments)
if (!arg.isKnown())
args.push_back(arg);
return args;
}
示例5: findArguments
ArgumentList ArgumentParser::findArguments(const Option& option) const
{
ArgumentList args;
foreach (auto& arg, m_arguments)
if (&option == arg.option)
args.push_back(arg);
return args;
}
示例6: arguments
ArgumentList arguments(istream* input)
{
ArgumentList args;
TokenList arg;
Token tok;
while((tok = get_token(input, true, false)).token != TOK_END)
{
if(tok.token == TOK_SEP || tok.token == TOK_RPAREN)
{
if(arg.size() < 1)
{
cerr << "Missing macro argument" << endl;
}
args.push_back(arg);
arg.clear();
if(tok.token == TOK_RPAREN) break;
}
else arg.push_back(tok);
}
return args;
}
示例7: arguments
ArgumentList Calculator::arguments(Lexer& lexer)
{
ArgumentList list;
for(;;)
{
Token tok = lexer.peek();
switch(tok.Type)
{
case Token::RP:
lexer.pop();
return list;
case Token::SEP:
lexer.pop();
continue;
case Token::PRINT:
case Token::END:
throw Error::SyntaxError("')' expected");
default:
list.push_back(expr(lexer));
break;
}
}
}
示例8: gatherArguments
ArgumentList gatherArguments(int argc, const char **argv, Settings &settings)
{
ArgumentList args;
for (int i = 1 ; i < argc ; ++i)
{
std::string argument = argv[i];
if (argument == "--trace")
{
std::cout << "INFO: Trace mode enabled!\n";
settings.trace = true;
}
else if (argument == "--verbose")
{
std::cout << "INFO: Verbose mode enabled!\n";
settings.verbose = true;
}
else
{
args.push_back(argument);
}
}
return args;
}