#include <location.h>
Collaboration diagram for SCLocationRange:
Public Types | |
enum | _NullRange { NullRange } |
Public Member Functions | |
SCLocationRange (_NullRange=NullRange) | |
Create a NULL location range. | |
SCLocationRange (const SCLocation &a, const SCLocation &b) | |
Construct a location range from two locations, start and end. | |
SCLocationRange (const SCLocationRange &r) | |
Copy constructor works as usual. | |
~SCLocationRange () | |
Destructor is essentially a no-op. | |
SCLocationRange & | operator= (const SCLocationRange &r) |
Assignment operator works as usual. | |
SCLocationRange & | operator= (_NullRange) |
This can be used to assign a NULL range. | |
bool | operator! () const |
Check for NULL loc. range (true if start and end are NULL locations). | |
operator bool () const | |
Check for NULL loc. range (false if start and end are NULL locations). | |
TLString | RangeString (int with_files=1) const |
Return a string representation of this location range. | |
TLString | RelString (const SCLocationRange &rloc) const |
Return a relative string representation of the location. | |
TLString | RelString (const SCLocation &rloc) const |
Version of RelString() which takes a single SCLocation. | |
Public Attributes | |
SCLocation | loc0 |
start location | |
SCLocation | loc1 |
end location |
This class is as well leight-weight as it may be heavily used during parsing and may even be attached to tree nodes where a location range (compared to a single location) may help a lot. It has no virtual functions.
This class is "C++-safe", i.e. copy constructors and assignment are implemented properly.
Definition at line 133 of file location.h.
|
Definition at line 135 of file location.h. |
|
Create a NULL location range.
Definition at line 141 of file location.h. |
|
Construct a location range from two locations, start and end.
Definition at line 144 of file location.h. |
|
Copy constructor works as usual.
Definition at line 147 of file location.h. |
|
Destructor is essentially a no-op.
Definition at line 150 of file location.h. |
|
Check for NULL loc. range (false if start and end are NULL locations).
Definition at line 163 of file location.h. |
|
Check for NULL loc. range (true if start and end are NULL locations).
Definition at line 160 of file location.h. |
|
This can be used to assign a NULL range.
Definition at line 156 of file location.h. |
|
Assignment operator works as usual.
Definition at line 153 of file location.h. |
|
Return a string representation of this location range. Format the location into a string representation; include hierarchy dump for start location is only included if with_files>1. If with_files=0, only the location in the file but not the file is written; for 1, the file and the location in the file (but no include hierarchy) is emitted. Definition at line 20 of file location.cc. References loc0, loc1, and SCLocation::pos. Referenced by MessageHandler_Console::HandleMessage(), and RelString(). |
|
Version of RelString() which takes a single SCLocation.
Definition at line 43 of file location.cc. References loc0, loc1, SCLocation::pos, and RangeString(). |
|
Return a relative string representation of the location. Returns a relative string representation; i.e. the location stored in *this is reported, relative to the passed one. "Relative" means that the file is left away if it is the same file. Definition at line 30 of file location.cc. References loc0, loc1, SCLocation::pos, and RangeString(). |
|
start location
Definition at line 137 of file location.h. Referenced by Message::location(), operator bool(), operator!(), operator=(), RangeString(), RelString(), and SCLocationRange(). |
|
end location
Definition at line 138 of file location.h. Referenced by MessageHandler_Console::HandleMessage(), operator bool(), operator!(), operator=(), RangeString(), RelString(), and SCLocationRange(). |