34 std::dynamic_pointer_cast<AST::RawText>(lastChild)->appendText(text);
36 auto rawTextNode = std::make_shared<AST::RawText>();
37 rawTextNode->setText(text);
45 std::dynamic_pointer_cast<AST::RawText>(lastChild)->appendText(text);
47 auto rawTextNode = std::make_shared<AST::RawText>();
49 rawTextNode->setText(token);
54 std::ostream&
prettyPrint(std::ostream& os,
int indentation_level = 0)
const = 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:127
void addChild(const std::shared_ptr< ASTNode > &child)
Add a child node to this AST node. This function also:
Definition ASTNode.cpp:20
Base class for string-type nodes in the AST.
Definition StringType.h:22
std::ostream & prettyPrint(std::ostream &os, int indentation_level=0) const =0
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:31
void addText(const std::string &text)
Definition StringType.h:42
A class representing a token in the Bash++ AST. Tokens store their value along with line and column i...
Definition Token.h:21
Definition AccessModifier.h:8