ROSE  0.11.145.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Rosebud::Ast::Definition Class Reference

Description

Base class for class and property definitions.

Definition at line 252 of file Ast.h.

#include <Rosebud/Ast.h>

Inheritance diagram for Rosebud::Ast::Definition:
Inheritance graph
[legend]
Collaboration diagram for Rosebud::Ast::Definition:
Collaboration graph
[legend]

Public Types

using Ptr = DefinitionPtr
 Shared-ownership pointer. More...
 
- Public Types inherited from Rosebud::Ast::Node
using Ptr = NodePtr
 
- Public Types inherited from Sawyer::Tree::Vertex< Node >
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

AttributePtr findAttribute (const std::string &fqName)
 Finds an attribute with the specified fully qualified name. More...
 
- Public Member Functions inherited from Rosebud::Ast::Node
template<class T >
std::shared_ptr< T > findAncestor ()
 
- Public Member Functions inherited from Sawyer::Tree::Vertex< Node >
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...
 

Public Attributes

Token startToken
 Token at the start of the definition. More...
 
std::string name
 Unqualified name for the definition. More...
 
Token nameToken
 Token for the definition's unqualified name. More...
 
std::string doc
 Doxygen documentation comment. More...
 
Token docToken
 Token associated with the Doxygen comment. More...
 
Edge< CppStackcppStack
 C preprocessor pending conditional compilation directives. More...
 
std::string priorText
 Input text before the definition. More...
 
Token priorTextToken
 Token describing the location of the prior text. More...
 
EdgeVector< Attributeattributes
 Non-null pointer to the list of attributes controlling this property. More...
 
- Public Attributes inherited from Sawyer::Tree::Vertex< Node >
ReverseEdge parent
 Pointer to the parent in the tree. More...
 
EdgeBase * treeEdges_
 

Protected Member Functions

 Definition ()
 Default constructor used only by derived classes. More...
 
- Protected Member Functions inherited from Sawyer::Tree::Vertex< Node >
virtual void destructorHelper ()
 

Member Typedef Documentation

Shared-ownership pointer.

Definition at line 255 of file Ast.h.

Constructor & Destructor Documentation

Rosebud::Ast::Definition::Definition ( )
protected

Default constructor used only by derived classes.

Member Function Documentation

AttributePtr Rosebud::Ast::Definition::findAttribute ( const std::string &  fqName)

Finds an attribute with the specified fully qualified name.

Returns a non-null pointer to the attribute if found, null otherwise.

Member Data Documentation

Token Rosebud::Ast::Definition::startToken

Token at the start of the definition.

Definition at line 259 of file Ast.h.

std::string Rosebud::Ast::Definition::name

Unqualified name for the definition.

Definition at line 262 of file Ast.h.

Token Rosebud::Ast::Definition::nameToken

Token for the definition's unqualified name.

Definition at line 265 of file Ast.h.

std::string Rosebud::Ast::Definition::doc

Doxygen documentation comment.

The doxygen comment is a multi-line comment string. The first line may contain spaces for leading indentation.

Definition at line 270 of file Ast.h.

Token Rosebud::Ast::Definition::docToken

Token associated with the Doxygen comment.

Even though the doc string contains leading spaces, the token does not.

Definition at line 275 of file Ast.h.

Edge<CppStack> Rosebud::Ast::Definition::cppStack

C preprocessor pending conditional compilation directives.

This is a non-null child that contains information about the CPP conditional compilation directives that have been started but not yet closed.

Definition at line 281 of file Ast.h.

std::string Rosebud::Ast::Definition::priorText

Input text before the definition.

This is all the input text that appears before this definition and is not associated with any other definition. If there is a docToken, then its text is excluded from the prior text. Furthermore, white space at the ends of lines is removed, consecutive blank lines are replaced with a single blank line, and leading and trailing blank lines are removed.

Definition at line 288 of file Ast.h.

Token Rosebud::Ast::Definition::priorTextToken

Token describing the location of the prior text.

This is a generated token of type TOK_OTHER that encloses the priorText value.

Definition at line 293 of file Ast.h.

EdgeVector<Attribute> Rosebud::Ast::Definition::attributes

Non-null pointer to the list of attributes controlling this property.

Definition at line 296 of file Ast.h.


The documentation for this class was generated from the following file: