55 std::shared_ptr<Expression>
lhs;
59 std::shared_ptr<Expression>
rhs;
61 std::shared_ptr<ModToken>
token;
125 return "BinaryExpression";
133 return std::static_pointer_cast<BinaryExpression>(shared_from_this());
140 return std::static_pointer_cast<const BinaryExpression>(shared_from_this());
161 std::shared_ptr<Expression>
get_lhs() const noexcept {
179 std::shared_ptr<Expression>
get_rhs() const noexcept {
194 void set_lhs(std::shared_ptr<Expression>&&
lhs);
199 void set_lhs(
const std::shared_ptr<Expression>&
lhs);
216 void set_rhs(std::shared_ptr<Expression>&&
rhs);
221 void set_rhs(
const std::shared_ptr<Expression>&
rhs);
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
Auto generated AST classes declaration.
Represent token returned by scanner.
Represents binary expression in the NMODL.
void set_parent_in_children()
Set this object as parent for all the children.
void set_lhs(std::shared_ptr< Expression > &&lhs)
Setter for member variable BinaryExpression::lhs (rvalue reference)
BinaryExpression * clone() const override
Return a copy of the current node.
std::shared_ptr< ModToken > token
token with location information
virtual ~BinaryExpression()=default
const BinaryOperator & get_op() const noexcept
Getter for member variable BinaryExpression::op.
std::shared_ptr< const Ast > get_shared_ptr() const override
Get std::shared_ptr from this pointer of the current ast node.
std::shared_ptr< Ast > get_shared_ptr() override
Get std::shared_ptr from this pointer of the current ast node.
AstNodeType get_node_type() const noexcept override
Return type (ast::AstNodeType) of ast node.
const ModToken * get_token() const noexcept override
Return associated token for the current ast node.
BinaryOperator op
Operator.
void set_token(const ModToken &tok)
Set token for the current ast node.
bool is_binary_expression() const noexcept override
Check if the ast node is an instance of ast::BinaryExpression.
std::shared_ptr< Expression > lhs
LHS of the binary expression.
void visit_children(visitor::Visitor &v) override
visit children i.e.
void set_rhs(std::shared_ptr< Expression > &&rhs)
Setter for member variable BinaryExpression::rhs (rvalue reference)
BinaryExpression(Expression *lhs, const BinaryOperator &op, Expression *rhs)
void set_op(BinaryOperator &&op)
Setter for member variable BinaryExpression::op (rvalue reference)
void accept(visitor::Visitor &v) override
accept (or visit) the current AST node using provided visitor
std::shared_ptr< Expression > get_lhs() const noexcept
Getter for member variable BinaryExpression::lhs.
std::shared_ptr< Expression > get_rhs() const noexcept
Getter for member variable BinaryExpression::rhs.
std::shared_ptr< Expression > rhs
RHS of the binary expression.
std::string get_node_type_name() const noexcept override
Return type (ast::AstNodeType) of ast node as std::string.
Operator used in ast::BinaryExpression.
Base class for all expressions in the NMODL.
Abstract base class for all constant visitors implementation.
Abstract base class for all visitors implementation.
Auto generated AST classes declaration.
AstNodeType
Enum type for every AST node type.
@ BINARY_EXPRESSION
type of ast::BinaryExpression
Abstract Syntax Tree (AST) related implementations.