C# Класс Antlr4.Runtime.ListTokenSource

Provides an implementation of ITokenSource as a wrapper around a list of IToken objects.

If the final token in the list is an TokenConstants.EOF token, it will be used as the EOF token for every call to NextToken() after the end of the list is reached. Otherwise, an EOF token will be created.

Наследование: ITokenSource
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
eofToken IToken
i int
tokens IList

Открытые методы

Метод Описание
ListTokenSource ( IList tokens ) : System

Constructs a new ListTokenSource instance from the specified collection of IToken objects.

ListTokenSource ( IList tokens, string sourceName ) : System

Constructs a new ListTokenSource instance from the specified collection of IToken objects and source name.

NextToken ( ) : IToken

Описание методов

ListTokenSource() публичный метод

Constructs a new ListTokenSource instance from the specified collection of IToken objects.
/// NullPointerException /// if /// /// is /// ///
public ListTokenSource ( IList tokens ) : System
tokens IList /// The collection of /// /// objects to provide as a /// /// . ///
Результат System

ListTokenSource() публичный метод

Constructs a new ListTokenSource instance from the specified collection of IToken objects and source name.
/// NullPointerException /// if /// /// is /// ///
public ListTokenSource ( IList tokens, string sourceName ) : System
tokens IList /// The collection of /// /// objects to provide as a /// /// . ///
sourceName string /// The name of the /// /// . If this value is /// /// , /// /// will attempt to infer the name from /// the next /// /// (or the previous token if the end of the input has /// been reached). ///
Результат System

NextToken() публичный метод

public NextToken ( ) : IToken
Результат IToken

Описание свойств

eofToken защищенное свойство

This field caches the EOF token for the token source.
This field caches the EOF token for the token source.
protected IToken eofToken
Результат IToken

i защищенное свойство

The index into tokens of token to return by the next call to NextToken() . The end of the input is indicated by this value being greater than or equal to the number of items in tokens .
protected int i
Результат int

tokens защищенное свойство

The wrapped collection of IToken objects to return.
protected IList tokens
Результат IList