Home | Trees | Index | Help |
|
---|
Package yagdoc :: Module scanner :: Class Scanner |
|
object
--+
|
Scanner
Declaration scanner.
Attributes are only available afterscan
.
Method Summary | |
---|---|
__init__(self)
| |
Add declaration into the declaration dictionary, attempting to resolve name clashes. | |
Process and clear rectification queues. | |
Scan parse tree and macro list, build declaration list. | |
Scan one declaration (top-level parse tree item). | |
Scan one macro definition declaration (from tokenizer.Tokenizer ). | |
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
| |
Tree rectifiers | |
Split 'struct_multifield' parse tree items to individual
fields. | |
Split 'variable_def' parse tree items declaring multiple
variables to individual declarations. | |
Merge a typedef with its associated underscorized struct declaration. | |
Remove private declarations (starting with an underscore). |
Instance Variable Summary | |
---|---|
dict of Declaration |
declarations : Dictionary with declarations, indexed by symbol name. |
enum_map : Dictionary mapping enum values to top-level declarations. | |
list of {ScannerError} |
errors : Errors encountered. |
str |
source : Equal to parser.Parser.source instance variable. |
list of str |
type_funcs : Names of GType get-type functions. |
Method Details |
---|
split_multifields(self, decl)Split 'struct_multifield' tokens that are possibly multi-fields
and even contain all preceding directives, i.e. the declaration:
struct { /*< public >*/ int a, *b, c[3]; }gives raise to a single 'struct_multifield' . This
rectifier splits it into the equivalent of:
struct { /*< public >*/ int a; int *b; int c[3]; } where each line forms its own item (one
|
split_multivariable(self, decl)Split 'variable_def' declarations that can
declare multiple variables at once if the header file does so, i.e. the
declaration:
extern int a, *b, c[3];gives raise to a single 'variable_def' . This rectifier
splits it into the equivalent of:
extern int a; extern int *b; extern int c[3]; where each line forms its own top-level
'variable' are eliminated by
merging their contents one level up.
|
merge_g_typedef(self, decl)Merge a typedef with its associated underscorized struct declaration. Type definition and struct definitions:typedef struct _Whatever Whatever; struct _Whatever { ... };are merged to: typedef struct Whatever { ... }; and the underscorized struct definition is removed. The name of the struct and type must match (i.e. struct name must be type name with an underscore prepended). Subtrees of the two declarations are just reshuffled, not deep-copied, to form the merged declaration.
|
remove_private(self, decl)Remove private declarations (starting with an underscore). To be applied aftermerge_g_typedef which makes use of
declarations starting with an underscore.
|
add_declaration(self, decl)Add declaration into the declaration dictionary, attempting to resolve name clashes. If a declaration of the same name is already knownDeclaration.supersedes is used to
determine the winner that will appear in our declaration dictionary. If
none takes precedence over the another, the first declared wins but the
second is saved in self.duplicates and will likely cause a
warning later.
|
commit(self)Process and clear rectification queues. Removal queue is processed before addition, therefore it is possible to replace a declaration with a completely different by placing it into both queues. Is also goes through duplicates and tries to remove declarations supersedes by others. |
scan(self, parser, macros)Scan parse tree and macro list, build declaration list.
|
scan_declaration(self, statement)Scan one declaration (top-level parse tree item). |
scan_macro(self, macro)Scan one macro definition declaration (fromtokenizer.Tokenizer ).
|
Instance Variable Details |
---|
declarationsDictionary with declarations, indexed by symbol name.
|
enum_mapDictionary mapping enum values to top-level declarations. |
errorsErrors encountered.
|
sourceEqual toparser.Parser.source instance variable.
|
type_funcsNames of GType get-type functions.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Oct 5 00:36:53 2007 | http://epydoc.sf.net |