| Home | Trees | Index | Help |
|
|---|
| Package yagdoc :: Module tokenizer :: Class Tokenizer |
|
object --+
|
Tokenizer
Tokenizer and preprocessor.
Attributes are only available aftertokenize.
| Method Summary | |
|---|---|
__init__(self)
| |
Add a special range determined by preprocessor symbols. | |
Set preprocessor symbols assumed to be defined/undefined. | |
Perform source file tokenization and preprocessing. | |
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
| |
| Instance Variable Summary | |
|---|---|
list of TokenizerError |
errors: Errors encountered. |
list of str |
lines: Saved source lines (after trigraph resolution and stripping of
trailing whitespace). |
list of Macro |
macros: Macro definitions. |
bool |
private_header: True if private_header directive is encountered. |
ranges: Dictionary, indexed by range type names, of special range lists of
items (start, end), where start and
end are token numbers. | |
str |
source: Set to name attribute of the source, or
'<unknown>' is source has no such attribute. |
list of Token |
tokens: Source code tokens (in file order). |
| Method Details |
|---|
add_range_type(self, name, conditions)Add a special range determined by preprocessor symbols. If the range already exists, the conditions are added to it.
|
assume(self, conditions)Set preprocessor symbols assumed to be defined/undefined. The specified conditions are added to those already present. Unlisted preprocessor conditions do not cause any code exclusion, i.e. both branches are always processed. By default two conditions are known:
|
tokenize(self, source)Perform source file tokenization and preprocessing. If file is a private header (marked with/*< private_header
>*/ yagdoc directive), all output attributes are set to
values corresponding to an empty source and private_header is set to
True.
|
| Instance Variable Details |
|---|
errorsErrors encountered.
|
linesSaved source lines (after trigraph resolution and stripping of trailing whitespace).
|
macrosMacro definitions.
|
private_headerTrue if private_header directive is encountered.
|
rangesDictionary, indexed by range type names, of special range lists of items(start, end), where start and
end are token numbers.
|
sourceSet toname attribute of the source, or
'<unknown>' is source has no such attribute.
|
tokensSource code tokens (in file order).
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Fri Oct 5 00:36:53 2007 | http://epydoc.sf.net |