Bash++
Bash++ compiler internal documentation
BashArithmeticStatement.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <AST/ASTNode.h>
10
11namespace AST {
12
20 public:
22 constexpr AST::NodeType getType() const override { return static_type; }
23
24 std::ostream& prettyPrint(std::ostream& os, int indentation_level = 0) const override {
25 std::string indent(indentation_level * PRETTYPRINT_INDENTATION_AMOUNT, ' ');
26 os << indent << "(BashArithmeticStatement";
27 for (const auto& child : children) {
28 os << std::endl;
29 child->prettyPrint(os, indentation_level + 1);
30 }
31 os << ")" << std::flush;
32 return os;
33 }
34};
35
36} // namespace AST
#define PRETTYPRINT_INDENTATION_AMOUNT
Definition ASTNode.h:18
std::vector< std::shared_ptr< ASTNode > > children
Definition ASTNode.h:30
Represents a single arithmetic statement in an arithmetic for loop condition. E.g....
Definition BashArithmeticStatement.h:19
constexpr AST::NodeType getType() const override
Definition BashArithmeticStatement.h:22
static constexpr AST::NodeType static_type
Definition BashArithmeticStatement.h:21
std::ostream & prettyPrint(std::ostream &os, int indentation_level=0) const override
Definition BashArithmeticStatement.h:24
Base class for string-type nodes in the AST.
Definition StringType.h:22
Definition AccessModifier.h:8
NodeType
Definition NodeTypes.h:9