| Home | Trees | Index | Help |
|
|---|
| Package yagdoc :: Module scanner :: Class Declaration |
|
object --+
|
Declaration
One documentable declaration.
It supports comparison protocol, comparison is by position in the input file.| Method Summary | |
|---|---|
__init__(self,
kind,
name)
| |
__ge__(self,
other)
| |
__gt__(self,
other)
| |
__le__(self,
other)
| |
__lt__(self,
other)
| |
bool
|
Test whether declaration is a GType get-type function. |
str
|
Get declaration origin. |
list of str
|
Find all subordinate symbol names of a declaration. |
int
|
Check whether declaration supersedes another. |
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
| |
| Instance Variable Summary | |
|---|---|
str |
kind: Parse tree node name (e.g. |
str |
macro_kind: Macro subtype, only for macros. |
str |
name: Declared symbol name. |
tuple of int |
pos: Position in source code (line, column). |
str |
source: Header file name. |
list of str |
symbols: Subordinate symbol list. |
sequence of Token |
tokens: Token list, only for macros. |
Tree |
tree: Parse tree, only for non-macros. |
| Method Details |
|---|
is_type_func(self)Test whether declaration is a GType get-type function. The declaration must be a protype of the form (sans decorators):GType whatever_get_type(void);More precisely:
|
origin(self)Get declaration origin.
|
subnames(self)Find all subordinate symbol names of a declaration. Typical subordinate symbols are function arguments,
int foo(int x);
void bar(void* (*f)(int x));
struct baz {
void* (*quux)(int x);
union {
int i;
char c[4];
} v;
};
have the following subordinate symbols:
foo: x, return bar: f, f/return, f/x baz: quux, quux/return, quux/x, v, v/i, v/cThis function instantiates the symbols field for non-macros. Next calls
will not attempt to scan the symbols again, they will just return the
value of symbols. Should you even want to rescan
subsymbols, delete symbols first.
|
supersedes(self, other)Check whether declaration supersedes another. If a declaration supersedes another, it will silently replace it (i.e. no warning is issued) when a name clash occurs. This facility is primarily used to select the preferred declaration in common cases of multiple declaration of the same symbol. For instance
|
| Instance Variable Details |
|---|
kindParse tree node name (e.g.'prototype',
'enum_def', also 'macro').
|
macro_kindMacro subtype, only for macros. Set byclassify_macros, see its documentation.
|
nameDeclared symbol name. This is the identifier that introduces the source code docstring.
|
posPosition in source code(line, column).
|
sourceHeader file name.
|
symbolsSubordinate symbol list. For macros it is the argument list, available immediately. Other declarations gain this attribute aftersubnames. It is a list of tuples
(name, kind, ...) where
name is the symbol name, with '/' as
path separator, kind is the symbol kind:
|
tokensToken list, only for macros.
|
treeParse tree, only for non-macros.
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Fri Oct 5 00:36:53 2007 | http://epydoc.sf.net |