Base interface for classes that provide input source code for parsing.
interface
|
ICodeInput
|
base of
|
CodeInputBase
|
Returns the number of input tokens.
property
|
CharCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of input token. |
Returns the number of rows in the input.
property
|
RowCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of rows. |
Returns the index-th token.
method
|
CharAt
(int32 index)
|
||
type
|
char
|
||
params
|
index
|
[0..CharCount-1]
|
Index of input token to return. |
returns
|
The input token. |
Returns the number of columns in the given input row.
[Pure]
|
||||
method
|
ColumnCount
(int32 row)
|
|||
type
|
int32
|
|||
params
|
row
|
[0..RowCount-1]
|
Index of input row. | |
returns
|
|
The number of columns in input row. |
Translates the given absolute token offset into row and column numbers.
[Pure]
|
||||
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). |
Extracts a sequence of tokens.
[Pure]
|
||||
method
|
Range
(RangeI range)
|
|||
type
|
string
|
|||
params
|
range
|
The token range to extract. | ||
returns
|
The extracted tokens. |
Returns a single row of the input.
[Pure]
|
||||
method
|
Row
(int32 lineIdx)
|
|||
type
|
string
|
|||
params
|
lineIdx
|
[0..RowCount-1]
|
The row index. | |
returns
|
|
The input row. |
Translates the given row and column number to an absolute token offset.
[Pure]
|
||||
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. |
Extracts the token sequence for the given AST node.
[Pure]
|
||||
method
|
RangeAst
(AstNode node)
|
|||
type
|
string
|
|||
params
|
node
|
[not-null]
|
The AST node. | |
returns
|
The extracted tokens. |
Extracts a sequence of tokens.
[Pure]
|
||||
method
|
RangeInterval
(int32 start,
int32 end)
|
|||
type
|
string
|
|||
params
|
start
|
[>=0]
|
Index of first input token to extract (inclusive). | |
end
|
[>=start]
|
Index of last input token to extract (exclusive). | ||
returns
|
The extracted tokens. |