Searched refs:decl (Results 1 – 17 of 17) sorted by relevance
99 def get_packet_fields(decl: Union[PacketDeclaration, StructDeclaration]) -> List[Field]:104 if decl.parent:105 …fields = [f for f in get_packet_fields(decl.parent) if not isinstance(f, (PayloadField, BodyField)…106 return fields + decl.fields148 … decl: Union[PacketDeclaration, StructDeclaration]) -> Union[PacketDeclaration, StructDeclaration]:150 if decl.parent_id is None:151 return decl153 return get_packet_ancestor(decl.file.packet_scope[decl.parent_id])157 decl: Union[PacketDeclaration, StructDeclaration],166 for d in decl.file.declarations:[all …]
217 for decl in &file.declarations { in new()218 if let Some(id) = decl.id() { in new()219 if let Some(prev) = scope.typedef.insert(id.to_string(), decl) { in new()225 decl.kind(), in new()229 decl.loc.primary(), in new()249 pub fn get_parent(&self, decl: &crate::ast::Decl<A>) -> Option<&'d crate::ast::Decl<A>> { in get_parent()250 decl.parent_id().and_then(|parent_id| self.typedef.get(parent_id).cloned()) in get_parent()256 decl: &'d crate::ast::Decl<A>, in iter_parents()258 std::iter::successors(self.get_parent(decl), |decl| self.get_parent(decl)) in iter_parents()264 decl: &'d crate::ast::Decl<A>, in iter_fields()[all …]
37 decl: &'d analyzer_ast::Decl, field76 self.decl.fields() in iter_fields()82 self.decl.fields().find(|field| match &field.desc { in get_packet_field()91 self.decl in get_payload_field()98 self.decl.fields().find(|field| match &field.desc { in get_array_size_field()107 self.decl.fields().find(|field| match &field.desc { in get_payload_size_field()116 for f in self.decl.fields() { in finalize()132 for decl in &file.declarations { in new()133 if let Some(id) = decl.id() { in new()134 scope.typedef.insert(id.to_string(), decl); in new()[all …]
356 pub fn iter_children<'d>(&'d self, decl: &'d Decl<A>) -> impl Iterator<Item = &'d Decl<A>> { in iter_children()357 self.declarations.iter().filter(|other_decl| other_decl.parent_id() == decl.id()) in iter_children()
52 def get_field(decl: ast.Declaration, var: str, id: str) -> str:53 if isinstance(decl, ast.StructDeclaration):58 def check_members(decl: ast.Declaration, var: str, expected: object) -> List[str]:61 field = core.get_packet_field(decl, id)140 def build_packet(decl: ast.Declaration, var: str, initializer: object) -> (str, List[str]):141 fields = core.get_unconstrained_parent_fields(decl) + decl.fields199 … constructor_name = f'{decl.id}Builder' if isinstance(decl, ast.PacketDeclaration) else decl.id283 for decl in file.declarations:284 if decl.id in skipped_tests:287 if isinstance(decl, ast.PacketDeclaration):[all …]
485 …def get_payload_field_size(self, var: Optional[str], payload: ast.PayloadField, decl: ast.Declarat…490 if payload.parent.id == decl.id:495 child = decl507 variable_width.append(self.get_payload_field_size(var, f, decl))560 decl: ast.Declaration):587 array_size = self.get_payload_field_size(var, field, decl) + size_modifier651 def serialize(self, field: ast.Field, decl: ast.Declaration, var: Optional[str] = None):658 self.serialize_bit_field_(field, var, field_var, decl)680 def generate_enum_declaration(decl: ast.EnumDeclaration) -> str:683 enum_name = decl.id[all …]
828 decl = [] if packet.parent_id else ['fields = {\'payload\': None}']843 … return decl + validation + parser.code + specialization + [f"return {packet.id}(**fields), span"]881 def generate_packet_post_init(decl: ast.Declaration) -> List[str]:886 current = decl897 field = core.get_packet_field(decl, c.id)905 def generate_enum_declaration(decl: ast.EnumDeclaration) -> str:908 enum_name = decl.id910 for t in decl.tags:988 def generate_custom_field_declaration_check(decl: ast.CustomFieldDeclaration) -> str:1000 """).format(custom_field_name=decl.id)[all …]
124 let decl = self.scope.typedef.get(self.packet_name).unwrap(); in add_bit_field() localVariable125 let scope = self.scope.scopes.get(decl).unwrap(); in add_bit_field()135 let array_size = match (&value_field.desc, value_field_decl.map(|decl| &decl.desc)) in add_bit_field()138 if let ast::DeclDesc::Packet { .. } = &decl.desc { in add_bit_field()261 decl: Option<&analyzer_ast::Decl>, in add_array_field()271 if let Some(ast::DeclDesc::Enum { width, .. }) = decl.map(|decl| &decl.desc) { in add_array_field()298 let decl = self.scope.typedef[type_id]; in add_typedef_field() localVariable299 if let ast::DeclDesc::Struct { parent_id: Some(_), .. } = &decl.desc { in add_typedef_field()315 let decl = self.scope.typedef[self.packet_name]; in add_payload_field() localVariable316 let is_packet = matches!(&decl.desc, ast::DeclDesc::Packet { .. }); in add_payload_field()
280 decl: Option<&analyzer_ast::Decl>, in add_array_field()286 let element_width = match width.or_else(|| self.scope.get_decl_width(decl?, false)) { in add_array_field()320 let parse_element = self.parse_array_element(self.span, width, type_id, decl); in add_array_field()328 self.parse_array_element(&format_ident!("head"), width, type_id, decl); in add_array_field()453 let decl = self.scope.typedef[type_id]; in add_typedef_field() localVariable454 if let ast::DeclDesc::Struct { parent_id: Some(_), .. } = &decl.desc { in add_typedef_field()462 match self.scope.get_decl_width(decl, true) { in add_typedef_field()469 self.code.push(if let ast::DeclDesc::Checksum { .. } = &decl.desc { in add_typedef_field()550 let decl = self.scope.typedef[self.packet_name]; in add_payload_field() localVariable551 if let ast::DeclDesc::Struct { .. } = &decl.desc { in add_payload_field()[all …]
60 for decl in &file.declarations { in generate()61 match &decl.desc { in generate()73 .map(|decl| generate_decl(decl, schema, &children)) in generate()87 decl: &parser::ast::Decl, in generate_decl()91 match &decl.desc { in generate_decl()
49 curr_schema.computed_offsets.iter().map(|(decl, defn)| decl.declare_fn(defn.compute())), in generate_packet()52 curr_schema.computed_values.iter().map(|(decl, defn)| decl.declare_fn(defn.compute())), in generate_packet()
223 .filter_map(|decl| match &decl.desc { in generate_test_file()
100 let decl = scope.get_field_declaration(field); in generate_packet_size_getter() localVariable119 match &decl { in generate_packet_size_getter()130 scope.get_decl_width(decl.unwrap(), false).unwrap() / 8, in generate_packet_size_getter()167 let mut decl = scope.typedef[packet_name]; in top_level_packet() localVariable169 | ast::DeclDesc::Struct { parent_id: Some(parent_id), .. } = &decl.desc in top_level_packet()171 decl = scope.typedef[parent_id]; in top_level_packet()173 decl in top_level_packet()227 let decl = scope.typedef[id]; in generate_data_struct() localVariable228 let packet_scope = &scope.scopes[&decl]; in generate_data_struct()229 let is_packet = matches!(&decl.desc, ast::DeclDesc::Packet { .. }); in generate_data_struct()[all …]
107 for decl in &file.declarations { in generate()108 process_decl(&mut schema, decl); in generate()114 fn process_decl<'a>(schema: &mut Schema<'a>, decl: &'a parser::ast::Decl) { in process_decl()115 match &decl.desc { in process_decl()
540 …let AttAttributeDataChild::GattCharacteristicDeclarationValue(decl) = characteristic.value._child_… in test_service_change_indication()543 if decl.uuid == SERVICE_CHANGE_UUID.into() { in test_service_change_indication()544 Some(decl.handle) in test_service_change_indication()
1dictionary=main:pt_br,locale=pt_BR,description=Português (Brasil),date ...
1dictionary=main:pt_pt,locale=pt_PT,description=Português (Portugal),date ...