56 std::shared_ptr<ModToken>
token;
129 return std::static_pointer_cast<Integer>(shared_from_this());
136 return std::static_pointer_cast<const Integer>(shared_from_this());
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
Represent token returned by scanner.
Represents an integer variable.
bool is_integer() const noexcept override
Check if the ast node is an instance of ast::Integer.
void visit_children(visitor::Visitor &v) override
visit children i.e.
void set(int _value)
Set new value to the current ast node.
std::shared_ptr< Name > macro
if integer is a macro then it's name
std::string get_node_type_name() const noexcept override
Return type (ast::AstNodeType) of ast node as std::string.
void accept(visitor::Visitor &v) override
accept (or visit) the current AST node using provided visitor
std::shared_ptr< const Ast > get_shared_ptr() const override
Get std::shared_ptr from this pointer of the current ast node.
void set_token(const ModToken &tok)
Set token for the current ast node.
void set_macro(std::shared_ptr< Name > &¯o)
Setter for member variable Integer::macro (rvalue reference)
void negate() override
Negate the value of 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.
virtual ~Integer()=default
std::shared_ptr< Ast > get_shared_ptr() override
Get std::shared_ptr from this pointer of the current ast node.
std::shared_ptr< ModToken > token
token with location information
void set_parent_in_children()
Set this object as parent for all the children.
int eval() const
Return value of the ast node.
std::shared_ptr< Name > get_macro() const noexcept
Getter for member variable Integer::macro.
int value
Value of integer.
double to_double() override
Return value of the current ast node as double.
int get_value() const noexcept
Getter for member variable Integer::value.
Integer * clone() const override
Return a copy of the current node.
void set_value(int value)
Setter for member variable Integer::value.
Base class for all numbers.
Abstract base class for all constant visitors implementation.
Abstract base class for all visitors implementation.
AstNodeType
Enum type for every AST node type.
@ INTEGER
type of ast::Integer
Abstract Syntax Tree (AST) related implementations.
Auto generated AST classes declaration.