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

Description

An attribute adjusting the details for a definition.

An attribute has a name and optional argument list and is used to adjust the behavior, traits, etc. of a class or property definition.

Definition at line 218 of file Ast.h.

#include <Rosebud/Ast.h>

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

Public Types

using Ptr = AttributePtr
 Shared-ownership pointer.
 
- 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.
 
using UserBasePtr = std::shared_ptr< UserBase >
 Pointer to user's base class.
 
using TraversalEvent = Sawyer::Tree::TraversalEvent
 Alias for traversal events.
 

Static Public Member Functions

static Ptr instance ()
 Allocating constructor.
 
static Ptr instance (const std::string &fqName, const std::vector< Token > &nameTokens)
 Allocating constructor.
 

Public Attributes

std::string fqName
 Fully qualified name.
 
std::vector< TokennameTokens
 One or more tokens associated with the name.
 
Edge< ArgumentListarguments
 Attribute arguments.
 
- Public Attributes inherited from Sawyer::Tree::Vertex< Node >
ReverseEdge parent
 Pointer to the parent in the tree.
 

Protected Member Functions

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

Additional Inherited Members

- 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.
 
std::shared_ptr< T > isa ()
 Tests whether this object is a certain type.
 
auto traverseReverse (const Visitor &visitor)
 Traverse in reverse direction from children to parents.
 
auto traverse (const Visitor &visitor)
 Traverse in forward direction from parents to children.
 
auto traversePre (const Visitor &visitor)
 Pre-order forward traversal.
 
auto traversePost (const Visitor &visitor)
 Post-order forward traversal.
 
std::shared_ptr< T > findFirstAncestor ()
 Traversal that finds the closest ancestor of type T or derived from T.
 
std::shared_ptr< T > findLastAncestor ()
 Traversal that finds the farthest ancestor of type T or derived from T.
 
std::vector< std::shared_ptr< T > > findDescendants ()
 Traversal that finds all the descendants of a particular type.
 
UserBasePtr child (size_t i) const
 Returns the pointer for a child.
 
size_t nChildren () const
 Returns the number of children.
 

Member Typedef Documentation

◆ Ptr

Shared-ownership pointer.

Definition at line 221 of file Ast.h.

Member Function Documentation

◆ instance() [1/2]

static Ptr Rosebud::Ast::Attribute::instance ( )
static

Allocating constructor.

The no-argument constructor creates a node with no name. If a name is provided, it should be a fully qualified name and the nameTokens should be a list of input tokens for the name. The input tokens can point to the unqualified name.

◆ instance() [2/2]

static Ptr Rosebud::Ast::Attribute::instance ( const std::string &  fqName,
const std::vector< Token > &  nameTokens 
)
static

Allocating constructor.

The no-argument constructor creates a node with no name. If a name is provided, it should be a fully qualified name and the nameTokens should be a list of input tokens for the name. The input tokens can point to the unqualified name.

Member Data Documentation

◆ fqName

std::string Rosebud::Ast::Attribute::fqName

Fully qualified name.

Definition at line 225 of file Ast.h.

◆ nameTokens

std::vector<Token> Rosebud::Ast::Attribute::nameTokens

One or more tokens associated with the name.

Definition at line 228 of file Ast.h.

◆ arguments

Edge<ArgumentList> Rosebud::Ast::Attribute::arguments

Attribute arguments.

This tree edge is null unless the attribute has an argument list with zero or more arguments.

Definition at line 233 of file Ast.h.


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