|
ROSE 0.11.145.354
|
Base class for location types.
A location is something that specifies a location for something else. For instance, a location might be part of a line in a source code file, or a memory address in a binary file.
All locations implement a common base API consisting of:
parse method in subclasses that parses the string representation returned by printableName. bool returning false for default-constructed locations. Definition at line 24 of file Location.h.
#include <Rose/Location.h>

Public Member Functions | |
| virtual std::string | toString () const =0 |
| Convert location to string. | |
| virtual void | print (std::ostream &) const =0 |
| Output location to a stream. | |
| virtual std::string | printableName () const =0 |
| Convert location to escaped, parsable string. | |
| virtual bool | operator< (const Location &) const =0 |
| virtual bool | operator<= (const Location &) const =0 |
| virtual bool | operator> (const Location &) const =0 |
| virtual bool | operator>= (const Location &) const =0 |
| virtual uint64_t | hash () const =0 |
| Compute a 64-bit hash of this object. | |
| virtual bool | isEqual (const Location &other) const =0 |
| Equality and inequality. | |
| virtual bool | operator== (const Location &other) const final |
| Equality and inequality. | |
| virtual bool | operator!= (const Location &other) const final |
| Equality and inequality. | |
| virtual | operator bool () const final |
| Test whether this object is valid. | |
| virtual bool | isValid () const =0 |
| Test whether this object is valid. | |
| virtual bool | operator! () const final |
| Test whether this object is empty. | |
| virtual bool | isEmpty () const final |
| Test whether this object is empty. | |
|
pure virtual |
Convert location to string.
Returns a string representation of the location. This representation is not necessarily parsable.
See also, print.
Implemented in Rose::BinaryAnalysis::AbstractLocation, Rose::BinaryAnalysis::ConcreteLocation, and Rose::SourceLocation.
|
pure virtual |
Output location to a stream.
The format is the same as the toString method and is not necessarily parsable.
See also, toString.
Implemented in Rose::BinaryAnalysis::AbstractLocation, Rose::BinaryAnalysis::ConcreteLocation, and Rose::SourceLocation.
|
pure virtual |
Convert location to escaped, parsable string.
Returns a string that can be safely emitted to a terminal. The format should also be parsable so the static parse method in subclasses can create an equal object from the string.
Implemented in Rose::BinaryAnalysis::AbstractLocation, Rose::BinaryAnalysis::ConcreteLocation, and Rose::SourceLocation.
|
pure virtual |
Equality and inequality.
Objects are equal if they are the same type and they point to the same location. Otherwise they are unequal.
The operator== is implemented in the base class only. For the expression a == b it calls both a.isEqual(b) and b.isEqual(a), returning true only if both tests return true. Subclasses should implement x.isEqual(y) by dynamic casting y to the type of x and returning true if and only if the cast succeeds and x and y point to the same location.
The operator!= is implemented in the base class as the complement of operator==.
Implemented in Rose::BinaryAnalysis::AbstractLocation, Rose::BinaryAnalysis::ConcreteLocation, and Rose::SourceLocation.
Referenced by operator==().
|
inlinefinalvirtual |
Equality and inequality.
Objects are equal if they are the same type and they point to the same location. Otherwise they are unequal.
The operator== is implemented in the base class only. For the expression a == b it calls both a.isEqual(b) and b.isEqual(a), returning true only if both tests return true. Subclasses should implement x.isEqual(y) by dynamic casting y to the type of x and returning true if and only if the cast succeeds and x and y point to the same location.
The operator!= is implemented in the base class as the complement of operator==.
Definition at line 63 of file Location.h.
References isEqual().
|
inlinefinalvirtual |
Equality and inequality.
Objects are equal if they are the same type and they point to the same location. Otherwise they are unequal.
The operator== is implemented in the base class only. For the expression a == b it calls both a.isEqual(b) and b.isEqual(a), returning true only if both tests return true. Subclasses should implement x.isEqual(y) by dynamic casting y to the type of x and returning true if and only if the cast succeeds and x and y point to the same location.
The operator!= is implemented in the base class as the complement of operator==.
Definition at line 66 of file Location.h.
|
pure virtual |
Implemented in Rose::SourceLocation.
|
pure virtual |
Implemented in Rose::SourceLocation.
|
pure virtual |
Implemented in Rose::SourceLocation.
|
pure virtual |
Implemented in Rose::SourceLocation.
|
inlineexplicitfinalvirtual |
|
pure virtual |
Test whether this object is valid.
Implemented in Rose::BinaryAnalysis::AbstractLocation, Rose::BinaryAnalysis::ConcreteLocation, and Rose::SourceLocation.
Referenced by operator bool().
|
inlinefinalvirtual |
Test whether this object is empty.
A default constructed location is empty. Other objects are valid.
Definition at line 99 of file Location.h.
References isEmpty().
|
inlinefinalvirtual |
Test whether this object is empty.
A default constructed location is empty. Other objects are valid.
Definition at line 102 of file Location.h.
Referenced by operator!().
|
pure virtual |
Compute a 64-bit hash of this object.
Implemented in Rose::BinaryAnalysis::AbstractLocation, Rose::BinaryAnalysis::ConcreteLocation, and Rose::SourceLocation.