ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AstAttribute Class Reference

Base class for attributes that can be attached to AST nodes using the attribute mechanism in each AST node. More...

#include <AstAttributeMechanism.h>

Inheritance diagram for AstAttribute:

Classes

class  AttributeEdgeInfo
 
class  AttributeNodeInfo
 

Public Member Functions

 AstAttribute ()
 
virtual ~AstAttribute ()
 
virtual std::string toString ()
 
AstAttributeconstructor ()
 
std::string attribute_class_name ()
 
virtual int packed_size ()
 
virtual char * packed_data ()
 
virtual void unpacked_data (int size, char *data)
 
virtual std::string additionalNodeOptions ()
 
virtual std::vector
< AttributeEdgeInfo
additionalEdgeInfo ()
 
virtual std::vector
< AttributeNodeInfo
additionalNodeInfo ()
 
virtual AstAttributecopy ()
 
virtual bool commentOutNodeInGraph ()
 

Detailed Description

Base class for attributes that can be attached to AST nodes using the attribute mechanism in each AST node.

Objects of class AstAttribute can be be attached to ROSE AST nodes. An attribute must be a subclass of AstAttribute. Each node of the ROSE AST contains an AstAttributeMechanism, accessible as data member 'attribute'. Using this mechnism attributes can be attached to AST nodes.
example: class MyAstAttribute : public AstAttribute { public: MyAstAttribute(int v):val(v){} ... private: int val; };
node->attribute.add("myattribute1",new MyAstAttribute(5));
MyAstAttribute* accessexample = node->attribute["myattribute1"];

Definition at line 18 of file AstAttributeMechanism.h.

Constructor & Destructor Documentation

AstAttribute::AstAttribute ( )
virtual AstAttribute::~AstAttribute ( )
virtual

Member Function Documentation

virtual std::string AstAttribute::toString ( )
virtual

This function is used by other components to print the value of an attribute. For example the pdf generation calls this function to print the value of an attribute in the pdf file. The default implementation is to return an empty string.

Reimplemented in MetricAttribute, and AstTextAttribute.

AstAttribute* AstAttribute::constructor ( )
std::string AstAttribute::attribute_class_name ( )
virtual int AstAttribute::packed_size ( )
virtual

Reimplemented in MetricAttribute.

virtual char* AstAttribute::packed_data ( )
virtual

Reimplemented in MetricAttribute.

virtual void AstAttribute::unpacked_data ( int  size,
char *  data 
)
virtual

Reimplemented in MetricAttribute.

virtual std::string AstAttribute::additionalNodeOptions ( )
virtual
virtual std::vector<AttributeEdgeInfo> AstAttribute::additionalEdgeInfo ( )
virtual
virtual std::vector<AttributeNodeInfo> AstAttribute::additionalNodeInfo ( )
virtual
virtual bool AstAttribute::commentOutNodeInGraph ( )
virtual

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