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

37 lines
789 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() ;
void execute() { std::cout << debug(); }
void execute_quietly() { //do nothing
}
std::string debug() { return "Incorrect Expression:\n" + error_message; }
IncorrectExpression( std::string error_message);
virtual ~IncorrectExpression();
};
#endif /* INCORRECTEXPRESSION_H_ */