antlr3.Token Class Reference

Abstract token baseclass. More...

Inheritance diagram for antlr3.Token:

Inheritance graph
[legend]

List of all members.

Public Member Functions

def getText
 Get the text of the token.
def setText
 Set the text of the token.
def getType
 Get the type of the token.
def setType
 Get the type of the token.
def getLine
 Get the line number on which this token was matched.
def setLine
 Set the line number on which this token was matched.
def getCharPositionInLine
 Get the column of the tokens first character,.
def setCharPositionInLine
 Set the column of the tokens first character,.
def getChannel
 Get the channel of the token.
def setChannel
 Set the channel of the token.
def getTokenIndex
 Get the index in the input stream.
def setTokenIndex
 Set the index in the input stream.
def getInputStream
 From what character stream was this token created.
def setInputStream
 From what character stream was this token created.


Detailed Description

Abstract token baseclass.

Definition at line 564 of file antlr3.py.


Member Function Documentation

def antlr3.Token.getText (   self  ) 

Get the text of the token.

Using setter/getter methods is deprecated. Use o.text instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 571 of file antlr3.py.

def antlr3.Token.setText (   self,
  text 
)

Set the text of the token.

Using setter/getter methods is deprecated. Use o.text instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 579 of file antlr3.py.

def antlr3.Token.getType (   self  ) 

Get the type of the token.

Using setter/getter methods is deprecated. Use o.type instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 587 of file antlr3.py.

def antlr3.Token.setType (   self,
  ttype 
)

Get the type of the token.

Using setter/getter methods is deprecated. Use o.type instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 595 of file antlr3.py.

def antlr3.Token.getLine (   self  ) 

Get the line number on which this token was matched.

Lines are numbered 1..n

Using setter/getter methods is deprecated. Use o.line instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 606 of file antlr3.py.

def antlr3.Token.setLine (   self,
  line 
)

Set the line number on which this token was matched.

Using setter/getter methods is deprecated. Use o.line instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 614 of file antlr3.py.

def antlr3.Token.getCharPositionInLine (   self  ) 

Get the column of the tokens first character,.

Columns are numbered 0..n-1

Using setter/getter methods is deprecated. Use o.charPositionInLine instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 625 of file antlr3.py.

def antlr3.Token.setCharPositionInLine (   self,
  pos 
)

Set the column of the tokens first character,.

Using setter/getter methods is deprecated. Use o.charPositionInLine instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 633 of file antlr3.py.

def antlr3.Token.getChannel (   self  ) 

Get the channel of the token.

Using setter/getter methods is deprecated. Use o.channel instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 642 of file antlr3.py.

def antlr3.Token.setChannel (   self,
  channel 
)

Set the channel of the token.

Using setter/getter methods is deprecated. Use o.channel instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 650 of file antlr3.py.

def antlr3.Token.getTokenIndex (   self  ) 

Get the index in the input stream.

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.

Using setter/getter methods is deprecated. Use o.index instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 662 of file antlr3.py.

def antlr3.Token.setTokenIndex (   self,
  index 
)

Set the index in the input stream.

Using setter/getter methods is deprecated. Use o.index instead.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 670 of file antlr3.py.

def antlr3.Token.getInputStream (   self  ) 

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.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 680 of file antlr3.py.

def antlr3.Token.setInputStream (   self,
  input 
)

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.

Reimplemented in antlr3.CommonToken, and antlr3.ClassicToken.

Definition at line 689 of file antlr3.py.


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

Generated on Mon Nov 29 17:24:26 2010 for ANTLR Python API by  doxygen 1.5.5