Bash++
Bash++ compiler internal documentation
ParameterExpansion.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <AST/ASTNode.h>
11
12namespace AST {
13
15 protected:
17 public:
19 constexpr AST::NodeType getType() const override { return static_type; }
20
24
25 void setExpansionBegin(const AST::Token<std::string>& expansionBegin) {
26 m_EXPANSIONBEGIN = expansionBegin;
27 }
28
29 std::ostream& prettyPrint(std::ostream& os, int indentation_level = 0) const override {
30 std::string indent(indentation_level * PRETTYPRINT_INDENTATION_AMOUNT, ' ');
31 os << indent << "(ParameterExpansion\n"
32 << indent << " " << m_EXPANSIONBEGIN;
33 for (const auto& child : children) {
34 os << std::endl;
35 child->prettyPrint(os, indentation_level + 1);
36 }
37 os << ")" << std::flush;
38 return os;
39 }
40};
41
42} // namespace AST
#define PRETTYPRINT_INDENTATION_AMOUNT
Definition ASTNode.h:19
std::vector< std::shared_ptr< ASTNode > > children
Definition ASTNode.h:31
Definition ParameterExpansion.h:14
constexpr AST::NodeType getType() const override
Definition ParameterExpansion.h:19
const AST::Token< std::string > & EXPANSIONBEGIN() const
Definition ParameterExpansion.h:21
static constexpr AST::NodeType static_type
Definition ParameterExpansion.h:18
AST::Token< std::string > m_EXPANSIONBEGIN
Definition ParameterExpansion.h:16
void setExpansionBegin(const AST::Token< std::string > &expansionBegin)
Definition ParameterExpansion.h:25
std::ostream & prettyPrint(std::ostream &os, int indentation_level=0) const override
Definition ParameterExpansion.h:29
Base class for string-type nodes in the AST.
Definition StringType.h:23
A class representing a token in the Bash++ AST. Tokens store their value along with line and column i...
Definition Token.h:22
Definition AccessModifier.h:9
NodeType
Definition NodeTypes.h:10