#include <location.h>
Collaboration diagram for SCLocation:
Public Types | |
enum | _NullLoc { NullLoc } |
Public Member Functions | |
SCLocation (_NullLoc=NullLoc) | |
Create a NULL location. | |
SCLocation (const SourcePosition &p) | |
Construct a position from a source position. Only used inside scanner. | |
SCLocation (const SCLocation &loc) | |
Copy constructor works as usual. | |
SCLocation (const TLString &path, int line=-1, int lpos=-1) | |
~SCLocation () | |
Destructor is essentially a no-op. | |
SCLocation & | operator= (const SCLocation &loc) |
Assignment operator works as usual. | |
SCLocation & | operator= (_NullLoc) |
This can be used to assign a NULL location. | |
bool | operator! () const |
Check for NULL location. | |
operator bool () const | |
Check for NULL location. | |
TLString | path () const |
Get path (if any). | |
int | line () const |
Get line number or -1. | |
int | lpos () const |
Get line position or -1. | |
TLString | LocString (int with_inc_hierarchy=0) const |
Return a string representation of this location. | |
TLString | RelString (const SCLocation &rloc) const |
Return a relative string representation of the location. | |
Public Attributes | |
SourcePosition | pos |
The actual (start) position is stored here. | |
Friends | |
class | SCLocationRange |
This class is "C++-safe", i.e. copy constructors and assignment are implemented properly.
Definition at line 47 of file location.h.
|
Definition at line 51 of file location.h. |
|
Create a NULL location.
Definition at line 57 of file location.h. References pos. |
|
Construct a position from a source position. Only used inside scanner.
Definition at line 59 of file location.h. References pos, and SourcePosition. |
|
Copy constructor works as usual.
Definition at line 61 of file location.h. References pos. |
|
Directly create a location with file and position. Definition at line 71 of file location.cc. References _InternalSourceFileNode::CreateSingleNode(), _InternalSourcePosition::CreateSinglePosition(), lpos(), pos, and SourceFileNode. |
|
Destructor is essentially a no-op.
Definition at line 69 of file location.h. |
|
Get line number or -1.
Definition at line 89 of file location.h. References pos. |
|
Return a string representation of this location. Format the location into a string representation; include hierarchy dump is only included if with_inc_hierarchy is set. Definition at line 55 of file location.cc. References pos. Referenced by MessageHandler_Console::HandleMessage(). |
|
Get line position or -1.
Definition at line 92 of file location.h. References pos. Referenced by SCLocation(). |
|
Check for NULL location.
Definition at line 82 of file location.h. References pos. |
|
Check for NULL location.
Definition at line 79 of file location.h. References pos. |
|
This can be used to assign a NULL location.
Definition at line 75 of file location.h. References pos, and SourcePosition. |
|
Assignment operator works as usual.
Definition at line 72 of file location.h. References pos. |
|
Get path (if any).
Definition at line 86 of file location.h. References pos. Referenced by VM::VMLinker::LinkAll(). |
|
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 65 of file location.cc. References pos. |
|
Definition at line 49 of file location.h. |
|
The actual (start) position is stored here.
Definition at line 54 of file location.h. Referenced by line(), LocString(), lpos(), operator bool(), operator!(), operator=(), VM::AssemblerFile_Plaintext::ParseFile(), path(), SCLocationRange::RangeString(), RelString(), SCLocationRange::RelString(), and SCLocation(). |