Class: AdLint::Cc1::CompositeDataType

Inherits:
Type
  • Object
show all
Includes:
Scopeable
Defined in:
lib/adlint/cc1/type.rb

Overview

DESCRIPTION

Type of the ‘struct’ or ‘union’ data type.

The ISO C99 standard specifies that the ‘struct’ and array data type is an aggregate type. But the CompositeDataType is not an array type.

Direct Known Subclasses

StructType, UnionType

Instance Attribute Summary collapse

Attributes included from Scopeable

#scope

Attributes inherited from Type

#declarations, #name, #type_table

Instance Method Summary collapse

Methods inherited from Type

#==, #aligned_byte_size, #byte_alignment, #byte_size, #composite?, #convertible?, #inspect, #length=, #more_cv_qualified?, #parameter?, #same_as?, #struct?, #union?, #unsigned?

Methods included from StandardTypesAccessor

#char_alignment, #char_as_unsigned_char?, #char_size, #code_ptr_alignment, #code_ptr_size, #data_ptr_alignment, #data_ptr_size, #double_alignment, #double_size, #float_alignment, #float_size, #int_alignment, #int_size, #long_alignment, #long_double_alignment, #long_double_size, #long_long_alignment, #long_long_size, #long_size, #short_alignment, #short_size, #standard_types

Methods included from ArithmeticAccessor

#arithmetic, #logical_right_shift?

Methods included from Visitable

#accept

Constructor Details

#initialize(type_tbl, name, type_dcls, membs) ⇒ CompositeDataType

Returns a new instance of CompositeDataType.



6139
6140
6141
6142
# File 'lib/adlint/cc1/type.rb', line 6139

def initialize(type_tbl, name, type_dcls, membs)
  super(type_tbl, name, type_dcls)
  @members = membs
end

Instance Attribute Details

#membersObject (readonly)

Returns the value of attribute members.



6144
6145
6146
# File 'lib/adlint/cc1/type.rb', line 6144

def members
  @members
end

Instance Method Details

#_arithmetic_type_with_array(lhs_type, rhs_type = self) ⇒ Object



6657
6658
6659
# File 'lib/adlint/cc1/type.rb', line 6657

