|
ROSE
0.11.96.11
|
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:
bool returning false for default-constructed locations. Definition at line 23 of file Location.h.
#include <Location.h>

Public Member Functions | |
| virtual std::string | toString () const =0 |
| Convert location to string. More... | |
| virtual void | print (std::ostream &) const =0 |
| Output location to a stream. More... | |
| virtual std::string | printableName () const =0 |
| Convert location to escaped, parsable string. More... | |
| 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 bool | isEqual (const Location &other) const =0 |
| Equality and inequality. More... | |
| virtual bool | operator== (const Location &other) const final |
| Equality and inequality. More... | |
| virtual bool | operator!= (const Location &other) const final |
| Equality and inequality. More... | |
| 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. More... | |
| virtual bool | isEmpty () const final |
| Test whether this object is empty. More... | |
|
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::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::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 parse method can create an equal object from the string.
See also, parse.
Implemented in 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::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 65 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 68 of file Location.h.
|
inlinefinalvirtual |
Test whether this object is empty.
A default constructed location is empty. Other objects are valid.
Definition at line 101 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 104 of file Location.h.
Referenced by operator!().

1.8.17