C# Class Antlr4.Runtime.CommonToken

Inheritance: IWritableToken
Datei anzeigen Open project: antlr/antlr4 Class Usage Examples

Protected Properties

Property Type Description
EmptySource ICharStream>.Tuple
charPositionInLine int
index int
start int
stop int

Public Methods

Method Description
CommonToken ( IToken oldToken ) : System

Constructs a new CommonToken as a copy of another IToken .

If oldToken is also a CommonToken instance, the newly constructed token will share a reference to the Text() field and the Tuple{T1, T2} stored in source . Otherwise, Text() will be assigned the result of calling Text() , and source will be constructed from the result of IToken.TokenSource() and IToken.InputStream() .

CommonToken ( ICharStream>.Tuple source, int type, int channel, int start, int stop ) : System
CommonToken ( int type ) : System

Constructs a new CommonToken with the specified token type.

CommonToken ( int type, string text ) : System

Constructs a new CommonToken with the specified token type and text.

ToString ( ) : string

Method Details

CommonToken() public method

Constructs a new CommonToken as a copy of another IToken .

If oldToken is also a CommonToken instance, the newly constructed token will share a reference to the Text() field and the Tuple{T1, T2} stored in source . Otherwise, Text() will be assigned the result of calling Text() , and source will be constructed from the result of IToken.TokenSource() and IToken.InputStream() .

public CommonToken ( IToken oldToken ) : System
oldToken IToken The token to copy.
return System

CommonToken() public method

public CommonToken ( ICharStream>.Tuple source, int type, int channel, int start, int stop ) : System
source ICharStream>.Tuple
type int
channel int
start int
stop int
return System

CommonToken() public method

Constructs a new CommonToken with the specified token type.
public CommonToken ( int type ) : System
type int The token type.
return System

CommonToken() public method

Constructs a new CommonToken with the specified token type and text.
public CommonToken ( int type, string text ) : System
type int The token type.
text string The text of the token.
return System

ToString() public method

public ToString ( ) : string
return string

Property Details

EmptySource protected_oe static_oe property

An empty Tuple{T1, T2} which is used as the default value of source for tokens that do not have a source.
protected static Tuple EmptySource
return ICharStream>.Tuple

charPositionInLine protected_oe property

This is the backing field for the Column property.
protected int charPositionInLine
return int

index protected_oe property

This is the backing field for the TokenIndex property.
protected int index
return int

start protected_oe property

This is the backing field for the StartIndex property.
protected int start
return int

stop protected_oe property

This is the backing field for the StopIndex property.
protected int stop
return int