2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef SOURCE_LOCATION_H
6 #define SOURCE_LOCATION_H
8 #include <SupportDefs.h>
11 class SourceLocation
{
13 SourceLocation(int32 line
= 0, int32 column
= 0)
20 SourceLocation(const SourceLocation
& other
)
23 fColumn(other
.fColumn
)
27 SourceLocation
& operator=(const SourceLocation
& other
)
30 fColumn
= other
.fColumn
;
34 bool operator==(const SourceLocation
& other
) const
36 return fLine
== other
.fLine
&& fColumn
== other
.fColumn
;
39 bool operator!=(const SourceLocation
& other
) const
41 return !(*this == other
);
44 bool operator<(const SourceLocation
& other
) const
46 return fLine
< other
.fLine
47 || (fLine
== other
.fLine
&& fColumn
< other
.fColumn
);
50 bool operator<=(const SourceLocation
& other
) const
52 return fLine
< other
.fLine
53 || (fLine
== other
.fLine
&& fColumn
<= other
.fColumn
);
72 #endif // SOURCE_LOCATION_H