36 std::static_pointer_cast<AST::RawText>(lastChild)->appendText(text);
38 auto rawTextNode = std::make_shared<AST::RawText>();
39 rawTextNode->setText(text);
47 std::static_pointer_cast<AST::RawText>(lastChild)->appendText(text);
49 auto rawTextNode = std::make_shared<AST::RawText>();
51 rawTextNode->setText(token);
56 std::ostream&
prettyPrint(std::ostream& os,
size_t indentation_level = 0)
const override = 0;
The base class for all non-terminal nodes in the Bash++ AST. Each ASTNode contains information about ...
Definition ASTNode.h:28
std::shared_ptr< ASTNode > getLastChild() const
Definition ASTNode.cpp:128
void addChild(const std::shared_ptr< ASTNode > &child)
Add a child node to this AST node. This function also:
Definition ASTNode.cpp:21
Base class for string-type nodes in the AST.
Definition StringType.h:23
void addText(const AST::Token< std::string > &text)
Adds text to the string, either by appending to the last RawText child or creating a new one....
Definition StringType.h:33
void addText(const std::string &text)
Definition StringType.h:44
std::ostream & prettyPrint(std::ostream &os, size_t indentation_level=0) const override=0
constexpr StringType(AST::NodeType type)
Definition StringType.h:25
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:10
NodeType
Definition NodeTypes.h:12