C# Class 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.

Inheritance: ITokenSource
Afficher le fichier Open project: antlr/antlr4 Class Usage Examples

Protected Properties

Свойство Type Description
eofToken IToken
i int
tokens IList

Méthodes publiques

Méthode Description
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

Method Details

ListTokenSource() public méthode

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 /// /// . ///
Résultat System

ListTokenSource() public méthode

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). ///
Résultat System

NextToken() public méthode

public NextToken ( ) : IToken
Résultat IToken

Property Details

eofToken protected_oe property

This field caches the EOF token for the token source.
This field caches the EOF token for the token source.
protected IToken eofToken
Résultat IToken

i protected_oe property

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
Résultat int

tokens protected_oe property

The wrapped collection of IToken objects to return.
protected IList tokens
Résultat IList