org.antlr.runtime.CommonToken Class Reference

Inheritance diagram for org.antlr.runtime.CommonToken:

Inheritance graph
[legend]
Collaboration diagram for org.antlr.runtime.CommonToken:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CommonToken (int type)
 CommonToken (CharStream input, int type, int channel, int start, int stop)
 CommonToken (int type, String text)
 CommonToken (Token oldToken)
int getType ()
void setLine (int line)
String getText ()
void setText (String text)
int getLine ()
int getCharPositionInLine ()
void setCharPositionInLine (int charPositionInLine)
int getChannel ()
void setChannel (int channel)
void setType (int type)
int getStartIndex ()
void setStartIndex (int start)
int getStopIndex ()
void setStopIndex (int stop)
int getTokenIndex ()
void setTokenIndex (int index)
CharStream getInputStream ()
void setInputStream (CharStream input)
String toString ()

Protected Attributes

int type
int line
int charPositionInLine = -1
int channel = DEFAULT_CHANNEL
transient CharStream input
String text
int index = -1
int start
int stop


Detailed Description

Definition at line 32 of file CommonToken.java.


Constructor & Destructor Documentation

org.antlr.runtime.CommonToken.CommonToken ( int  type  ) 

Definition at line 54 of file CommonToken.java.

org.antlr.runtime.CommonToken.CommonToken ( CharStream  input,
int  type,
int  channel,
int  start,
int  stop 
)

Definition at line 58 of file CommonToken.java.

org.antlr.runtime.CommonToken.CommonToken ( int  type,
String  text 
)

Definition at line 66 of file CommonToken.java.

org.antlr.runtime.CommonToken.CommonToken ( Token  oldToken  ) 

Definition at line 72 of file CommonToken.java.


Member Function Documentation

int org.antlr.runtime.CommonToken.getType (  ) 

Implements org.antlr.runtime.Token.

Definition at line 85 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setLine ( int  line  ) 

Implements org.antlr.runtime.Token.

Definition at line 89 of file CommonToken.java.

String org.antlr.runtime.CommonToken.getText (  ) 

Get the text of the token

Implements org.antlr.runtime.Token.

Definition at line 93 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setText ( String  text  ) 

Override the text for this token. getText() will return this text rather than pulling from the buffer. Note that this does not mean that start/stop indexes are not valid. It means that that input was converted to a new string in the token object.

Implements org.antlr.runtime.Token.

Definition at line 109 of file CommonToken.java.

int org.antlr.runtime.CommonToken.getLine (  ) 

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

Implements org.antlr.runtime.Token.

Definition at line 113 of file CommonToken.java.

int org.antlr.runtime.CommonToken.getCharPositionInLine (  ) 

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

Implements org.antlr.runtime.Token.

Definition at line 117 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setCharPositionInLine ( int  charPositionInLine  ) 

Implements org.antlr.runtime.Token.

Definition at line 121 of file CommonToken.java.

int org.antlr.runtime.CommonToken.getChannel (  ) 

Implements org.antlr.runtime.Token.

Definition at line 125 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setChannel ( int  channel  ) 

Implements org.antlr.runtime.Token.

Definition at line 129 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setType ( int  type  ) 

Implements org.antlr.runtime.Token.

Definition at line 133 of file CommonToken.java.

int org.antlr.runtime.CommonToken.getStartIndex (  ) 

Definition at line 137 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setStartIndex ( int  start  ) 

Definition at line 141 of file CommonToken.java.

int org.antlr.runtime.CommonToken.getStopIndex (  ) 

Definition at line 145 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setStopIndex ( int  stop  ) 

Definition at line 149 of file CommonToken.java.

int org.antlr.runtime.CommonToken.getTokenIndex (  ) 

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 org.antlr.runtime.Token.

Definition at line 153 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setTokenIndex ( int  index  ) 

Implements org.antlr.runtime.Token.

Definition at line 157 of file CommonToken.java.

CharStream org.antlr.runtime.CommonToken.getInputStream (  ) 

From what character stream was this token created? You don't have to implement but it's nice to know where a Token comes from if you have include files etc... on the input.

Implements org.antlr.runtime.Token.

Definition at line 161 of file CommonToken.java.

void org.antlr.runtime.CommonToken.setInputStream ( CharStream  input  ) 

Implements org.antlr.runtime.Token.

Definition at line 165 of file CommonToken.java.

String org.antlr.runtime.CommonToken.toString (  ) 

Definition at line 169 of file CommonToken.java.


Member Data Documentation

Definition at line 33 of file CommonToken.java.

Definition at line 34 of file CommonToken.java.

Definition at line 35 of file CommonToken.java.

Definition at line 36 of file CommonToken.java.

Definition at line 37 of file CommonToken.java.

We need to be able to change the text once in a while. If this is non-null, then getText should return this. Note that start/stop are not affected by changing this.

Definition at line 43 of file CommonToken.java.

What token number is this from 0..n-1 tokens; < 0 implies invalid index

Definition at line 46 of file CommonToken.java.

The char position into the input buffer where this token starts

Definition at line 49 of file CommonToken.java.

The char position into the input buffer where this token stops

Definition at line 52 of file CommonToken.java.


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

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