ICodeInput

Description

interface Tinman.Core.Parsing.ICodeInput

Extended by

CodeInputBase abstract

Base interface for classes that provide input source code for parsing.

Public / Methods

Char​At


public method CharAt → (1)

index in : int32

[0..ICodeInput.CharCount-1]
Index of input token to return.

returns → char

The input token.

Returns the index in-th token.

Column​Count


[Pure]
public method ColumnCount → (1)

row in : int32

[0..ICodeInput.RowCount-1]
Index of input row.

returns → int32

The number of columns in input row.

Returns the number of columns in the given input row.

Offset​To​Row​Column


[Pure]
public method OffsetToRowColumn → (1)

offset in : int32

[0..ICodeInput.CharCount]
The token offset.

returns → Vec2I

The zero-based row and column numbers (stored in Vec2I.Y and Vec2I.X respectively).

Translates the given absolute token offset into row and column numbers.

Range


[Pure]
public method Range → (1)

range in : RangeI

The token range to extract.

returns → string

The extracted tokens.

Extracts a sequence of tokens.

Row


[Pure]
public method Row → (1)

lineIdx in : int32

[0..ICodeInput.RowCount-1]
The row index.

returns → string

The input row.

Returns a single row of the input.

Row​Column​To​Offset


[Pure]
public method RowColumnToOffset → (2)

row in : int32

[0..ICodeInput.RowCount-1]
The row number.

column in : int32

[>=0]
The column number.

returns → int32

The token offset.

Translates the given row and column number to an absolute token offset.

Public / Attributes

Char​Count


public attribute CharCount → (get)

value : int32

[>=0]
The number of input token.

Returns the number of input tokens.

Row​Count


public attribute RowCount → (get)

value : int32

[>=0]
The number of rows.

Returns the number of rows in the input.

Extensions

Range


[Pure]
public static method Range → (2)

start in : int32

[>=0]
Index of first input token to extract (inclusive).

end in : int32

[>=start]
Index of last input token to extract (exclusive).

returns → string

The extracted tokens.

Extracts a sequence of tokens.