mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 08:10:50 +01:00
18 lines
452 B
C++
18 lines
452 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
|