Package org.smtlib
Interface ISource
- All Known Implementing Classes:
Pos.Source
public interface ISource
This interface represents sources of characters. The source need not be fully available at
any given time, but it does need to be able to supply characters at a given position on demand
and to determine line numbers from the beginning of the source.
-
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int pos) Returns the character at the given character position within the source.chars()The internal character stream as a CharSequence.voidclose()Closes any open resources - the source is not usable after this call.intlineBeginning(int pos) Returns the character position of the beginning of the line containing the given position.intlineNumber(int pos) Returns the number (beginning with 1) of the line containing the given character position (which begins at 0).location()User-specified identification of the location of the source; the user is responsible to use the result in the way in which the source object was created.textLine(int pos) Returns the text of the line containing the given position, at least through the given position, and always ending with a (perhaps added) line termination sequence.
-
Method Details
-
chars
CharSequence chars()The internal character stream as a CharSequence. We would like to avoid the constraint of having to have this kind of internal representation, but the parser uses Pattern and Matcher, which require a CharSequence. The CharSequence might not contain all the characters that might ever be read, but will contain characters as they are read. -
close
void close()Closes any open resources - the source is not usable after this call. -
location
Object location()User-specified identification of the location of the source; the user is responsible to use the result in the way in which the source object was created.- Returns:
- the location object of the source
-
charAt
char charAt(int pos) Returns the character at the given character position within the source. Character positions begin at 0. -
lineBeginning
int lineBeginning(int pos) Returns the character position of the beginning of the line containing the given position. Character positions begin at 0. -
textLine
Returns the text of the line containing the given position, at least through the given position, and always ending with a (perhaps added) line termination sequence. Character positions begin at 0.- Parameters:
pos- a character position- Returns:
- the line of text containing that character position
-
lineNumber
int lineNumber(int pos) Returns the number (beginning with 1) of the line containing the given character position (which begins at 0).
-