1#ifndef ROSE_AstAttributeMechanism_H
2#define ROSE_AstAttributeMechanism_H
5#include <Sawyer/Attribute.h>
112 : fromNode(fromNode), toNode(toNode), label(label), options(options) {}
128 : nodePtr(nodePtr), label(label), options(options) {}
183 return "AstAttribute";
301 bool exists(
const std::string &name)
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; }
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";
Stores named attributes in Sage IR nodes.
bool replace(const std::string &name, AstAttribute *value)
Insert a new value if the attribute already exists.
bool exists(const std::string &name) const
Test for attribute existence.
void remove(const std::string &name)
Erases the specified attribute.
size_t size() const
Number of attributes stored.
bool add(const std::string &name, AstAttribute *value)
Insert a new value if the attribute doesn't already exist.
AstAttribute * operator[](const std::string &name) const
Get an attribute value.
~AstAttributeMechanism()
Destructor.
void set(const std::string &name, AstAttribute *value)
Insert an attribute.
AttributeIdentifiers getAttributeIdentifiers() const
List of stored attribute names.
AstAttributeMechanism & operator=(const AstAttributeMechanism &other)
Assignment operator.
AstAttributeMechanism()
Default constructor.
AstAttributeMechanism(const AstAttributeMechanism &other)
Copy constructor.
std::set< std::string > AttributeIdentifiers
Set of attribute names.
Support for attibutes to specify edges in the dot graphs.
Support for adding nodes to DOT graphs.
Base class for all IR node attribute values.
virtual char * packed_data()
Packing support.
virtual int packed_size()
Packing support.
virtual std::string toString()
Convert an attribute to a string.
virtual std::vector< AttributeNodeInfo > additionalNodeInfo()
DOT support.
virtual void unpacked_data(int size, char *data)
Packing support.
virtual std::string additionalNodeOptions()
DOT support.
virtual std::vector< AttributeEdgeInfo > additionalEdgeInfo()
DOT support.
virtual AstAttribute * constructor() const
Virtual default constructor.
virtual OwnershipPolicy getOwnershipPolicy() const
Who owns this attribute.
virtual std::string attribute_class_name() const
Attribute class name.
OwnershipPolicy
Who owns this attribute.
@ NO_OWNERSHIP
Attributes are always leaked.
@ CUSTOM_OWNERSHIP
Subclass defines ownership policy.
@ CONTAINER_OWNERSHIP
Container owns attribute.
virtual bool commentOutNodeInGraph()
Eliminate IR nodes in DOT graphs.
virtual AstAttribute * copy() const
Virtual copy constructor.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual std::string attribute_class_name() const override
Attribute class name.
Attribute containing a regex expression as a string.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual AstAttribute * copy() const override
Virtual copy constructor.
Attribute storing an SgNode.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual AstAttribute * copy() const override
Virtual copy constructor.
IR node attribute that stores a copyable value.
T Value
Type of value this wrapper holds.
AstValueAttribute(const T &value)
Constructs an attribute containing a specified value.
T & get()
Return the stored value by reference.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual std::string attribute_class_name() const override
Attribute class name.
AstValueAttribute()
Default constructor.
void set(const T &value)
Assign a new value.
const T & get() const
Return the stored value by reference.
AstValueAttribute(const AstValueAttribute &other)
Copy constructor.
Attribute corresponding to a metric.
virtual void unpacked_data(int size, char *data) override
Packing support.
virtual int packed_size() override
Packing support.
virtual AstAttribute * copy() const override
Virtual copy constructor.
virtual std::string toString() override
Convert an attribute to a string.
virtual std::string attribute_class_name() const override
Attribute class name.
virtual char * packed_data() override
Packing support.
API and storage for attributes.
This class represents the base class for all IR nodes within Sage III.
void set(Word *words, const BitRange &where)
Set some bits.
bool get(const Word *words, size_t idx)
Return a single bit.
void setValue(Word *words, const BitRange &where, bool value)
Set or clear some bits.