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



6647
6648
6649
# File 'lib/adlint/cc1/type.rb', line 6647

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



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

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



6393
6394
6395
6396
6397
6398
6399
# File 'lib/adlint/cc1/type.rb', line 6393

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



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

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



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

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



6663
6664
6665
6666
6667
6668
6669
# File 'lib/adlint/cc1/type.rb', line 6663

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



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

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



6389
6390
6391
# File 'lib/adlint/cc1/type.rb', line 6389

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



6465
6466
6467
6468
6469
6470
# File 'lib/adlint/cc1/type.rb', line 6465

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



6504
6505
6506
6507
6508
6509
# File 'lib/adlint/cc1/type.rb', line 6504

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



6472
6473
6474
6475
6476
6477
6478
# File 'lib/adlint/cc1/type.rb', line 6472

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



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

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



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

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



6511
6512
6513
6514
6515
6516
6517
# File 'lib/adlint/cc1/type.rb', line 6511

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



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

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



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

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



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

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



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

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



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

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



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

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



6377
6378
6379
# File 'lib/adlint/cc1/type.rb', line 6377

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



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

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



6381
6382
6383
# File 'lib/adlint/cc1/type.rb', line 6381

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



6385
6386
6387
# File 'lib/adlint/cc1/type.rb', line 6385

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



6328
6329
6330
# File 'lib/adlint/cc1/type.rb', line 6328

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

#argument_promoted_typeObject



6369
6370
6371
# File 'lib/adlint/cc1/type.rb', line 6369

def argument_promoted_type
  self
end

#arithmetic_type_with(type) ⇒ Object



6373
6374
6375
# File 'lib/adlint/cc1/type.rb', line 6373

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



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

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

#coerce_composite_value(val) ⇒ Object



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

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



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

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



6671
6672
6673
# File 'lib/adlint/cc1/type.rb', line 6671

def corresponding_signed_type
  self # NOTREACHED
end

#corresponding_unsigned_typeObject



6675
6676
6677
# File 'lib/adlint/cc1/type.rb', line 6675

def corresponding_unsigned_type
  self # NOTREACHED
end

#dupObject



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

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



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

def integer_conversion_rank
  0 # NOTREACHED
end

#integer_promoted_typeObject



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

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



6316
6317
6318
# File 'lib/adlint/cc1/type.rb', line 6316

def max
  0
end

#member_named(name) ⇒ Object



6307
6308
6309
6310
# File 'lib/adlint/cc1/type.rb', line 6307

def member_named(name)
  # FIXME: Should use the member name index.
  @members.find { |memb| memb.name == name }
end

#minObject



6312
6313
6314
# File 'lib/adlint/cc1/type.rb', line 6312

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



6320
6321
6322
# File 'lib/adlint/cc1/type.rb', line 6320

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



6336
6337
6338
# File 'lib/adlint/cc1/type.rb', line 6336

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



6340
6341
6342
# File 'lib/adlint/cc1/type.rb', line 6340

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



6332
6333
6334
# File 'lib/adlint/cc1/type.rb', line 6332

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



6324
6325
6326
# File 'lib/adlint/cc1/type.rb', line 6324

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