Flutter Engine
The Flutter Engine
|
Public Member Functions | |
__init__ (self, ast, id=None) | |
__repr__ (self) | |
__eq__ (self, other) | |
__hash__ (self) | |
reset_id (self, newId) | |
all (self, type_filter=None) | |
to_dict (self) | |
to_hash (self) | |
Public Attributes | |
id | |
ext_attrs | |
annotations | |
members | |
Protected Member Functions | |
_extra_repr (self) | |
_all_subnodes (self) | |
_to_hashable (self, obj) | |
_find_all (self, ast, label, max_results=sys.maxsize) | |
_find_first (self, ast, label) | |
_has (self, ast, label) | |
_convert_label_to_field (self, label) | |
_convert_all (self, ast, label, idlnode_ctor) | |
_convert_first (self, ast, label, idlnode_ctor) | |
_convert_ext_attrs (self, ast) | |
_convert_annotations (self, ast) | |
_convert_constants (self, ast, js_name) | |
Base class for all IDL elements. IDLNode may contain various child nodes, and have properties. Examples of IDLNode are interfaces, interface members, function arguments, etc.
Definition at line 59 of file idlnode.py.
scripts.idlnode.IDLNode.__init__ | ( | self, | |
ast, | |||
id = None |
|||
) |
Initializes an IDLNode from a PegParser AST output.
Reimplemented in scripts.idlnode.IDLDictNode, scripts.idlnode.IDLModule, scripts.idlnode.IDLEnum, scripts.idlnode.IDLCallbackFunction, scripts.idlnode.IDLTypeDef, scripts.idlnode.IDLParentInterface, scripts.idlnode.IDLImplementsStatement, scripts.idlnode.IDLAttribute, scripts.idlnode.IDLConstant, scripts.idlnode.IDLDictionaryMember, scripts.idlnode.IDLOperation, scripts.idlnode.IDLMember, scripts.idlnode.IDLFile, scripts.idlnode.IDLType, scripts.idlnode.IDLInterface, scripts.idlnode.IDLArgument, scripts.idlnode.IDLDictionary, scripts.idlnode.IDLExtAttrs, scripts.idlnode.IDLAnnotations, scripts.idlnode.IDLAnnotation, scripts.idlnode.IDLDictionaryMembers, and scripts.idlnode.IDLExtAttrFunctionValue.
Definition at line 66 of file idlnode.py.
scripts.idlnode.IDLNode.__eq__ | ( | self, | |
other | |||
) |
Override default equals operation. IDLNodes are equal if all their properties are equal.
Definition at line 92 of file idlnode.py.
scripts.idlnode.IDLNode.__hash__ | ( | self | ) |
Define default hashing behavior. In order to comply with a == b => hash(a) == hash(b), we recursively iterate self.__dict__ and convert all objects to hashable objects.
Definition at line 99 of file idlnode.py.
scripts.idlnode.IDLNode.__repr__ | ( | self | ) |
Generates string of the form <class id extra extra ... 0x12345678>.
Reimplemented in scripts.idlnode.IDLOperation, and scripts.idlnode.IDLArgument.
Definition at line 74 of file idlnode.py.
|
protected |
Accessor used by all() to find subnodes.
Reimplemented in scripts.idlnode.IDLDictNode, and scripts.idlnode.IDLExtAttrs.
Definition at line 130 of file idlnode.py.
|
protected |
Converts AST elements into IDLNode elements. Uses _find_all to find elements with a given label and converts them into IDLNodes with a given constructor. Returns: A list of the converted nodes. Args: ast -- the ast element to start a search at. label -- the element label to look for. idlnode_ctor -- a constructor function of one of the IDLNode sub-classes.
Definition at line 306 of file idlnode.py.
|
protected |
Helper method for uniform conversion of annotations.
Definition at line 340 of file idlnode.py.
|
protected |
Helper method for uniform conversion of dictionary members.
Definition at line 344 of file idlnode.py.
|
protected |
Helper method for uniform conversion of extended attributes.
Definition at line 336 of file idlnode.py.
|
protected |
Like _convert_all, but only converts the first found results.
Definition at line 329 of file idlnode.py.
|
protected |
Definition at line 270 of file idlnode.py.
|
protected |
Returns string of extra info for __repr__().
Reimplemented in scripts.idlnode.IDLOperation, and scripts.idlnode.IDLAttribute.
Definition at line 88 of file idlnode.py.
|
protected |
Searches the AST for tuples with a given label. The PegParser output is composed of lists and tuples, where the tuple 1st argument is a label. If ast root is a list, will search recursively inside each member in the list. Args: ast -- the AST to search. label -- the label to look for. res -- results are put into this list. max_results -- maximum number of results.
Definition at line 191 of file idlnode.py.
|
protected |
Convenience method for _find_all(..., max_results=1). Returns a single element instead of a list, or None if nothing is found.
Definition at line 255 of file idlnode.py.
|
protected |
Returns true if an element with the given label is in the AST by searching for it.
Definition at line 264 of file idlnode.py.
|
protected |
Definition at line 165 of file idlnode.py.
scripts.idlnode.IDLNode.all | ( | self, | |
type_filter = None |
|||
) |
Returns a list containing this node and all it child nodes (recursive). Args: type_filter -- can be used to limit the results to a specific node type (e.g. IDLOperation).
Definition at line 110 of file idlnode.py.
scripts.idlnode.IDLNode.reset_id | ( | self, | |
newId | |||
) |
Reset the id of the Node. This is typically done during a normalization phase (e.g., "DOMWindow" -> "Window").
Reimplemented in scripts.idlnode.IDLInterface.
Definition at line 105 of file idlnode.py.
scripts.idlnode.IDLNode.to_dict | ( | self | ) |
Converts the IDLNode and its children into a dictionary. This method is useful mostly for debugging and pretty printing.
Reimplemented in scripts.idlnode.IDLDictNode.
Definition at line 134 of file idlnode.py.
scripts.idlnode.IDLNode.to_hash | ( | self | ) |
Definition at line 162 of file idlnode.py.
scripts.idlnode.IDLNode.annotations |
Definition at line 342 of file idlnode.py.
scripts.idlnode.IDLNode.ext_attrs |
Definition at line 338 of file idlnode.py.
scripts.idlnode.IDLNode.id |
Definition at line 69 of file idlnode.py.
scripts.idlnode.IDLNode.members |
Definition at line 346 of file idlnode.py.