ROSE
0.11.137.0
|
Root of an AST for one or more input files.
The project represents all the input files that were parsed.
#include <Rosebud/Ast.h>
Public Types | |
using | Ptr = ProjectPtr |
Shared-ownership pointer. More... | |
![]() | |
using | Ptr = NodePtr |
![]() | |
using | UserBase = Node |
User's base class. More... | |
using | UserBasePtr = std::shared_ptr< UserBase > |
Pointer to user's base class. More... | |
using | TraversalEvent = Sawyer::Tree::TraversalEvent |
Alias for traversal events. More... | |
Public Member Functions | |
std::vector< ClassPtr > | allClassesFileOrder () |
Return all classes defined in the input. More... | |
![]() | |
template<class T > | |
std::shared_ptr< T > | findAncestor () |
![]() | |
UserBasePtr | pointer () |
Returns a shared pointer to this vertex. More... | |
std::shared_ptr< T > | isa () |
Tests whether this object is a certain type. More... | |
auto | traverseReverse (const Visitor &visitor) |
Traverse in reverse direction from children to parents. More... | |
auto | traverse (const Visitor &visitor) |
Traverse in forward direction from parents to children. More... | |
auto | traversePre (const Visitor &visitor) |
Pre-order forward traversal. More... | |
auto | traversePost (const Visitor &visitor) |
Post-order forward traversal. More... | |
std::shared_ptr< T > | findFirstAncestor () |
Traversal that finds the closest ancestor of type T or derived from T. More... | |
std::shared_ptr< T > | findLastAncestor () |
Traversal that finds the farthest ancestor of type T or derived from T. More... | |
std::vector< std::shared_ptr< T > > | findDescendants () |
Traversal that finds all the descendants of a particular type. More... | |
UserBasePtr | child (size_t i) const |
Returns the pointer for a child. More... | |
size_t | nChildren () const |
Returns the number of children. More... | |
Static Public Member Functions | |
static Ptr | instance () |
Allocating constructor. More... | |
Public Attributes | |
EdgeVector< File > | files |
Non-null list of input files. More... | |
![]() | |
ReverseEdge | parent |
Pointer to the parent in the tree. More... | |
EdgeBase * | treeEdges_ |
Protected Member Functions | |
Project () | |
Default constructor used only by derived classes. More... | |
![]() | |
virtual void | destructorHelper () |
using Rosebud::Ast::Project::Ptr = ProjectPtr |
|
protected |
Default constructor used only by derived classes.
|
static |
Allocating constructor.
std::vector<ClassPtr> Rosebud::Ast::Project::allClassesFileOrder | ( | ) |
Return all classes defined in the input.
The returned classes are in the order they appear in a depth-first traversal of the AST, which is the same order they were encountered during parsing.
EdgeVector<File> Rosebud::Ast::Project::files |