Antlr.Runtime.ClassicToken Class Reference

A Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object. These objects are needed for imaginary tree nodes that have payload objects. We need to create a Token object that has a string; the tree node will point at this token. CommonToken has indexes into a char stream and hence cannot be used to introduce new strings. More...

Inheritance diagram for Antlr.Runtime.ClassicToken:

Inheritance graph
[legend]
Collaboration diagram for Antlr.Runtime.ClassicToken:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ClassicToken (int type)
 ClassicToken (IToken oldToken)
 ClassicToken (int type, string text)
 ClassicToken (int type, string text, int channel)
override string ToString ()

Protected Attributes

internal string text
internal int type
internal int line
internal int charPositionInLine
internal int channel = Token.DEFAULT_CHANNEL
internal int index
 What token number is this from 0..n-1 tokens.

Properties

virtual int Type [get, set]
virtual int Line [get, set]
 The line number on which this token was matched; line=1..n.
virtual int CharPositionInLine [get, set]
 The index of the first character relative to the beginning of the line 0..n-1.
virtual int Channel [get, set]
virtual int TokenIndex [get, set]
 An index from 0..n-1 of the token object in the input stream.
virtual string Text [get, set]
 The text of the token.
virtual ICharStream InputStream [get, set]


Detailed Description

A Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object. These objects are needed for imaginary tree nodes that have payload objects. We need to create a Token object that has a string; the tree node will point at this token. CommonToken has indexes into a char stream and hence cannot be used to introduce new strings.

Definition at line 48 of file ClassicToken.cs.


Constructor & Destructor Documentation

Antlr.Runtime.ClassicToken.ClassicToken ( int  type  ) 

Definition at line 52 of file ClassicToken.cs.

Antlr.Runtime.ClassicToken.ClassicToken ( IToken  oldToken  ) 

Definition at line 57 of file ClassicToken.cs.

Antlr.Runtime.ClassicToken.ClassicToken ( int  type,
string  text 
)

Definition at line 66 of file ClassicToken.cs.

Antlr.Runtime.ClassicToken.ClassicToken ( int  type,
string  text,
int  channel 
)

Definition at line 72 of file ClassicToken.cs.


Member Function Documentation

override string Antlr.Runtime.ClassicToken.ToString (  ) 

Definition at line 125 of file ClassicToken.cs.


Member Data Documentation

internal string Antlr.Runtime.ClassicToken.text [protected]

Definition at line 150 of file ClassicToken.cs.

internal int Antlr.Runtime.ClassicToken.type [protected]

Definition at line 151 of file ClassicToken.cs.

internal int Antlr.Runtime.ClassicToken.line [protected]

Definition at line 152 of file ClassicToken.cs.

Definition at line 153 of file ClassicToken.cs.

Definition at line 154 of file ClassicToken.cs.

internal int Antlr.Runtime.ClassicToken.index [protected]

What token number is this from 0..n-1 tokens.

Definition at line 157 of file ClassicToken.cs.


Property Documentation

virtual int Antlr.Runtime.ClassicToken.Type [get, set]

Implements Antlr.Runtime.IToken.

Definition at line 84 of file ClassicToken.cs.

virtual int Antlr.Runtime.ClassicToken.Line [get, set]

The line number on which this token was matched; line=1..n.

Implements Antlr.Runtime.IToken.

Definition at line 90 of file ClassicToken.cs.

virtual int Antlr.Runtime.ClassicToken.CharPositionInLine [get, set]

The index of the first character relative to the beginning of the line 0..n-1.

Implements Antlr.Runtime.IToken.

Definition at line 96 of file ClassicToken.cs.

virtual int Antlr.Runtime.ClassicToken.Channel [get, set]

Implements Antlr.Runtime.IToken.

Definition at line 102 of file ClassicToken.cs.

virtual int Antlr.Runtime.ClassicToken.TokenIndex [get, set]

An index from 0..n-1 of the token object in the input stream.

This must be valid in order to use the ANTLRWorks debugger.

Implements Antlr.Runtime.IToken.

Definition at line 108 of file ClassicToken.cs.

virtual string Antlr.Runtime.ClassicToken.Text [get, set]

The text of the token.

When setting the text, it might be a NOP such as for the CommonToken, which doesn't have string pointers, just indexes into a char buffer.

Implements Antlr.Runtime.IToken.

Definition at line 114 of file ClassicToken.cs.

virtual ICharStream Antlr.Runtime.ClassicToken.InputStream [get, set]

Definition at line 120 of file ClassicToken.cs.


The documentation for this class was generated from the following file:

Generated on Wed Oct 1 14:13:24 2008 for ANTLR API by  doxygen 1.5.5