C# 클래스 Antlr4.Runtime.CommonTokenFactory

This default implementation of ITokenFactory creates CommonToken objects.
상속: ITokenFactory
파일 보기 프로젝트 열기: antlr/antlr4

공개 프로퍼티들

프로퍼티 타입 설명
Default ITokenFactory

보호된 프로퍼티들

프로퍼티 타입 설명
copyText bool

공개 메소드들

메소드 설명
CommonTokenFactory ( ) : System

Constructs a CommonTokenFactory with copyText set to .

The Default instance should be used instead of calling this directly.

CommonTokenFactory ( bool copyText ) : System

Constructs a CommonTokenFactory with the specified value for copyText .

When copyText is , the Default instance should be used instead of constructing a new instance.

Create ( ICharStream>.Tuple source, int type, string text, int channel, int start, int stop, int line, int charPositionInLine ) : CommonToken
Create ( int type, string text ) : CommonToken

비공개 메소드들

메소드 설명
ITokenFactory ( ICharStream>.Tuple source, int type, string text, int channel, int start, int stop, int line, int charPositionInLine ) : IToken
ITokenFactory ( int type, string text ) : IToken

메소드 상세

CommonTokenFactory() 공개 메소드

Constructs a CommonTokenFactory with copyText set to .

The Default instance should be used instead of calling this directly.

public CommonTokenFactory ( ) : System
리턴 System

CommonTokenFactory() 공개 메소드

Constructs a CommonTokenFactory with the specified value for copyText .

When copyText is , the Default instance should be used instead of constructing a new instance.

public CommonTokenFactory ( bool copyText ) : System
copyText bool /// The value for /// /// . ///
리턴 System

Create() 공개 메소드

public Create ( ICharStream>.Tuple source, int type, string text, int channel, int start, int stop, int line, int charPositionInLine ) : CommonToken
source ICharStream>.Tuple
type int
text string
channel int
start int
stop int
line int
charPositionInLine int
리턴 CommonToken

Create() 공개 메소드

public Create ( int type, string text ) : CommonToken
type int
text string
리턴 CommonToken

프로퍼티 상세

Default 공개적으로 정적으로 프로퍼티

The default CommonTokenFactory instance.

This token factory does not explicitly copy token text when constructing tokens.

public static ITokenFactory Default
리턴 ITokenFactory

copyText 보호되어 있는 프로퍼티

Indicates whether CommonToken.Text should be called after constructing tokens to explicitly set the text. This is useful for cases where the input stream might not be able to provide arbitrary substrings of text from the input after the lexer creates a token (e.g. the implementation of ICharStream.GetText(Antlr4.Runtime.Misc.Interval) in UnbufferedCharStream throws an System.NotSupportedException ). Explicitly setting the token text allows IToken.Text() to be called at any time regardless of the input stream implementation.

The default value is to avoid the performance and memory overhead of copying text for every token unless explicitly requested.

protected bool copyText
리턴 bool