tokenAtAs

inline fun <T : Token> tokenAtAs(index: Int): T

Returns the Token at the specified index, cast to type T.

Return

The token at the specified position, cast to T

Parameters

T

The expected token type

index

The zero-based index of the child

Throws

if no child exists at index, the child is not a token, or the token is not of type T