本文整理汇总了C++中Package::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Package::empty方法的具体用法?C++ Package::empty怎么用?C++ Package::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package::empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Package
Package TParser :: execute(int & pos)
{
deque<TScanner :: TToken> & lst(*generated_tokens);
switch (lst[pos].token_name)
{
case TScanner :: assign :
if (lst[pos] == token_round_bracket_l || lst[pos] == token_rect_bracket_l || lst[pos] == token_italian_bracket_l)
{
auto tmp = execute(++pos);
if (tmp.code_seg == NULL || tmp.code_seg -> title == "")
Error.message("Invalid expression occured.");
string title = tmp.code_seg -> title;
auto target = keyword_vtable.find(title);
if (target != keyword_vtable.end())
{
TProcessor * op = target -> second;
auto t = op -> proc(pos, lst);
return t;
} else {
TSeq_arg in_pending;
Package next;
while (true)
{
next = execute(pos);
if (next.empty())
break;
// std :: cerr << next << ' ';
in_pending.push_back(next);
}
//std :: cerr << "for function #" << title << "#" << std :: endl;
arg_stack.push_back(in_pending);
int p;
Package ret_p;
bool is_static;
bool is_renewable = true;
long long x;
long long y;
if (tmp.code_seg -> l == 0 && tmp.code_seg -> r == 0)
{
auto tg = symbol_table.find(title);
if (tg == symbol_table.end())
Error.message("Invalid operator #" + title + "# found.");
auto static_flag = static_def_list.find(title);
is_static = (static_flag != static_def_list.end());
x = (in_pending.size() > 0 && in_pending[0].int_val != NULL) ? (*in_pending[0].int_val) : 0;
y = (in_pending.size() > 1 && in_pending[1].int_val != NULL) ? (*in_pending[1].int_val) : 0;
if (is_static)
{
if (in_pending[0].int_val != NULL)
{
auto saved_valuex = static_flag -> second.find(*in_pending[0].int_val);
if (saved_valuex != static_flag -> second.end())
{
auto saved_value = saved_valuex -> second.find(y);
if (saved_value != saved_valuex -> second.end())
{
is_renewable = false;
ret_p = saved_value -> second;
}
}
} else {
Error.message("Fatal : A non-staticizeable function is under such a attempt.");
}
}
p = tg -> second.l;
} else {
p = tmp.code_seg -> l;
}
if (ret_p.empty())
ret_p = execute(p);
if (is_static && is_renewable)
{
static_def_list[title][x][y] = ret_p;
}
arg_stack.pop_back();
return ret_p;
}
} else {
pos++;
return Package();
}
break;
case TScanner :: id :
++pos;
if (arg_symbol_stack.empty() || arg_symbol_stack[arg_symbol_stack.size() - 1].find(Scanner.seq_identifier[lst[pos - 1].attribute_value]) == arg_symbol_stack[arg_symbol_stack.size() - 1].end())
return Package(Scanner.seq_identifier[lst[pos - 1].attribute_value], 0, 0);
else
return get_arg(arg_symbol_stack[arg_symbol_stack.size() - 1][Scanner.seq_identifier[lst[pos - 1].attribute_value]]);
break;
case TScanner :: immediate_int :
return Package(Scanner.seq_imm_int[lst[pos++].attribute_value]);
break;
case TScanner :: immediate_str :
return Package(Scanner.seq_imm_str[lst[pos++].attribute_value]);
break;
}
return Package();
}