P4C
The P4 Compiler
|
#include <source_file.h>
Public Member Functions | |
SourcePosition ()=default | |
Creates an invalid source position. | |
SourcePosition (const SourcePosition &other)=default | |
SourcePosition (unsigned lineNumber, unsigned columnNumber) | |
unsigned | getColumnNumber () const |
unsigned | getLineNumber () const |
bool | isValid () const |
const SourcePosition & | max (const SourcePosition &rhs) const |
const SourcePosition & | min (const SourcePosition &rhs) const |
bool | operator!= (const SourcePosition &rhs) const |
SourcePosition & | operator-- () |
Move one column back. This never moves one line back. | |
SourcePosition | operator-- (int) |
bool | operator< (const SourcePosition &rhs) const |
bool | operator<= (const SourcePosition &rhs) const |
SourcePosition & | operator= (const SourcePosition &)=default |
bool | operator== (const SourcePosition &rhs) const |
bool | operator> (const SourcePosition &rhs) const |
bool | operator>= (const SourcePosition &rhs) const |
cstring | toString () const |
Friends | |
template<typename Sink > | |
void | AbslStringify (Sink &sink, const SourcePosition &p) |
A character position within some InputSources: a pair of line/column positions. Can only be interpreted in the context of some InputSources.
In files line numbering starts at 1, so 0 is reserved for "invalid" source positions. As a consequence, invalid source position are the "smallest", which is a reasonable choice.