![]() |
P4C
The P4 Compiler
|
#include <source_file.h>
Public Member Functions | |
| SourceInfo ()=default | |
| Creates an "invalid" SourceInfo. | |
| SourceInfo (const InputSources *sources, SourcePosition point) | |
| Creates a SourceInfo for a 'point' in the source, or invalid. | |
| SourceInfo (const InputSources *sources, SourcePosition start, SourcePosition end) | |
| SourceInfo (const SourceInfo &other)=default | |
| SourceInfo (cstring filename, int line, int column, cstring srcBrief) | |
| void | dbprint (std::ostream &out) const |
| const SourcePosition & | getEnd () const |
| cstring | getLineNum () const |
| cstring | getSourceFile () const |
| const SourcePosition & | getStart () const |
| bool | isValid () const |
| operator bool () const | |
| SourceInfo | operator+ (const SourceInfo &rhs) const |
| SourceInfo & | operator+= (const SourceInfo &rhs) |
| bool | operator< (const SourceInfo &rhs) const |
| bool | operator<= (const SourceInfo &rhs) const |
| SourceInfo & | operator= (const SourceInfo &other)=default |
| bool | operator== (const SourceInfo &rhs) const |
| bool | operator> (const SourceInfo &rhs) const |
| bool | operator>= (const SourceInfo &rhs) const |
| cstring | toBriefSourceFragment () const |
| SourceFileLine | toPosition () const |
| cstring | toPositionString () const |
| cstring | toSourceFragment (bool useMarker=true) const |
| cstring | toSourcePositionData (unsigned *outLineNumber, unsigned *outColumnNumber) const |
| cstring | toString () const |
Public Attributes | |
| int | column = -1 |
| cstring | filename = ""_cs |
| int | line = -1 |
| cstring | srcBrief = ""_cs |
Information about the source position of a language element - a range of position within an InputSources. Can only be interpreted relative to some InputSources.
For a program element, the start is inclusive and the end is exclusive (the first position after the language element).
SourceInfo can also be "invalid"
|
inline |
A SourceInfo that spans both this and rhs. However, if this or rhs is invalid, it is not taken into account
|
inline |
True if this comes 'before' this source position. 'invalid' source positions come first. This is true if the start of other is strictly before the start of this.