Class: AdLint::Cc1::CompositeDataType
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.
Instance Attribute Summary collapse
Attributes included from Scopeable
#scope
Attributes inherited from Type
#declarations, #name, #type_table
Instance Method Summary
collapse
-
#_arithmetic_type_with_array(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_bitfield(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_char(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_double(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_enum(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_float(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_function(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_double(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_pointer(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_short(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_short_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_char(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_short(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_struct(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_undeclared(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_union(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unresolved(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_void(lhs_type, rhs_type = self) ⇒ Object
-
#aligned_bit_size ⇒ Object
-
#arbitrary_value ⇒ Object
-
#argument_promoted_type ⇒ Object
-
#arithmetic_type_with(type) ⇒ Object
-
#array? ⇒ Boolean
-
#base_type ⇒ Object
-
#bit_alignment ⇒ Object
-
#bit_size ⇒ Object
-
#bitfield? ⇒ Boolean
-
#brief_image ⇒ Object
-
#coerce_array_value(val) ⇒ Object
-
#coerce_composite_value(val) ⇒ Object
-
#coerce_scalar_value(val) ⇒ Object
-
#coercible?(to_type) ⇒ Boolean
-
#compatible?(to_type) ⇒ Boolean
-
#const? ⇒ Boolean
-
#corresponding_signed_type ⇒ Object
-
#corresponding_unsigned_type ⇒ Object
-
#dup ⇒ Object
-
#enum? ⇒ Boolean
-
#enumerators ⇒ Object
-
#explicitly_signed? ⇒ Boolean
-
#floating? ⇒ Boolean
-
#function? ⇒ Boolean
-
#have_va_list? ⇒ Boolean
-
#id ⇒ Object
-
#image ⇒ Object
-
#impl_length ⇒ Object
-
#incomplete? ⇒ Boolean
-
#initialize(type_tbl, name, type_dcls, membs) ⇒ CompositeDataType
constructor
A new instance of CompositeDataType.
-
#integer? ⇒ Boolean
-
#integer_conversion_rank ⇒ Object
-
#integer_promoted_type ⇒ Object
-
#length ⇒ Object
-
#location ⇒ Object
-
#max ⇒ Object
-
#member_named(name) ⇒ Object
-
#min ⇒ Object
-
#named? ⇒ Boolean
-
#nil_value ⇒ Object
-
#parameter_types ⇒ Object
-
#parameter_value ⇒ Object
-
#pointer? ⇒ Boolean
-
#qualified? ⇒ Boolean
-
#real_type ⇒ Object
-
#restrict? ⇒ Boolean
-
#return_type ⇒ Object
-
#return_value ⇒ Object
-
#scalar? ⇒ Boolean
-
#signed? ⇒ Boolean
-
#standard? ⇒ Boolean
-
#undeclared? ⇒ Boolean
-
#undefined_value ⇒ Object
-
#unqualify ⇒ Object
-
#unresolved? ⇒ Boolean
-
#user? ⇒ Boolean
-
#void? ⇒ Boolean
-
#volatile? ⇒ Boolean
-
#zero_value ⇒ Object
Methods inherited from Type
#==, #aligned_byte_size, #byte_alignment, #byte_size, #composite?, #convertible?, #inspect, #length=, #more_cv_qualified?, #parameter?, #same_as?, #struct?, #union?, #unsigned?
#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
#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
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)
lhs_type.integer_promoted_type
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)
lhs_type.integer_promoted_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type.integer_promoted_type
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)
lhs_type.integer_promoted_type
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)
lhs_type
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)
lhs_type.integer_promoted_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type.integer_promoted_type
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)
lhs_type.integer_promoted_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type.integer_promoted_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type
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)
lhs_type.integer_promoted_type
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)
lhs_type.integer_promoted_type
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_size ⇒ Object
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_value ⇒ Object
6338
6339
6340
|
# File 'lib/adlint/cc1/type.rb', line 6338
def arbitrary_value
CompositeValue.new(@members.map { |memb| memb.type.arbitrary_value })
end
|
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
6219
6220
6221
|
# File 'lib/adlint/cc1/type.rb', line 6219
def array?
false
end
|
#base_type ⇒ Object
6182
6183
6184
|
# File 'lib/adlint/cc1/type.rb', line 6182
def base_type
nil
end
|
#bit_alignment ⇒ Object
6170
6171
6172
|
# File 'lib/adlint/cc1/type.rb', line 6170
def bit_alignment
bit_size
end
|
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
6271
6272
6273
|
# File 'lib/adlint/cc1/type.rb', line 6271
def bitfield?
false
end
|
#brief_image ⇒ Object
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)
undefined_value
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)
undefined_value
end
|
#coercible?(to_type) ⇒ 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
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
6259
6260
6261
|
# File 'lib/adlint/cc1/type.rb', line 6259
def const?
false
end
|
#corresponding_signed_type ⇒ Object
6681
6682
6683
|
# File 'lib/adlint/cc1/type.rb', line 6681
def corresponding_signed_type
self
end
|
#corresponding_unsigned_type ⇒ Object
6685
6686
6687
|
# File 'lib/adlint/cc1/type.rb', line 6685
def corresponding_unsigned_type
self
end
|
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
6235
6236
6237
|
# File 'lib/adlint/cc1/type.rb', line 6235
def enum?
false
end
|
#enumerators ⇒ Object
6295
6296
6297
|
# File 'lib/adlint/cc1/type.rb', line 6295
def enumerators
[]
end
|
#explicitly_signed? ⇒ Boolean
6279
6280
6281
|
# File 'lib/adlint/cc1/type.rb', line 6279
def explicitly_signed?
false
end
|
#floating? ⇒ Boolean
6215
6216
6217
|
# File 'lib/adlint/cc1/type.rb', line 6215
def floating?
false
end
|
#function? ⇒ Boolean
6231
6232
6233
|
# File 'lib/adlint/cc1/type.rb', line 6231
def function?
false
end
|
#have_va_list? ⇒ Boolean
6283
6284
6285
|
# File 'lib/adlint/cc1/type.rb', line 6283
def have_va_list?
false
end
|
6146
6147
6148
|
# File 'lib/adlint/cc1/type.rb', line 6146
def id
subclass_responsibility
end
|
6150
6151
6152
|
# File 'lib/adlint/cc1/type.rb', line 6150
def image
subclass_responsibility
end
|
#impl_length ⇒ Object
6303
6304
6305
|
# File 'lib/adlint/cc1/type.rb', line 6303
def impl_length
0
end
|
#incomplete? ⇒ Boolean
6190
6191
6192
|
# File 'lib/adlint/cc1/type.rb', line 6190
def incomplete?
declarations.all? { |dcl| dcl.struct_declarations.nil? }
end
|
#integer? ⇒ Boolean
6211
6212
6213
|
# File 'lib/adlint/cc1/type.rb', line 6211
def integer?
false
end
|
#integer_conversion_rank ⇒ Object
6371
6372
6373
|
# File 'lib/adlint/cc1/type.rb', line 6371
def integer_conversion_rank
0
end
|
6375
6376
6377
|
# File 'lib/adlint/cc1/type.rb', line 6375
def integer_promoted_type
self
end
|
6299
6300
6301
|
# File 'lib/adlint/cc1/type.rb', line 6299
def length
0
end
|
6158
6159
6160
|
# File 'lib/adlint/cc1/type.rb', line 6158
def location
subclass_responsibility
end
|
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)
@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
|
6322
6323
6324
|
# File 'lib/adlint/cc1/type.rb', line 6322
def min
0
end
|
#named? ⇒ Boolean
6162
6163
6164
|
# File 'lib/adlint/cc1/type.rb', line 6162
def named?
subclass_responsibility
end
|
#nil_value ⇒ Object
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_types ⇒ Object
6291
6292
6293
|
# File 'lib/adlint/cc1/type.rb', line 6291
def parameter_types
[]
end
|
#parameter_value ⇒ Object
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
6223
6224
6225
|
# File 'lib/adlint/cc1/type.rb', line 6223
def pointer?
false
end
|
#qualified? ⇒ Boolean
6227
6228
6229
|
# File 'lib/adlint/cc1/type.rb', line 6227
def qualified?
false
end
|
#real_type ⇒ Object
6178
6179
6180
|
# File 'lib/adlint/cc1/type.rb', line 6178
def real_type
self
end
|
#restrict? ⇒ Boolean
6267
6268
6269
|
# File 'lib/adlint/cc1/type.rb', line 6267
def restrict?
false
end
|
#return_type ⇒ Object
6287
6288
6289
|
# File 'lib/adlint/cc1/type.rb', line 6287
def return_type
nil
end
|
#return_value ⇒ Object
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
6207
6208
6209
|
# File 'lib/adlint/cc1/type.rb', line 6207
def scalar?
false
end
|
#signed? ⇒ Boolean
6275
6276
6277
|
# File 'lib/adlint/cc1/type.rb', line 6275
def signed?
false
end
|
#standard? ⇒ Boolean
6247
6248
6249
|
# File 'lib/adlint/cc1/type.rb', line 6247
def standard?
false
end
|
#undeclared? ⇒ Boolean
6251
6252
6253
|
# File 'lib/adlint/cc1/type.rb', line 6251
def undeclared?
@members.any? { |memb| memb.type.undeclared? }
end
|
#undefined_value ⇒ Object
6342
6343
6344
|
# File 'lib/adlint/cc1/type.rb', line 6342
def undefined_value
CompositeValue.new(@members.map { |memb| memb.type.undefined_value })
end
|
#unqualify ⇒ Object
6186
6187
6188
|
# File 'lib/adlint/cc1/type.rb', line 6186
def unqualify
self
end
|
#unresolved? ⇒ Boolean
6255
6256
6257
|
# File 'lib/adlint/cc1/type.rb', line 6255
def unresolved?
@members.any? { |memb| memb.type.unresolved? }
end
|
#user? ⇒ Boolean
6239
6240
6241
|
# File 'lib/adlint/cc1/type.rb', line 6239
def user?
false
end
|
#void? ⇒ Boolean
6243
6244
6245
|
# File 'lib/adlint/cc1/type.rb', line 6243
def void?
false
end
|
#volatile? ⇒ Boolean
6263
6264
6265
|
# File 'lib/adlint/cc1/type.rb', line 6263
def volatile?
false
end
|
#zero_value ⇒ Object
6334
6335
6336
|
# File 'lib/adlint/cc1/type.rb', line 6334
def zero_value
CompositeValue.new(@members.map { |memb| memb.type.zero_value })
end
|