37 lines
886 B
C++
37 lines
886 B
C++
/*
|
|
* BasicExpression.h
|
|
*
|
|
* Created on: Dec 5, 2012
|
|
* Author: attero
|
|
*/
|
|
|
|
#ifndef BASICEXPRESSION_H_
|
|
#define BASICEXPRESSION_H_
|
|
#include "ASTExpression.h"
|
|
|
|
class BasicExpression : public ASTExpression {
|
|
public:
|
|
//TODO change oper to enum
|
|
|
|
std::string all_operators[] = {"<", ">", "+", "-", "/", "*", "%", "&", "|", "=", ":", "==", "+=", "-=", "<=", ">=", "!=", "&&", "||"};
|
|
|
|
std::string oper;
|
|
ASTExpression * left;
|
|
ASTExpression * right;
|
|
|
|
void set_operator(std::string op);
|
|
void set_left_operand(ASTNode * left);
|
|
void set_right_operand(ASTNode * right);
|
|
virtual SenchaObject evaluate();
|
|
|
|
virtual std::string debug();
|
|
|
|
std::string debug() { return "Basic expression:\n" + "left operand: \n" +
|
|
left->debug() + "\nright operand:\n" + right->debug +"\n###\n"; }
|
|
|
|
BasicExpression(ASTNode * parent);
|
|
virtual ~BasicExpression();
|
|
};
|
|
|
|
#endif /* BASICEXPRESSION_H_ */
|