| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Tokenizer
A DNS master file format tokenizer.
A token is a (type, value) tuple, where type is an int, and value is a string. The valid types are EOF, EOL, WHITESPACE, IDENTIFIER, QUOTED_STRING, COMMENT, and DELIMITER.
|
|||
|
|||
| string |
|
||
| (string, int) tuple. The first item is the filename of the input, the second is the current line number. |
|
||
|
|||
| int |
|
||
| Token object |
|
||
|
|||
| (int, string) |
|
||
|
|||
| int |
|
||
| int |
|
||
| int |
|
||
| int |
|
||
| string |
|
||
| string |
|
||
| dns.name.Name object |
|
||
| string |
|
||
|
|||
|
Inherited from |
|||
|
|||
| dict |
delimiters The current delimiter dictionary. |
||
| bool |
eof This variable is true if the tokenizer has encountered EOF. |
||
| file |
file The file to tokenize |
||
| string |
filename A filename that will be returned by the where method. |
||
| int |
line_number The current line number |
||
| int |
multiline The current multiline level. |
||
| bool |
quoting This variable is true if the tokenizer is currently reading a quoted string. |
||
| string |
ungotten_char The most recently ungotten character, or None. |
||
| (int, string) token tuple |
ungotten_token The most recently ungotten token, or None. |
||
|
|||
|
Inherited from |
|||
|
|||
Initialize a tokenizer instance.
|
Unget a character. The unget buffer for characters is only one character large; it is an error to try to unget a character when the unget buffer is not empty.
|
Consume input until a non-whitespace character is encountered. The non-whitespace character is then ungotten, and the number of whitespace characters consumed is returned. If the tokenizer is in multiline mode, then newlines are whitespace.
|
Get the next token.
|
Unget a token. The unget buffer for tokens is only one token large; it is an error to try to unget a token when the unget buffer is not empty.
|
Read the next token and interpret it as an integer.
|
Read the next token and interpret it as an 8-bit unsigned integer.
|
Read the next token and interpret it as a 16-bit unsigned integer.
|
Read the next token and interpret it as a 32-bit unsigned integer.
|
Read the next token and interpret it as a string.
|
Read the next token and raise an exception if it is not an identifier.
|
Read the next token and interpret it as a DNS name.
|
Read the next token and raise an exception if it isn't EOL or EOF.
|
|
|||
multilineThe current multiline level. This value is increased by one every time a '(' delimiter is read, and decreased by one every time a ')' delimiter is read.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Mar 24 14:49:48 2011 | http://epydoc.sourceforge.net |