Abstract base class for ICodeInput implementations.
abstract class
|
CodeInputBase
|
implements
|
ICodeInput
|
||
base of
|
CodeInput
|
The input tokens can be organized into rows (e.g. lines of text). The default implementations of RowCount, ColumnCount, Row, OffsetToRowColumn and RowColumnToOffset assume that there is a single row that covers all input tokens.
Returns the number of input tokens.
public
abstract
property
|
CharCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of input token. | |
implements
|
ICodeInput.CharCount
|
Returns the number of rows in the input.
public
virtual
property
|
RowCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of rows. | |
implements
|
ICodeInput.RowCount
|
Returns the index-th token.
public
abstract
method
|
CharAt
(int32 index)
|
||
type
|
char
|
||
params
|
index
|
[0..CharCount-1]
|
Index of input token to return. |
returns
|
The input token. | ||
implements
|
ICodeInput.CharAt
|
Returns the number of columns in the given input row.
[Pure]
|
||||
public
virtual
method
|
ColumnCount
(int32 row)
|
|||
type
|
int32
|
|||
params
|
row
|
[0..RowCount-1]
|
Index of input row. | |
returns
|
|
The number of columns in input row. | ||
implements
|
ICodeInput.ColumnCount
|
Translates the given absolute token offset into row and column numbers.
[Pure]
|
||||
public
virtual
method
|
OffsetToRowColumn
(int32 offset)
|
|||
type
|
Vec2I
|
|||
params
|
offset
|
[0..CharCount]
|
The token offset. | |
returns
|
The zero-based row and column numbers (stored in Y and X respectively). | |||
implements
|
ICodeInput.OffsetToRowColumn
|
Extracts a sequence of tokens.
[Pure]
|
||||
public
abstract
method
|
Range
(RangeI range)
|
|||
type
|
string
|
|||
params
|
range
|
The token range to extract. | ||
returns
|
The extracted tokens. | |||
implements
|
ICodeInput.Range
|
Returns a single row of the input.
[Pure]
|
||||
public
virtual
method
|
Row
(int32 lineIdx)
|
|||
type
|
string
|
|||
params
|
lineIdx
|
[0..RowCount-1]
|
The row index. | |
returns
|
|
The input row. | ||
implements
|
ICodeInput.Row
|
Translates the given row and column number to an absolute token offset.
[Pure]
|
||||
public
virtual
method
|
RowColumnToOffset
(int32 row,
int32 column)
|
|||
type
|
int32
|
|||
params
|
row
|
[0..RowCount-1]
|
The row number. | |
column
|
[>=0]
|
The column number. | ||
returns
|
|
The token offset. | ||
implements
|
ICodeInput.RowColumnToOffset
|