| Home | Trees | Index | Help |  | 
|---|
| Package epydoc :: Package markup :: Module epytext :: Class Token | 
 | 
Tokens are an intermediate data structure used while 
constructing the structuring DOM tree for a formatted docstring. There 
are five types of Token:
The text contained in each Token is stored in the 
contents variable. The string in this variable has been 
normalized. For paragraphs, this means that it has been converted into a 
single line of text, with newline/indentation replaced by single spaces. 
For literal blocks and doctest blocks, this means that the appropriate 
amount of leading whitespace has been removed from each line.
Token has an indentation level associated with it, 
stored in the indent variable. This indentation level is 
used by the structuring procedure to assemble hierarchical blocks.
| Method Summary | |
|---|---|
| Create a new Token. | |
| string | Return the formal representation of this Token. | 
| xml.dom.minidom.Element | Return a DOM representation of this Token. | 
| Instance Variable Summary | |
|---|---|
| string | contents: The normalized text contained in thisToken. | 
| intorNone | indent: The indentation level of thisToken(in number of leading 
spaces). | 
| intorNone | level: The heading-level of thisTokenif it is a heading;None, otherwise. | 
| int | startline: The line on which thisTokenbegins. | 
| string | tag: ThisToken's type. | 
| Class Variable Summary | |
|---|---|
| string | BULLET: Thetagvalue for bulletTokens. | 
| string | DTBLOCK: Thetagvalue for doctestTokens. | 
| string | HEADING: Thetagvalue for headingTokens. | 
| string | LBLOCK: Thetagvalue for literalTokens. | 
| string | PARA: Thetagvalue for paragraphTokens. | 
| Method Details | 
|---|
| __init__(self,
          tag,
          startline,
          contents,
          indent,
          level=None)
    Create a new | 
| __repr__(self)
     | 
| to_dom(self, doc)
 | 
| Instance Variable Details | 
|---|
| contentsThe normalized text contained in thisToken.
 | 
| levelThe heading-level of thisTokenif it is a heading;None, otherwise. Valid heading levels are 0, 1, and 2.
 | 
| startlineThe line on which thisTokenbegins. This line number is 
only used for issuing errors.
 | 
| tagThisToken's type. Possible values areToken.PARA(paragraph),Token.LBLOCK(literal 
block),Token.DTBLOCK(doctest block),Token.HEADINGC, andToken.BULLETC.
 | 
| Class Variable Details | 
|---|
| BULLETThetagvalue for bulletTokens. Thistagvalue is also used for field tagTokens, 
since fields function syntactically the same as list items.
 | 
| DTBLOCKThetagvalue for doctestTokens.
 | 
| HEADINGThetagvalue for headingTokens.
 | 
| LBLOCKThetagvalue for literalTokens.
 | 
| PARAThetagvalue for paragraphTokens.
 | 
| Home | Trees | Index | Help |  | 
|---|
| Generated by Epydoc 2.1 on Sat Mar 20 17:46:13 2004 | http://epydoc.sf.net |