|
Bash++
Bash++ compiler internal documentation
|
The base class for all non-terminal nodes in the Bash++ AST. Each ASTNode contains information about its type, children, and position in the source code. More...
#include <ASTNode.h>


Public Member Functions | |
| ASTNode ()=default | |
| virtual constexpr AST::NodeType | getType () const =0 |
| void | addChild (const std::shared_ptr< ASTNode > &child) |
| Add a child node to this AST node. This function also: | |
| void | addChildren (const std::vector< std::shared_ptr< ASTNode > > &childs) |
| Add a vector of child nodes to this AST node. This function also: | |
| const std::vector< std::shared_ptr< ASTNode > > & | getChildren () const |
| void | setPosition (const AST::FilePosition &pos) |
| void | setPosition (uint32_t line, uint32_t column) |
| const AST::FilePosition & | getPosition () const |
| void | setEndPosition (const AST::FilePosition &pos) |
| void | setEndPosition (uint32_t line, uint32_t column) |
| const AST::FilePosition & | getEndPosition () const |
| uint32_t | getLine () const |
| uint32_t | getCharPositionInLine () const |
| std::shared_ptr< ASTNode > | getChildAt (size_t index) const |
| std::shared_ptr< ASTNode > | getFirstChild () const |
| std::shared_ptr< ASTNode > | getLastChild () const |
| size_t | getChildrenCount () const |
| void | clear () |
| void | clearChildren () |
| virtual std::ostream & | prettyPrint (std::ostream &os, int indentation_level=0) const =0 |
Protected Attributes | |
| std::vector< std::shared_ptr< ASTNode > > | children |
| AST::FilePosition | position |
| AST::FilePosition | end_position |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const ASTNode &node) |
The base class for all non-terminal nodes in the Bash++ AST. Each ASTNode contains information about its type, children, and position in the source code.
|
default |
| void AST::ASTNode::addChild | ( | const std::shared_ptr< ASTNode > & | child | ) |
| void AST::ASTNode::addChildren | ( | const std::vector< std::shared_ptr< ASTNode > > & | childs | ) |
| void AST::ASTNode::clear | ( | ) |
| void AST::ASTNode::clearChildren | ( | ) |
| uint32_t AST::ASTNode::getCharPositionInLine | ( | ) | const |
| std::shared_ptr< ASTNode > AST::ASTNode::getChildAt | ( | size_t | index | ) | const |
| const std::vector< std::shared_ptr< ASTNode > > & AST::ASTNode::getChildren | ( | ) | const |
| size_t AST::ASTNode::getChildrenCount | ( | ) | const |
| const AST::FilePosition & AST::ASTNode::getEndPosition | ( | ) | const |
| std::shared_ptr< ASTNode > AST::ASTNode::getFirstChild | ( | ) | const |
| std::shared_ptr< ASTNode > AST::ASTNode::getLastChild | ( | ) | const |
| uint32_t AST::ASTNode::getLine | ( | ) | const |
| const AST::FilePosition & AST::ASTNode::getPosition | ( | ) | const |
|
constexprpure virtual |
Implemented in AST::ArrayAssignment, AST::ArrayIndex, AST::Bash53NativeSupershell, AST::BashArithmeticForCondition, AST::BashArithmeticForStatement, AST::BashArithmeticStatement, AST::BashArithmeticSubstitution, AST::BashCaseInput, AST::BashCasePattern, AST::BashCasePatternHeader, AST::BashCaseStatement, AST::BashCommand, AST::BashCommandSequence, AST::BashForStatement, AST::BashFunction, AST::BashIfCondition, AST::BashIfElseBranch, AST::BashIfRootBranch, AST::BashIfStatement, AST::BashInCondition, AST::BashPipeline, AST::BashRedirection, AST::BashSelectStatement, AST::BashTestConditionCommand, AST::BashUntilStatement, AST::BashVariable, AST::BashWhileOrUntilCondition, AST::BashWhileStatement, AST::Block, AST::ClassDefinition, AST::Connective, AST::ConstructorDefinition, AST::DatamemberDeclaration, AST::DeleteStatement, AST::DestructorDefinition, AST::DoublequotedString, AST::DynamicCast, AST::DynamicCastTarget, AST::HeredocBody, AST::HereString, AST::IncludeStatement, AST::MethodDefinition, AST::NewStatement, AST::ObjectAssignment, AST::ObjectInstantiation, AST::ObjectReference, AST::ParameterExpansion, AST::PointerDeclaration, AST::PrimitiveAssignment, AST::ProcessSubstitution, AST::Program, AST::RawSubshell, AST::RawText, AST::Rvalue, AST::SubshellSubstitution, AST::Supershell, AST::TypeofExpression, and AST::ValueAssignment.
|
pure virtual |
Implemented in AST::StringType, AST::ArrayAssignment, AST::ArrayIndex, AST::Bash53NativeSupershell, AST::BashArithmeticForCondition, AST::BashArithmeticForStatement, AST::BashArithmeticStatement, AST::BashArithmeticSubstitution, AST::BashCaseInput, AST::BashCasePattern, AST::BashCasePatternHeader, AST::BashCaseStatement, AST::BashCommand, AST::BashCommandSequence, AST::BashForStatement, AST::BashFunction, AST::BashIfCondition, AST::BashIfElseBranch, AST::BashIfRootBranch, AST::BashIfStatement, AST::BashInCondition, AST::BashPipeline, AST::BashRedirection, AST::BashSelectStatement, AST::BashTestConditionCommand, AST::BashUntilStatement, AST::BashVariable, AST::BashWhileOrUntilCondition, AST::BashWhileStatement, AST::Block, AST::ClassDefinition, AST::Connective, AST::ConstructorDefinition, AST::DatamemberDeclaration, AST::DeleteStatement, AST::DestructorDefinition, AST::DoublequotedString, AST::DynamicCast, AST::DynamicCastTarget, AST::HeredocBody, AST::HereString, AST::IncludeStatement, AST::MethodDefinition, AST::NewStatement, AST::ObjectAssignment, AST::ObjectInstantiation, AST::ObjectReference, AST::ParameterExpansion, AST::PointerDeclaration, AST::PrimitiveAssignment, AST::ProcessSubstitution, AST::Program, AST::RawSubshell, AST::RawText, AST::Rvalue, AST::SubshellSubstitution, AST::Supershell, AST::TypeofExpression, and AST::ValueAssignment.
| void AST::ASTNode::setEndPosition | ( | const AST::FilePosition & | pos | ) |
| void AST::ASTNode::setEndPosition | ( | uint32_t | line, |
| uint32_t | column | ||
| ) |
| void AST::ASTNode::setPosition | ( | const AST::FilePosition & | pos | ) |
| void AST::ASTNode::setPosition | ( | uint32_t | line, |
| uint32_t | column | ||
| ) |
|
friend |
|
protected |
|
protected |
|
protected |