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
파일 보기 프로젝트 열기: antlr/antlr4 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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