Skip to content

SourceReader.ReadToken Method ​

Definition ​

Creates a Token<TKind> of the specified kind and length starting at the current position, advancing the reader over it. Stops at the end of the file if it is reached first, shortening the token accordingly.

c#
public Token<TKind> ReadToken<TKind>(TKind kind, int length)
   where TKind : struct, Enum;

View source

Type Parameters ​

NameDescription
TKindThe type of the enum that identifies the different kinds of token.

Parameters ​

NameTypeDescription
kindTKindThe kind of the token.
lengthInt32The length of the token.

Returns ​

Token<TKind>

A new Token<TKind> instance.