ICodeInput

Description

interface Tinman.Core.Parsing.ICodeInput

Derived from

IText
IPathInfo

Extended by

CodeInput sealed

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

This interface provides access to the sequential character stream of the input source code via IText.CharAt and IText.CharsAt, which read data from the stream incrementally. Using other members of IText might trigger reading the whole data stream.

Public / Methods

As​Excerpt

2 overloads


public method AsExcerpt1 → (1)

offset in : TextPosition

The text position in the original input source code that corresponds to the first character of this excerpt.

returns → ICodeInput

The resulting code input object.

Creates an excerpt of this input source code.


public method AsExcerpt2 → (1)

ranges in : RangeI [ ]

The character offset ranges to use for creating the excerpt.

returns → ICodeInput

The resulting code input object.

Creates an excerpt of this input source code.

Discard


public method Discard → (1)

index in : int32

The character offset (exclusive) up to which to discard the input source code.

Discards the input source code up to the given character offset.

A parser may call this method when it has determined that it no longer needs the data it has already seen. An implementation may use this hint to free resources early, especially when parsing huge amounts of source code from a character stream.

To​Original

2 overloads


[Pure]
public method ToOriginal1 → (1)

index in : int32

The character offset in this excerpt code input.

returns → int32

The character offset in the original code input.

Translates the given character offset to the original input source code.


[Pure]
public method ToOriginal2 → (1)

range in : RangeI

The character offset range in this excerpt code input.

returns → RangeI

The character offset range in the original code input.

Translates the given character offset range to the original input source code.

Public / Attributes

Original


public attribute Original → (get)

value : ICodeInput

[not-null]
The original input source code, which may be this.

Returns the ICodeInput object that holds the original input source code.