本文整理汇总了C++中OperationArgs::evaluate_reg_to_object方法的典型用法代码示例。如果您正苦于以下问题:C++ OperationArgs::evaluate_reg_to_object方法的具体用法?C++ OperationArgs::evaluate_reg_to_object怎么用?C++ OperationArgs::evaluate_reg_to_object使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OperationArgs
的用法示例。
在下文中一共展示了OperationArgs::evaluate_reg_to_object方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
extern "C" closure builtin_function_reapply(OperationArgs& Args)
{
int index1 = Args.reference(0).as_index_var();
int R1 = Args.current_closure().lookup_in_env( index1 );
int index2 = Args.reference(1).as_index_var();
int R2 = Args.current_closure().lookup_in_env( index2 );
expression_ref apply_E;
{
expression_ref fE = index_var(1);
expression_ref argE = index_var(0);
apply_E = (fE, argE);
}
// %1 %0 {R1,R2}
int apply_reg = Args.allocate({apply_E,{R1, R2}});
// FIXME - aren't we trying to eliminate general evaluation of regs that aren't children? See below:
// Evaluate the newly create application reg - and depend upon it!
if (Args.evaluate_changeables())
Args.evaluate_reg_to_object(apply_reg);
return {index_var(0),{apply_reg}};
}
示例2: v
extern "C" closure builtin_function_vector_from_list(OperationArgs& Args)
{
object_ptr<EVector> v (new EVector);
const closure* top = &Args.evaluate_slot_to_closure(0);
while(top->exp.size())
{
assert(has_constructor(top->exp,":"));
assert(top->exp.size() == 2);
int element_index = top->exp.sub()[0].as_index_var();
int element_reg = top->lookup_in_env( element_index );
int next_index = top->exp.sub()[1].as_index_var();
int next_reg = top->lookup_in_env( next_index );
// Add the element to the list.
v->push_back( Args.evaluate_reg_to_object(element_reg) );
// Move to the next element or end
top = &Args.evaluate_reg_to_closure(next_reg);
}
assert(has_constructor(top->exp,"[]"));
return v;
}