mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
24 lines
546 B
C++
24 lines
546 B
C++
#ifndef EXPRESSION_NODE_H
|
|
#define EXPRESSION_NODE_H
|
|
|
|
#include "tree_node.h"
|
|
|
|
class ExpressionNode : public TreeNode {
|
|
public:
|
|
ExpressionNode() : TreeNode(TreePool::sharedPool()->generateIdentifier()) {
|
|
TreePool::sharedPool()->registerNode(this);
|
|
}
|
|
|
|
virtual float approximate() = 0;
|
|
int numberOfOperands() { return numberOfChildren(); }
|
|
ExpressionNode * operand(int i) { return static_cast<ExpressionNode *>(childAtIndex(i)); }
|
|
};
|
|
|
|
#endif
|
|
|
|
/* Code I want to write:
|
|
*
|
|
* ExpressionNode * n = new AdditionNode();
|
|
* delete n;
|
|
*/
|