Flutter Engine
The Flutter Engine
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

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

Public Attributes

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

Detailed Description

IDLNode specialization for operation arguments.

Definition at line 1115 of file idlnode.py.

Constructor & Destructor Documentation

◆ __init__()

def 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
def resolveTypedef(type)
Definition: idlnode.py:39

Member Function Documentation

◆ __repr__()

def 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.

◆ 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: