An
input
token
source
of
char
values.
sealed class
|
CodeInput
|
extends
|
CodeInputBase
|
The
CodeInput
supports
the
concepts
of
text
lines.
Two
consecutive
text
lines
are
separated
by
\r\n
,
\n
or
\r
tokens.
Returns the number of input tokens.
public
override
property
|
CharCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of input token. | |
implements
|
CodeInputBase.CharCount
|
Returns the number of rows in the input.
public
override
property
|
RowCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of rows. | |
overrides
|
CodeInputBase.RowCount
|
Returns the index-th token.
public
override
method
|
CharAt
(int32 index)
|
||
type
|
char
|
||
params
|
index
|
[0..CharCount-1]
|
Index of input token to return. |
returns
|
The input token. | ||
implements
|
CodeInputBase.CharAt
|
Returns the number of columns in the given input row.
[Pure]
|
||||
public
override
method
|
ColumnCount
(int32 row)
|
|||
type
|
int32
|
|||
params
|
row
|
[0..RowCount-1]
|
Index of input row. | |
returns
|
|
The number of columns in input row. | ||
overrides
|
CodeInputBase.ColumnCount
|
Creates a new instance of CodeInput.
public
static
method
|
FromChars
(char[] input,
int32 inputOffset,
int32 inputLength)
|
||
type
|
CodeInput
|
||
params
|
input
|
[not-null]
|
The input token array. |
inputOffset
|
[>=0]
|
Offset into input to first input token. | |
inputLength
|
[>=0]
|
Length of input token array, starting at inputOffset. | |
returns
|
|
The token input object. |
Remarks:
The given character array is used as is, no copying is performed.
Creates a new instance of CodeInput.
public
static
method
|
FromString
(string input)
|
||
type
|
CodeInput
|
||
params
|
input
|
[not-null]
|
The input string that represents the sequence of input tokens. |
returns
|
|
The token input object. |
Translates the given absolute token offset into row and column numbers.
[Pure]
|
||||
public
override
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). | |||
overrides
|
CodeInputBase.OffsetToRowColumn
|
Extracts a sequence of tokens.
[Pure]
|
||||
public
override
method
|
Range
(RangeI range)
|
|||
type
|
string
|
|||
params
|
range
|
The token range to extract. | ||
returns
|
The extracted tokens. | |||
implements
|
CodeInputBase.Range
|
Returns a single row of the input.
[Pure]
|
||||
public
override
method
|
Row
(int32 lineIdx)
|
|||
type
|
string
|
|||
params
|
lineIdx
|
[0..RowCount-1]
|
The row index. | |
returns
|
|
The input row. | ||
overrides
|
CodeInputBase.Row
|
Translates the given row and column number to an absolute token offset.
[Pure]
|
||||
public
override
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. | ||
overrides
|
CodeInputBase.RowColumnToOffset
|
[Pure]
|
||||
public
override
method
|
ToString
()
|
|||
type
|
string
|