35 std::dynamic_pointer_cast<AST::RawText>(lastChild)->appendText(text);
37 auto rawTextNode = std::make_shared<AST::RawText>();
38 rawTextNode->setText(text);
46 std::dynamic_pointer_cast<AST::RawText>(lastChild)->appendText(text);
48 auto rawTextNode = std::make_shared<AST::RawText>();
50 rawTextNode->setText(token);
55 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:29
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
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:32
void addText(const std::string &text)
Definition StringType.h:43
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