Пример #1
0
/*!
 * \brief  Interpret the primitive tree.
 * \param  ioContext A reference to the execution context.
 * \return A handle to the result of the interpretation.
 * \throw  SCHNAPS::Core::AssertException if the primitive tree is empty.
 */
AnyType::Handle PrimitiveTree::interpret(ExecutionContext& ioContext) const {
	schnaps_StackTraceBeginM();
	schnaps_AssertM(empty() == false);
	ioContext.setPrimitiveTree(this);
	return (*this)[0].mPrimitive->execute(0, ioContext);
	schnaps_StackTraceEndM("SCHNAPS::Core::Atom::Handle SCHNAPS::Core::PrimitiveTree::interpret(SCHNAPS::Core::ExecutionContext&)");
}
Пример #2
0
/*!
 *  \brief  Valiadate the primitive tree.
 *  \param  ioContext A reference to the execution context.
 *  \throw  SCHNAPS::Core::InternalException if the primitive tree is not valid.
 */
void PrimitiveTree::validate(ExecutionContext& ioContext) const {
	schnaps_StackTraceBeginM();
	ioContext.setPrimitiveTree(this);
	if ((*this)[0].mPrimitive->isValid(0, ioContext)) {
		return;
	} else {
		throw schnaps_InternalExceptionM("Primitive tree is not valid!");
	}
	schnaps_StackTraceEndM("const std::string& SCHNAPS::Core::PrimitiveTree::getReturnType(SCHNAPS::Core::ExecutionContext&) const");
}