Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
scripts.idlnode.IDLArgument Class Reference
Inheritance diagram for scripts.idlnode.IDLArgument:
scripts.idlnode.IDLNode

Public Member Functions

 __init__ (self, ast, id=None)
 
 __repr__ (self)
 
- Public Member Functions inherited from scripts.idlnode.IDLNode
 __eq__ (self, other)
 
 __hash__ (self)
 
 reset_id (self, newId)
 
 all (self, type_filter=None)
 
 to_dict (self)
 
 to_hash (self)
 

Public Attributes

 ext_attrs
 
 default_value
 
 default_value_is_null
 
 type
 
 optional
 
 id
 
- Public Attributes inherited from scripts.idlnode.IDLNode
 id
 
 ext_attrs
 
 annotations
 
 members
 

Additional Inherited Members

- Protected Member Functions inherited from scripts.idlnode.IDLNode
 _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)
 

Detailed Description

IDLNode specialization for operation arguments.

Definition at line 1115 of file idlnode.py.

Constructor & Destructor Documentation

◆ __init__()

scripts.idlnode.IDLArgument.__init__ (   self,
  ast,
  id = None 
)
Initializes an IDLNode from a PegParser AST output.

Reimplemented from scripts.idlnode.IDLNode.

Definition at line 1118 of file idlnode.py.

1118 def __init__(self, ast, id=None):
1119 if ast:
1120 IDLNode.__init__(self, ast)
1121 else:
1122 # Synthesize an IDLArgument with no ast used for setlike.
1123 IDLNode.__init__(self, ast, id)
1124 self.ext_attrs = IDLExtAttrs()
1125 self.default_value = None
1126 self.default_value_is_null = False
1127 return
1128
1129 self.default_value = None
1130 self.default_value_is_null = False
1131 # Handle the 'argType arg = default'. IDL syntax changed from
1132 # [default=NullString].
1133 if not isinstance(ast, list):
1134 if isinstance(ast.default_value,
1135 idl_definitions.IdlLiteral) and ast.default_value:
1136 self.default_value = ast.default_value.value
1137 self.default_value_is_null = ast.default_value.is_null
1138 elif 'Default' in ast.extended_attributes:
1139 # Work around [Default=Undefined] for arguments - only look in the model's
1140 # default_value
1141 self.default_value = ast.extended_attributes.get('Default')
1142 self.default_value_is_null = False
1143
1144 self.type = self._convert_first(ast, 'Type', IDLType)
1145 self.type = resolveTypedef(self.type)
1146
1147 self.optional = self._has(ast, 'Optional')
1148 self._convert_ext_attrs(ast)
1149 # TODO(vsm): Recover this from the type instead.
1150 if 'Callback' in self.type.id:
1151 self.ext_attrs['Callback'] = None
1152

Member Function Documentation

◆ __repr__()

scripts.idlnode.IDLArgument.__repr__ (   self)
Generates string of the form <class id extra extra ... 0x12345678>.

Reimplemented from scripts.idlnode.IDLNode.

Definition at line 1153 of file idlnode.py.

1153 def __repr__(self):
1154 return '<IDLArgument(type = %s, id = %s)>' % (self.type, self.id)
1155
1156

Member Data Documentation

◆ default_value

scripts.idlnode.IDLArgument.default_value

Definition at line 1125 of file idlnode.py.

◆ default_value_is_null

scripts.idlnode.IDLArgument.default_value_is_null

Definition at line 1126 of file idlnode.py.

◆ ext_attrs

scripts.idlnode.IDLArgument.ext_attrs

Definition at line 1124 of file idlnode.py.

◆ id

scripts.idlnode.IDLArgument.id

Definition at line 1154 of file idlnode.py.

◆ optional

scripts.idlnode.IDLArgument.optional

Definition at line 1147 of file idlnode.py.

◆ type

scripts.idlnode.IDLArgument.type

Definition at line 1144 of file idlnode.py.


The documentation for this class was generated from the following file: