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

This default implementation of ITokenFactory creates CommonToken objects.
Наследование: ITokenFactory
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
Default ITokenFactory

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

Свойство Тип Описание
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