1
// =======================================================================
3
// Filename: returnstatement.cpp
8
// Created: 18.06.2010 12:37:56
12
// Author: Dominik 'domachine' Burgdörfer (-), dominik.burgdoerfer@googlemail.com
15
// =======================================================================
17
#include "returnstatement.hpp"
18
#include "../elementstack.hpp"
19
#include "../exceptions/returnexception.hpp"
20
#include "../types/void.hpp"
21
#include "objectwrapper.hpp"
23
using namespace boost;
27
ReturnStatement::ReturnStatement(ElementStack& parent)
34
ReturnStatement::ReturnStatement(ElementStack& parent,
43
void ReturnStatement::call() {
44
if(m_element->is(Element::RESOLVABLE)) {
46
dynamic_pointer_cast<Resolvable>(m_element);
48
throw exceptions::ReturnException(ptr->resolve(),
49
"return statement outside of function",
50
parent().sourcePath(),
54
throw exceptions::ProcessingError(
55
"return: Element is not resolvable",
56
parent().sourcePath(),
60
void ReturnStatement::setElement(ElementPtr element)