Constructs the EndOfInput position in an input source. It is intended to be used only by SourceReader.
PRECONDITIONS: (not verified during execution)
The SourceReader of the input this position belongs to.
Answers if this position corresponds to the end of input of the SourceReader it belongs, or not. The EndOfInput is reached when all documents in the source input has been processed.
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
Answers if this position correspond to one in some SourceReader, or if it is unknown.
The SourceReader of the input this position belongs to.
The column number of this position in the current input.
PRECONDITIONS:
INVARIANT: column >= 1
and it is a valid column in that reader.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
The name of the input document this position belongs to.
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
The contents of the input document this position belongs to (both visible and non visible).
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the receiver is the end of input.
Answers if this position corresponds to the end of a document in the SourceReader it belongs, or not. The EndOfDocument is reached when all the characters in a document in the source input has been processed, but before the processing of the next document started.
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
The line number of this position in the current input.
PRECONDITIONS:
INVARIANT: line >=1
, and it is a valid line in that reader.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
The regions the position in the current input belongs to.
PRECONDITIONS:
INVARIANT: the regions are valid in the position's reader.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
The contents of the visible input document this position belongs to.
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the receiver is the end of input.
The exact portion of the source that is enclosed between from
position
and this
position (not included), both visible and non-visible.
If from
comes after this
, the result is the empty string.
It implements the specific logic of each subclass for the Template Method Pattern of fullContentsFrom. It must be reimplemented by subclasses.
PRECONDITION:
An AbstractKnownSourcePosition related with the same SourceReader that the receiver. It indicates the starting position to consult, where the receiver is the last (not included).
The exact portion of the source that is enclosed between this
position
and to
position (not included), both visible and non-visible.
If this
comes after to
, the result is the empty string.
It implements the specific logic of each subclass for the Template Method Pattern of fullContentsTo. It must be reimplemented by subclasses.
PRECONDITION: both positions correspond to the same reader (not validated, as it is a protected operation).
A AbstractKnownSourcePosition related with the same SourceReader that the receiver. It indicates a final position to consult (not included), where the receiver is the first.
The index in the SourceReader's document indicated by the document index where the character which this positions corresponds to is stored. It may be one longer thant the lenght, in case the position is EOD.
The index in the SourceReader's document list where the document which this position corresponds is stored. It may be one longer that the lenght, in case the position is EOI.
Validates that:
Implements a common validation for the Template Method Pattern.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver or the argument positions are unknown.
SourceReader/Errors.MismatchedInputsError if the receiver and the argument positions do not belong to the same reader.
The exact portion of the source that is enclosed between from
position
and this
position (not included) and is visible.
If from
comes after this
, the result is the empty string.
It implements the specific logic of each subclass for the Template Method Pattern of visibleContentsFrom. It must be reimplemented by subclasses.
PRECONDITION: both positions correspond to the same reader (not validated, as it is a protected operation).
A AbstractKnownSourcePosition related with the same SourceReader.SourceReader that the receiver. It indicates the starting position to consult, where the receiver is the last (not included).
The exact portion of the source that is enclosed between this
position
and to
position (not included) and is visible.
If this
comes after to
, the result is the empty string.
It implements the specific logic of each subclass for the Template Method Pattern of visibleContentsTo. It must be reimplemented by subclasses.
PRECONDITION: both positions correspond to the same reader (not validated, as it is a protected operation).
A AbstractKnownSourcePosition related with the same SourceReader that the receiver. It indicates the final position to consult (not included), where the receiver is the first.
Returns the full context of the source document after the position, up to the beginning of the given number of lines or the end of the document.
The char at the given position is the first one in the solution.
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
Returns the full context of the source document before the position, up to the beginning of the given number of lines, or the beginning of the document, whichever comes first.
The char at the given position is NOT included in the solution.
PRECONDITIONS:
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the position is unknown.
SourceReader/Errors.InvalidOperationAtEOIError if the position is at the end of input.
The exact portion of the source that is enclosed between the argument position and the receiver position (not included), both visible and non visible. If the receiver does not come after the argument, the result is the empty string.
PRECONDITIONS:
A SourcePosition related with the same SourceReader that the receiver. It indicates a starting position to consult, where the receiver is the last.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver or the argument positions are unknown.
SourceReader/Errors.MismatchedInputsError if the receiver and the argument positions do not belong to the same reader.
SourceReader/Errors.InvalidOperationAtEOIError if the receiver is the end of input.
The exact portion of the source, both visible and non visible, that is enclosed between the receiver position and the argument position (not included). If the argument does not come after the receiver, the result is the empty string.
PRECONDITIONS:
A SourcePosition related with the same SourceReader that the receiver. It indicates a final position to consult, where the receiver is the first.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver or the argument positions are unknown.
SourceReader/Errors.MismatchedInputsError if the receiver and the argument positions do not belong to the same reader.
SourceReader/Errors.InvalidOperationAtEOIError if the receiver is the end of input.
The exact portion of the source that is enclosed between the from
position and this
position (not included) and is visible. If this
does not come after from
, the result is the empty string.
PRECONDITIONS:
A SourcePosition related with the same SourceReader that the receiver. It indicates a starting position to consult, where the receiver is the last.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver or the argument positions are unknown.
SourceReader/Errors.MismatchedInputsError if the receiver and the argument positions do not belong to the same reader.
SourceReader/Errors.InvalidOperationAtEOIError if the receiver is the end of input.
The exact portion of the source that is enclosed between the this
position and to
position (not included) and is visible. If to
does
not come after this
, the result is the empty string.
PRECONDITIONS:
A SourcePosition related with the same SourceReader that the receiver. It indicates a final position to consult, where the receiver is the first.
SourceReader/Errors.InvalidOperationAtUnknownPositionError if the receiver or the argument positions are unknown.
SourceReader/Errors.MismatchedInputsError if the receiver and the argument positions do not belong to the same reader.
SourceReader/Errors.InvalidOperationAtEOIError if the receiver is the end of input.
An EndOfInputSourcePosition points to the EndOfInput position in a specific SourceReader. That position is reached when all input documents have been processed. It is a special position, because it does not point to a particular position inside a document in the source input, but to the end of it.