TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class CodeInputBase in Tinman.Core.Parsing

Abstract base class for ICodeInput implementations.

abstract class CodeInputBase implements ICodeInput
  base of CodeInput

Remarks

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.

Public / Attributes

CharCount

Returns the number of input tokens.

public abstract property CharCount { get }
type int32
value [>=0] The number of input token.
implements ICodeInput.CharCount

RowCount

Returns the number of rows in the input.

public virtual property RowCount { get }
type int32
value [>=0] The number of rows.
implements ICodeInput.RowCount

Public / Methods

CharAt

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

ColumnCount

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 [>=0] The number of columns in input row.
implements ICodeInput.ColumnCount

OffsetToRowColumn

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

Range

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

Row

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 [not-null] The input row.
implements ICodeInput.Row

RowColumnToOffset

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 [0..CharCount] The token offset.
implements ICodeInput.RowColumnToOffset