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

This mechanism provides capabilities to define a mapping from strings to AstAttributes. An instance of this class is accessible at each ROSE AST node in the data member 'attribute'. More...

#include <AstAttributeMechanism.h>

Inheritance diagram for AstAttributeMechanism:
Collaboration diagram for AstAttributeMechanism:

Public Member Functions

 AstAttributeMechanism (const AstAttributeMechanism &X)
 
 AstAttributeMechanism ()
 

Detailed Description

This mechanism provides capabilities to define a mapping from strings to AstAttributes. An instance of this class is accessible at each ROSE AST node in the data member 'attribute'.

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 179 of file AstAttributeMechanism.h.

Constructor & Destructor Documentation

AstAttributeMechanism::AstAttributeMechanism ( const AstAttributeMechanism X)
AstAttributeMechanism::AstAttributeMechanism ( )

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