sencha-lang/Sencha-lang/AST/IncorrectExpression.h

34 lines
776 B
C++

/*
* IncorrectExpression.h
*
* Created on: Dec 6, 2012
* Author: attero
*/
#ifndef INCORRECTEXPRESSION_H_
#define INCORRECTEXPRESSION_H_
#include "ASTExpression.h"
#include <iostream>
/**
* IncorrectExpression is created when something semantically wrong happens
* in our SenchaCode, it conveys message of what happened and should be
* helpful for programmer.
*/
class IncorrectExpression: public ASTExpression {
public:
std::string error_message;
virtual SenchaObject evaluate() ;
SenchaObject execute() { std::cout << debug(); return SenchaObject();}
std::string debug() { return "Incorrect Expression:\n" + error_message; }
IncorrectExpression( std::string error_message);
virtual ~IncorrectExpression();
};
#endif /* INCORRECTEXPRESSION_H_ */