本文整理汇总了C++中Bindings::getPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ Bindings::getPointer方法的具体用法?C++ Bindings::getPointer怎么用?C++ Bindings::getPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bindings
的用法示例。
在下文中一共展示了Bindings::getPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exec
//.........这里部分代码省略.........
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " global ref '" << value.string() << "' is " << stack.back() << '\n';
}
break;
case Instruction::INIT_GLOBAL:
{
const Value &intialisedValue = handleInit(Bindings::Global, value, stack, bindings);
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " global init '" << value.string() << "' to " << intialisedValue << '\n';
}
}
break;
case Instruction::ASSIGN_GLOBAL:
{
const Value &assignedValue = handleAssign(Bindings::Global, value, stack, bindings);
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " global assign '" << value.string() << "' to " << assignedValue << '\n';
}
}
break;
case Instruction::REF_CLOSURE:
handleRef(Bindings::Closure, value, stack, bindings);
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " closure ref '" << value.string() << "' is " << stack.back() << '\n';
}
break;
case Instruction::INIT_CLOSURE:
{
Identifier identifier = Identifier(value.string());
Bindings::ValuePtr &binding = bindings.getPointer(identifier);
closureValues.push_back(ClosedNameAndValue(identifier, binding));
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " closure init '" << value.string() << "' is " << *binding << '\n';
}
}
break;
case Instruction::ASSIGN_CLOSURE:
{
const Value &assignedValue = handleAssign(Bindings::Closure, value, stack, bindings);
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " closure assign '" << value.string() << "' to " << assignedValue << '\n';
}
}
break;
case Instruction::MEMBER_ACCESS:
{
if(settings_.trace)
{
std::cout << "DEBUG: " << it->sourceLocation() << " member access " << value << '\n';
}
assert(value.isString());
const std::string &memberName = value.string();
Value top = pop(stack);
if(!top.isObject())
{
throw ExecutionError(it->sourceLocation(), "Member access instruction requires an object but got " + str(top));
}
const Value::Object &object = top.object();
Value::Object::const_iterator memberIterator = object.find(memberName);