ICodeInput

Description

interface Tinman.Core.Parsing.ICodeInput

Extended by

CodeInputBase abstract

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

Public / Methods

CharAt


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.

ColumnCount


[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.

OffsetToRowColumn


[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.

RowColumnToOffset


[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

CharCount


public attribute CharCount → (get)

value : int32

[>=0]
The number of input token.

Returns the number of input tokens.

RowCount


public attribute RowCount → (get)

value : int32

[>=0]
The number of rows.

Returns the number of rows in the input.

Extensions

RangeAst


[Pure]
public static method RangeAst → (1)

node in : AstNode

[not-null]
The AST node.

returns → string

The extracted tokens.

Extracts the token sequence for the given AST node.

RangeInterval


[Pure]
public static method RangeInterval → (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.