elna/source/ir.cpp

54 lines
966 B
C++
Raw Normal View History

2024-02-28 16:18:39 +01:00
#include "elna/ir.hpp"
namespace elna::ir
{
/**
* AST node.
*/
void Node::accept(IRVisitor *)
{
}
void Definition::accept(IRVisitor *visitor)
{
visitor->visit(this);
}
void Operand::accept(IRVisitor *visitor)
{
visitor->visit(this);
}
void Number::accept(IRVisitor *visitor)
{
visitor->visit(this);
}
void Variable::accept(IRVisitor *visitor)
{
visitor->visit(this);
}
BinaryExpression::BinaryExpression(Operand *lhs, Operand *rhs, BinaryOperator _operator)
{
this->lhs = lhs;
this->rhs = rhs;
this->_operator = _operator;
}
void BinaryExpression::accept(IRVisitor *visitor)
{
visitor->visit(this);
}
BangExpression::BangExpression(Operand *operand)
{
this->operand = operand;
}
void BangExpression::accept(IRVisitor *visitor)
{
visitor->visit(this);
}
}