2024-02-27 08:45:58 +01:00

34 lines
533 B
C++

#pragma once
#include "AST/Base.h"
#include <string>
namespace ast
{
class BinExpr : public Expr
{
public:
BinExpr(const Expr *left, const std::string &op, const Expr *right)
: left(left), op(op), right(right) {}
~BinExpr()
{
delete left;
delete right;
}
const Expr *left;
const std::string op;
const Expr *right;
};
class PrefExpr : public Expr
{
public:
PrefExpr(const Expr *expr) : expr(expr) {}
~PrefExpr() { delete expr; }
const Expr *expr;
};
}