def _arithmetic_type_with_array(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end

#_arithmetic_type_with_bitfield(lhs_type, rhs_type = self) ⇒ Object



6633
6634
6635
6636
6637
6638
6639
# File 'lib/adlint/cc1/type.rb', line 6633

def _arithmetic_type_with_bitfield(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with BitfieldType and CompositeDataType makes
  #       integer-promoted type of BitfieldType.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_char(lhs_type, rhs_type = self) ⇒ Object



6403
6404
6405
6406
6407
6408
6409
# File 'lib/adlint/cc1/type.rb', line 6403

def _arithmetic_type_with_char(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `char' and CompositeDataType makes
  #       integer-promoted type of `char'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_double(lhs_type, rhs_type = self) ⇒ Object



6617
6618
6619
6620
6621
6622
6623
# File 'lib/adlint/cc1/type.rb', line 6617

def _arithmetic_type_with_double(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `double' and CompositeDataType makes
  #       `double'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_enum(lhs_type, rhs_type = self) ⇒ Object



6641
6642
6643
6644
6645
6646
6647
# File 'lib/adlint/cc1/type.rb', line 6641

def _arithmetic_type_with_enum(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with EnumType and CompositeDataType makes
  #       EnumType.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self) ⇒ Object



6673
6674
6675
6676
6677
6678
6679
# File 'lib/adlint/cc1/type.rb', line 6673

def _arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with ExtendedBigIntType and CompositeDataType
  #       makes ExtendedBigIntType.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_float(lhs_type, rhs_type = self) ⇒ Object



6609
6610
6611
6612
6613
6614
6615
# File 'lib/adlint/cc1/type.rb', line 6609

def _arithmetic_type_with_float(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `float' and CompositeDataType makes
  #       `float'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_function(lhs_type, rhs_type = self) ⇒ Object



6399
6400
6401
# File 'lib/adlint/cc1/type.rb', line 6399

def _arithmetic_type_with_function(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end

#_arithmetic_type_with_int(lhs_type, rhs_type = self) ⇒ Object



6475
6476
6477
6478
6479
6480
# File 'lib/adlint/cc1/type.rb', line 6475

def _arithmetic_type_with_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `int' and CompositeDataType makes `int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_long(lhs_type, rhs_type = self) ⇒ Object



6514
6515
6516
6517
6518
6519
# File 'lib/adlint/cc1/type.rb', line 6514

def _arithmetic_type_with_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `long' and CompositeDataType makes `long'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_long_double(lhs_type, rhs_type = self) ⇒ Object



6625
6626
6627
6628
6629
6630
6631
# File 'lib/adlint/cc1/type.rb', line 6625

def _arithmetic_type_with_long_double(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `long double' and CompositeDataType makes
  #       `long double'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_long_int(lhs_type, rhs_type = self) ⇒ Object



6537
6538
6539
6540
6541
6542
6543
# File 'lib/adlint/cc1/type.rb', line 6537

def _arithmetic_type_with_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `long int' and CompositeDataType makes
  #       `long int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_long_long(lhs_type, rhs_type = self) ⇒ Object



6561
6562
6563
6564
6565
6566
6567
# File 'lib/adlint/cc1/type.rb', line 6561

def _arithmetic_type_with_long_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `long long' and CompositeDataType makes
  #       `long long'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_long_long_int(lhs_type, rhs_type = self) ⇒ Object



6585
6586
6587
6588
6589
6590
6591
# File 'lib/adlint/cc1/type.rb', line 6585

def _arithmetic_type_with_long_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `long long int' and CompositeDataType makes
  #       `long long int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_pointer(lhs_type, rhs_type = self) ⇒ Object



6649
6650
6651
6652
6653
6654
6655
# File 'lib/adlint/cc1/type.rb', line 6649

def _arithmetic_type_with_pointer(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with PointerType and CompositeDataType makes
  #       PointerType.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_short(lhs_type, rhs_type = self) ⇒ Object



6427
6428
6429
6430
6431
6432
6433
# File 'lib/adlint/cc1/type.rb', line 6427

def _arithmetic_type_with_short(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `short' and CompositeDataType makes
  #       integer-promoted type of `short'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_short_int(lhs_type, rhs_type = self) ⇒ Object



6451
6452
6453
6454
6455
6456
6457
# File 'lib/adlint/cc1/type.rb', line 6451

def _arithmetic_type_with_short_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `short int' and CompositeDataType makes
  #       integer-promoted type of `short int'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_signed(lhs_type, rhs_type = self) ⇒ Object



6482
6483
6484
6485
6486
6487
6488
# File 'lib/adlint/cc1/type.rb', line 6482

def _arithmetic_type_with_signed(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed' and CompositeDataType makes
  #       `signed'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_signed_char(lhs_type, rhs_type = self) ⇒ Object



6411
6412
6413
6414
6415
6416
6417
# File 'lib/adlint/cc1/type.rb', line 6411

def _arithmetic_type_with_signed_char(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed char' and CompositeDataType makes
  #       integer-promoted type of `signed char'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_signed_int(lhs_type, rhs_type = self) ⇒ Object



6490
6491
6492
6493
6494
6495
6496
# File 'lib/adlint/cc1/type.rb', line 6490

def _arithmetic_type_with_signed_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed int' and CompositeDataType makes
  #       `signed int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_signed_long(lhs_type, rhs_type = self) ⇒ Object



6521
6522
6523
6524
6525
6526
6527
# File 'lib/adlint/cc1/type.rb', line 6521

def _arithmetic_type_with_signed_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed long' and CompositeDataType makes
  #       `signed long'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self) ⇒ Object



6545
6546
6547
6548
6549
6550
6551
# File 'lib/adlint/cc1/type.rb', line 6545

def _arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed long int' and CompositeDataType
  #       makes `signed long int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self) ⇒ Object



6569
6570
6571
6572
6573
6574
6575
# File 'lib/adlint/cc1/type.rb', line 6569

def _arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed long long' and CompositeDataType
  #       makes `signed long long'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self) ⇒ Object



6593
6594
6595
6596
6597
6598
6599
# File 'lib/adlint/cc1/type.rb', line 6593

def _arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed long long int' and
  #       CompositeDataType makes `signed long long int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_signed_short(lhs_type, rhs_type = self) ⇒ Object



6435
6436
6437
6438
6439
6440
6441
# File 'lib/adlint/cc1/type.rb', line 6435

def _arithmetic_type_with_signed_short(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed short' and CompositeDataType makes
  #       integer-promoted type of `signed short'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self) ⇒ Object



6459
6460
6461
6462
6463
6464
6465
# File 'lib/adlint/cc1/type.rb', line 6459

def _arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `signed short int' and CompositeDataType
  #       makes integer-promoted type of `signed short int'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_struct(lhs_type, rhs_type = self) ⇒ Object



6661
6662
6663
6664
6665
# File 'lib/adlint/cc1/type.rb', line 6661

def _arithmetic_type_with_struct(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_undeclared(lhs_type, rhs_type = self) ⇒ Object



6387
6388
6389
# File 'lib/adlint/cc1/type.rb', line 6387

def _arithmetic_type_with_undeclared(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end

#_arithmetic_type_with_union(lhs_type, rhs_type = self) ⇒ Object



6667
6668
6669
6670
6671
# File 'lib/adlint/cc1/type.rb', line 6667

def _arithmetic_type_with_union(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unresolved(lhs_type, rhs_type = self) ⇒ Object



6391
6392
6393
# File 'lib/adlint/cc1/type.rb', line 6391

def _arithmetic_type_with_unresolved(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end

#_arithmetic_type_with_unsigned(lhs_type, rhs_type = self) ⇒ Object



6498
6499
6500
6501
6502
6503
6504
# File 'lib/adlint/cc1/type.rb', line 6498

def _arithmetic_type_with_unsigned(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned' and CompositeDataType makes
  #       `unsigned'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self) ⇒ Object



6419
6420
6421
6422
6423
6424
6425
# File 'lib/adlint/cc1/type.rb', line 6419

def _arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned char' and CompositeDataType makes
  #       integer-promoted type of `unsigned char'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self) ⇒ Object



6506
6507
6508
6509
6510
6511
6512
# File 'lib/adlint/cc1/type.rb', line 6506

def _arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned int' and CompositeDataType makes
  #       `unsigned int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self) ⇒ Object



6529
6530
6531
6532
6533
6534
6535
# File 'lib/adlint/cc1/type.rb', line 6529

def _arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned long' and CompositeDataType makes
  #       `unsigned long'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self) ⇒ Object



6553
6554
6555
6556
6557
6558
6559
# File 'lib/adlint/cc1/type.rb', line 6553

def _arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned long int' and CompositeDataType
  #       makes `unsigned long int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self) ⇒ Object



6577
6578
6579
6580
6581
6582
6583
# File 'lib/adlint/cc1/type.rb', line 6577

def _arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned long long' and CompositeDataType
  #       makes `unsigned long long'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self) ⇒ Object



6601
6602
6603
6604
6605
6606
6607
# File 'lib/adlint/cc1/type.rb', line 6601

def _arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned long long int' and
  #       CompositeDataType makes `unsigned long long int'.
  lhs_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self) ⇒ Object



6443
6444
6445
6446
6447
6448
6449
# File 'lib/adlint/cc1/type.rb', line 6443

def _arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned short' and CompositeDataType
  #       makes integer-promoted type of `unsigned short'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self) ⇒ Object



6467
6468
6469
6470
6471
6472
6473
# File 'lib/adlint/cc1/type.rb', line 6467

def _arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with CompositeDataType must not be
  #       executed!
  # NOTE: Binary operation with `unsigned short int' and CompositeDataType
  #       makes integer-promoted type of `unsigned short int'.
  lhs_type.integer_promoted_type # NOTREACHED
end

#_arithmetic_type_with_void(lhs_type, rhs_type = self) ⇒ Object



6395
6396
6397
# File 'lib/adlint/cc1/type.rb', line 6395

def _arithmetic_type_with_void(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end

#aligned_bit_sizeObject



6174
6175
6176
# File 'lib/adlint/cc1/type.rb', line 6174

def aligned_bit_size
  @members.reduce(0) { |sum, memb| sum + memb.type.aligned_bit_size }
end

#arbitrary_valueObject



6338
6339
6340
# File 'lib/adlint/cc1/type.rb', line 6338

def arbitrary_value
  CompositeValue.new(@members.map { |memb| memb.type.arbitrary_value })
end

#argument_promoted_typeObject



6379
6380
6381
# File 'lib/adlint/cc1/type.rb', line 6379

def argument_promoted_type
  self
end

#arithmetic_type_with(type) ⇒ Object



6383
6384
6385
# File 'lib/adlint/cc1/type.rb', line 6383

def arithmetic_type_with(type)
  subclass_responsibility
end

#array?Boolean

Returns:

  • (Boolean)


6219
6220
6221
# File 'lib/adlint/cc1/type.rb', line 6219

def array?
  false
end

#base_typeObject



6182
6183
6184
# File 'lib/adlint/cc1/type.rb', line 6182

def base_type
  nil
end

#bit_alignmentObject



6170
6171
6172
# File 'lib/adlint/cc1/type.rb', line 6170

def bit_alignment
  bit_size
end

#bit_sizeObject



6166
6167
6168
# File 'lib/adlint/cc1/type.rb', line 6166

def bit_size
  @members.reduce(0) { |sum, memb| sum + memb.type.bit_size }
end

#bitfield?Boolean

Returns:

  • (Boolean)


6271
6272
6273
# File 'lib/adlint/cc1/type.rb', line 6271

def bitfield?
  false
end

#brief_imageObject



6154
6155
6156
# File 'lib/adlint/cc1/type.rb', line 6154

def brief_image
  subclass_responsibility
end

#coerce_array_value(val) ⇒ Object



6359
6360
6361
6362
# File 'lib/adlint/cc1/type.rb', line 6359

def coerce_array_value(val)
  # NOTE: Cannot coerce array value into composite in C language.
  undefined_value # NOTREACHED
end

#coerce_composite_value(val) ⇒ Object



6364
6365
6366
6367
6368
6369
# File 'lib/adlint/cc1/type.rb', line 6364

def coerce_composite_value(val)
  vals = @members.zip(val.values).map { |memb, v|
    v ? v.coerce_to(memb.type) : memb.type.undefined_value
  }
  CompositeValue.new(vals)
end

#coerce_scalar_value(val) ⇒ Object



6354
6355
6356
6357
# File 'lib/adlint/cc1/type.rb', line 6354

def coerce_scalar_value(val)
  # NOTE: Cannot coerce scalar value into composite in C language.
  undefined_value # NOTREACHED
end

#coercible?(to_type) ⇒ Boolean

Returns:

  • (Boolean)


6200
6201
6202
6203
6204
6205
# File 'lib/adlint/cc1/type.rb', line 6200

def coercible?(to_type)
  to_type.composite? &&
    @members.zip(to_type.members).all? { |lhs_memb, rhs_memb|
      rhs_memb && lhs_memb.type.coercible?(rhs_memb.type)
    }
end

#compatible?(to_type) ⇒ Boolean

Returns:

  • (Boolean)


6194
6195
6196
6197
6198
# File 'lib/adlint/cc1/type.rb', line 6194

def compatible?(to_type)
  to_type.composite? &&
    @members.size == to_type.members.size &&
    @members.zip(to_type.members).all? { |lhs, rhs| lhs.compatible?(rhs) }
end

#const?Boolean

Returns:

  • (Boolean)


6259
6260
6261
# File 'lib/adlint/cc1/type.rb', line 6259

def const?
  false
end

#corresponding_signed_typeObject



6681
6682
6683
# File 'lib/adlint/cc1/type.rb', line 6681

def corresponding_signed_type
  self # NOTREACHED
end

#corresponding_unsigned_typeObject



6685
6686
6687
# File 'lib/adlint/cc1/type.rb', line 6685

def corresponding_unsigned_type
  self # NOTREACHED
end

#dupObject



6689
6690
6691
6692
# File 'lib/adlint/cc1/type.rb', line 6689

def dup
  self.class.new(type_table, declarations.first,
                 @members.map { |memb| memb.dup })
end

#enum?Boolean

Returns:

  • (Boolean)


6235
6236
6237
# File 'lib/adlint/cc1/type.rb', line 6235

def enum?
  false
end

#enumeratorsObject



6295
6296
6297
# File 'lib/adlint/cc1/type.rb', line 6295

def enumerators
  []
end

#explicitly_signed?Boolean

Returns:

  • (Boolean)


6279
6280
6281
# File 'lib/adlint/cc1/type.rb', line 6279

def explicitly_signed?
  false
end

#floating?Boolean

Returns:

  • (Boolean)


6215
6216
6217
# File 'lib/adlint/cc1/type.rb', line 6215

def floating?
  false
end

#function?Boolean

Returns:

  • (Boolean)


6231
6232
6233
# File 'lib/adlint/cc1/type.rb', line 6231

def function?
  false
end

#have_va_list?Boolean

Returns:

  • (Boolean)


6283
6284
6285
# File 'lib/adlint/cc1/type.rb', line 6283

def have_va_list?
  false
end

#idObject



6146
6147
6148
# File 'lib/adlint/cc1/type.rb', line 6146

def id
  subclass_responsibility
end

#imageObject



6150
6151
6152
# File 'lib/adlint/cc1/type.rb', line 6150

def image
  subclass_responsibility
end

#impl_lengthObject



6303
6304
6305
# File 'lib/adlint/cc1/type.rb', line 6303

def impl_length
  0
end

#incomplete?Boolean

Returns:

  • (Boolean)


6190
6191
6192
# File 'lib/adlint/cc1/type.rb', line 6190

def incomplete?
  declarations.all? { |dcl| dcl.struct_declarations.nil? }
end

#integer?Boolean

Returns:

  • (Boolean)


6211
6212
6213
# File 'lib/adlint/cc1/type.rb', line 6211

def integer?
  false
end

#integer_conversion_rankObject



6371
6372
6373
# File 'lib/adlint/cc1/type.rb', line 6371

def integer_conversion_rank
  0 # NOTREACHED
end

#integer_promoted_typeObject



6375
6376
6377
# File 'lib/adlint/cc1/type.rb', line 6375

def integer_promoted_type
  self # NOTREACHED
end

#lengthObject



6299
6300
6301
# File 'lib/adlint/cc1/type.rb', line 6299

def length
  0
end

#locationObject



6158
6159
6160
# File 'lib/adlint/cc1/type.rb', line 6158

def location
  subclass_responsibility
end

#maxObject



6326
6327
6328
# File 'lib/adlint/cc1/type.rb', line 6326

def max
  0
end

#member_named(name) ⇒ Object



6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
# File 'lib/adlint/cc1/type.rb', line 6307

def member_named(name)
  # FIXME: Should use the member name index.
  @members.each do |memb|
    case
    when memb.name.nil? && memb.type.composite?
      if inner_memb = memb.type.member_named(name)
        return inner_memb
      end
    when memb.name == name
      return memb
    end
  end
  nil
end

#minObject



6322
6323
6324
# File 'lib/adlint/cc1/type.rb', line 6322

def min
  0
end

#named?Boolean

Returns:

  • (Boolean)


6162
6163
6164
# File 'lib/adlint/cc1/type.rb', line 6162

def named?
  subclass_responsibility
end

#nil_valueObject



6330
6331
6332
# File 'lib/adlint/cc1/type.rb', line 6330

def nil_value
  CompositeValue.new(@members.map { |memb| memb.type.nil_value })
end

#parameter_typesObject



6291
6292
6293
# File 'lib/adlint/cc1/type.rb', line 6291

def parameter_types
  []
end

#parameter_valueObject



6346
6347
6348
# File 'lib/adlint/cc1/type.rb', line 6346

def parameter_value
  CompositeValue.new(@members.map { |memb| memb.type.parameter_value })
end

#pointer?Boolean

Returns:

  • (Boolean)


6223
6224
6225
# File 'lib/adlint/cc1/type.rb', line 6223

def pointer?
  false
end

#qualified?Boolean

Returns:

  • (Boolean)


6227
6228
6229
# File 'lib/adlint/cc1/type.rb', line 6227

def qualified?
  false
end

#real_typeObject



6178
6179
6180
# File 'lib/adlint/cc1/type.rb', line 6178

def real_type
  self
end

#restrict?Boolean

Returns:

  • (Boolean)


6267
6268
6269
# File 'lib/adlint/cc1/type.rb', line 6267

def restrict?
  false
end

#return_typeObject



6287
6288
6289
# File 'lib/adlint/cc1/type.rb', line 6287

def return_type
  nil
end

#return_valueObject



6350
6351
6352
# File 'lib/adlint/cc1/type.rb', line 6350

def return_value
  CompositeValue.new(@members.map { |memb| memb.type.return_value })
end

#scalar?Boolean

Returns:

  • (Boolean)


6207
6208
6209
# File 'lib/adlint/cc1/type.rb', line 6207

def scalar?
  false
end

#signed?Boolean

Returns:

  • (Boolean)


6275
6276
6277
# File 'lib/adlint/cc1/type.rb', line 6275

def signed?
  false
end

#standard?Boolean

Returns:

  • (Boolean)


6247
6248
6249
# File 'lib/adlint/cc1/type.rb', line 6247

def standard?
  false
end

#undeclared?Boolean

Returns:

  • (Boolean)


6251
6252
6253
# File 'lib/adlint/cc1/type.rb', line 6251

def undeclared?
  @members.any? { |memb| memb.type.undeclared? }
end

#undefined_valueObject



6342
6343
6344
# File 'lib/adlint/cc1/type.rb', line 6342

def undefined_value
  CompositeValue.new(@members.map { |memb| memb.type.undefined_value })
end

#unqualifyObject



6186
6187
6188
# File 'lib/adlint/cc1/type.rb', line 6186

def unqualify
  self
end

#unresolved?Boolean

Returns:

  • (Boolean)


6255
6256
6257
# File 'lib/adlint/cc1/type.rb', line 6255

def unresolved?
  @members.any? { |memb| memb.type.unresolved? }
end

#user?Boolean

Returns:

  • (Boolean)


6239
6240
6241
# File 'lib/adlint/cc1/type.rb', line 6239

def user?
  false
end

#void?Boolean

Returns:

  • (Boolean)


6243
6244
6245
# File 'lib/adlint/cc1/type.rb', line 6243

def void?
  false
end

#volatile?Boolean

Returns:

  • (Boolean)


6263
6264
6265
# File 'lib/adlint/cc1/type.rb', line 6263

def volatile?
  false
end

#zero_valueObject



6334
6335
6336
# File 'lib/adlint/cc1/type.rb', line 6334

def zero_value
  CompositeValue.new(@members.map { |memb| memb.type.zero_value })
end