1 #ifndef ROSE_AstAttributeMechanism_H
2 #define ROSE_AstAttributeMechanism_H
5 #include <Sawyer/Attribute.h>
101 virtual OwnershipPolicy getOwnershipPolicy()
const;
112 : fromNode(fromNode), toNode(toNode), label(label), options(options) {}
128 : nodePtr(nodePtr), label(label), options(options) {}
183 return "AstAttribute";
191 virtual std::string toString();
196 virtual int packed_size();
197 virtual char* packed_data();
198 virtual void unpacked_data(
int size,
char* data );
204 virtual std::string additionalNodeOptions();
205 virtual std::vector<AttributeEdgeInfo> additionalEdgeInfo();
206 virtual std::vector<AttributeNodeInfo> additionalNodeInfo();
212 virtual bool commentOutNodeInGraph();
301 bool exists(
const std::string &name)
const;
343 bool replace(
const std::string &name,
AstAttribute *value);
358 AstAttribute* operator[](
const std::string &name)
const;
369 void remove(
const std::string &name);
387 AttributeIdentifiers getAttributeIdentifiers()
const;
418 : is_derived_(
false), value_(0) {}
421 : is_derived_(is_derived), value_(value) {}
426 virtual bool isDerived()
const {
return is_derived_; }
427 virtual double getValue()
const {
return value_; }
428 virtual void setValue(
double newVal) { value_ = newVal; }
430 virtual std::string
toString()
override;
472 const T&
get()
const {
return value_; }
473 T&
get() {
return value_; }
477 void set(
const T& value) { value_ = value; }
486 std::string expression;
498 return "AstRegExAttribute";
515 SgNode* getNode() {
return get(); }
516 void setNode(
SgNode *node) {
set(node); }
527 std::vector<SgNode*> &getNodeList() {
return get(); }
528 void addNode(
SgNode *n) {
get().push_back(n); }
529 void setNode(
SgNode*,
int);
531 int size() {
return get().size(); }
542 int getValue() {
return get(); }
547 std::list<SgJavaParameterizedType *> parameterizedTypes;
551 : genericType(NULL) {}
556 : genericType(other.genericType), parameterizedTypes(other.parameterizedTypes) {}
563 return "AstParameterizedTypeAttribute";
virtual AstAttribute * constructor() const
Virtual default constructor.
virtual std::string attribute_class_name() const override
Attribute class name.
Support for adding nodes to DOT graphs.
AstAttributeMechanism()
Default constructor.
Attribute containing a regex expression as a string.
OwnershipPolicy
Who owns this attribute.
Support for attibutes to specify edges in the dot graphs.
std::set< std::string > AttributeIdentifiers
Set of attribute names.
virtual std::string attribute_class_name() const override
Attribute class name.
Subclass defines ownership policy.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual char * packed_data()
Packing support.
virtual std::string toString()
Convert an attribute to a string.
AstValueAttribute(const T &value)
Constructs an attribute containing a specified value.
Attribute corresponding to a metric.
Base class for all IR node attribute values.
virtual std::string attribute_class_name() const
Attribute class name.
Attributes are always leaked.
Container owns attribute.
This class represents the base class for all IR nodes within Sage III.
AstValueAttribute(const AstValueAttribute &other)
Copy constructor.
virtual AstAttribute * copy() const
Virtual copy constructor.
IR node attribute that stores a copyable value.
void set(const T &value)
Assign a new value.
virtual AstAttribute * copy() const override
Virtual copy constructor.
T Value
Type of value this wrapper holds.
Stores named attributes in Sage IR nodes.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual AstAttribute * copy() const override
Virtual copy constructor.
AstValueAttribute()
Default constructor.
virtual AstAttribute * copy() const override
Virtual copy constructor.
AstAttributeMechanism(const AstAttributeMechanism &other)
Copy constructor.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual std::string attribute_class_name() const override
Attribute class name.
Attribute storing an SgNode.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual int packed_size()
Packing support.
virtual void unpacked_data(int size, char *data)
Packing support.