Package yagdoc :: Module tokenizer :: Class Token
[show private | hide private]
[frames | no frames]

Type Token

object --+
         |
        Token


Single source code text token.
Method Summary
  __init__(self, what, line, column, text)
Create a new Token.
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variable Summary
int column: Input column number the token starts at.
int line: Input line number the token starts at.
str text: Text of the token.
single-character str type: Token type (soup letter).

Class Variable Summary
list __slots__ = ['type', 'line', 'column', 'text']

Method Details

__init__(self, what, line=0, column=0, text='')
(Constructor)

Create a new Token.

The constructor has two possible forms:
   # Copying constructor
   token = Token(another_token)

   # Construct from values
   token = Token(typ [,line, column, text])
Parameters:
what - Another token (it must be the only argument then), or token type letter.
           (type=Token or single-character str)
line - line field.
column - column field.
text - text field.
Overrides:
__builtin__.object.__init__

Instance Variable Details

column

Input column number the token starts at.
Type:
int
Value:
<member 'column' of 'Token' objects>                                   

line

Input line number the token starts at.
Type:
int
Value:
<member 'line' of 'Token' objects>                                     

text

Text of the token.
Type:
str
Value:
<member 'text' of 'Token' objects>                                     

type

Token type (soup letter).
Type:
single-character str
Value:
<member 'type' of 'Token' objects>                                     

Class Variable Details

__slots__

Type:
list
Value:
['type', 'line', 'column', 'text']                                     

Generated by Epydoc 2.1 on Fri Oct 5 00:36:53 2007 http://epydoc.sf.net