The content of the source.
The content of the source.
A map of line offsets into the source character sequence and a count of how many lines are present.
A map of line offsets into the source character sequence and a count of how many lines are present. The line offset map is indexed starting at zero and contains at least one entry.
Return the offset after the last character of a line.
Return the offset after the last character of a line.
A map of line offsets into the source character sequence and a count of how many lines are present.
A map of line offsets into the source character sequence and a count of how many lines are present. The line offset map is indexed starting at zero and contains at least one entry.
Convert an offset into the content into a position.
Convert an offset into the content into a position.
If the given line number is within range for this source, return
the content of that line, otherwise return None
.
If the given line number is within range for this source, return
the content of that line, otherwise return None
. As a special
case, support a line beyond the end of the input which contains
nothing since parsers
The name of this source or None
if it doesn't have a name.
The name of this source or None
if it doesn't have a name.
If the position is valid for this source, return the corresponding
offset into the content, otherwise return None
.
If the position is valid for this source, return the corresponding
offset into the content, otherwise return None
.
Return a reader on this source.
Return a reader on this source. Not normally used by Kiama but useful if you want to use a source with other code that requires a reader.
A source that is a string.