Class: AdLint::Cc1::ArrayType
- Inherits:
-
Type
- Object
- Type
- AdLint::Cc1::ArrayType
show all
- Defined in:
- lib/adlint/cc1/type.rb
Instance Attribute Summary collapse
-
#base_type ⇒ Object
readonly
Returns the value of attribute base_type.
-
#length ⇒ Object
NOTE: Length of the array type may be deducted by the size of the initializer in interpret phase.
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
-
#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
-
#convertible?(to_type) ⇒ 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, base_type, len = nil) ⇒ ArrayType
constructor
A new instance of ArrayType.
-
#integer? ⇒ Boolean
-
#integer_conversion_rank ⇒ Object
-
#integer_promoted_type ⇒ Object
-
#location ⇒ Object
-
#max ⇒ Object
-
#member_named(name) ⇒ Object
-
#members ⇒ 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
-
#same_as?(type) ⇒ Boolean
-
#scalar? ⇒ Boolean
-
#signed? ⇒ Boolean
-
#standard? ⇒ Boolean
-
#struct? ⇒ Boolean
-
#undeclared? ⇒ Boolean
-
#undefined_value ⇒ Object
-
#union? ⇒ Boolean
-
#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?, #inspect, #more_cv_qualified?, #parameter?, #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, base_type, len = nil) ⇒ ArrayType
Returns a new instance of ArrayType.
5528
5529
5530
5531
5532
|
# File 'lib/adlint/cc1/type.rb', line 5528
def initialize(type_tbl, base_type, len = nil)
super(type_tbl, create_name(base_type, len))
@base_type = base_type
@length = len
end
|
Instance Attribute Details
#base_type ⇒ Object
Returns the value of attribute base_type.
5534
5535
5536
|
# File 'lib/adlint/cc1/type.rb', line 5534
def base_type
@base_type
end
|
NOTE: Length of the array type may be deducted by the size of the
initializer in interpret phase.
5538
5539
5540
|
# File 'lib/adlint/cc1/type.rb', line 5538
def length
@length
end
|
Instance Method Details
#_arithmetic_type_with_array(lhs_type, rhs_type = self) ⇒ Object
6067
6068
6069
6070
|
# File 'lib/adlint/cc1/type.rb', line 6067
def _arithmetic_type_with_array(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_bitfield(lhs_type, rhs_type = self) ⇒ Object
6047
6048
6049
6050
6051
6052
|
# File 'lib/adlint/cc1/type.rb', line 6047
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
5851
5852
5853
5854
5855
5856
|
# File 'lib/adlint/cc1/type.rb', line 5851
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
6034
6035
6036
6037
6038
|
# File 'lib/adlint/cc1/type.rb', line 6034
def _arithmetic_type_with_double(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_enum(lhs_type, rhs_type = self) ⇒ Object
6054
6055
6056
6057
6058
|
# File 'lib/adlint/cc1/type.rb', line 6054
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
6082
6083
6084
6085
6086
6087
|
# File 'lib/adlint/cc1/type.rb', line 6082
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
6028
6029
6030
6031
6032
|
# File 'lib/adlint/cc1/type.rb', line 6028
def _arithmetic_type_with_float(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_function(lhs_type, rhs_type = self) ⇒ Object
5847
5848
5849
|
# File 'lib/adlint/cc1/type.rb', line 5847
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
5914
5915
5916
5917
5918
|
# File 'lib/adlint/cc1/type.rb', line 5914
def _arithmetic_type_with_int(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_long(lhs_type, rhs_type = self) ⇒ Object
5946
5947
5948
5949
5950
|
# File 'lib/adlint/cc1/type.rb', line 5946
def _arithmetic_type_with_long(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_long_double(lhs_type, rhs_type = self) ⇒ Object
6040
6041
6042
6043
6044
6045
|
# File 'lib/adlint/cc1/type.rb', line 6040
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
5966
5967
5968
5969
5970
|
# File 'lib/adlint/cc1/type.rb', line 5966
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
5986
5987
5988
5989
5990
5991
|
# File 'lib/adlint/cc1/type.rb', line 5986
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
6007
6008
6009
6010
6011
6012
|
# File 'lib/adlint/cc1/type.rb', line 6007
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
6060
6061
6062
6063
6064
6065
|
# File 'lib/adlint/cc1/type.rb', line 6060
def _arithmetic_type_with_pointer(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_short(lhs_type, rhs_type = self) ⇒ Object
5872
5873
5874
5875
5876
5877
|
# File 'lib/adlint/cc1/type.rb', line 5872
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
5893
5894
5895
5896
5897
5898
|
# File 'lib/adlint/cc1/type.rb', line 5893
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
5920
5921
5922
5923
5924
|
# File 'lib/adlint/cc1/type.rb', line 5920
def _arithmetic_type_with_signed(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_signed_char(lhs_type, rhs_type = self) ⇒ Object
5858
5859
5860
5861
5862
5863
|
# File 'lib/adlint/cc1/type.rb', line 5858
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
5926
5927
5928
5929
5930
5931
|
# File 'lib/adlint/cc1/type.rb', line 5926
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
5952
5953
5954
5955
5956
5957
|
# File 'lib/adlint/cc1/type.rb', line 5952
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
5972
5973
5974
5975
5976
5977
|
# File 'lib/adlint/cc1/type.rb', line 5972
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
5993
5994
5995
5996
5997
5998
|
# File 'lib/adlint/cc1/type.rb', line 5993
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
6014
6015
6016
6017
6018
6019
|
# File 'lib/adlint/cc1/type.rb', line 6014
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
5879
5880
5881
5882
5883
5884
|
# File 'lib/adlint/cc1/type.rb', line 5879
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
5900
5901
5902
5903
5904
5905
|
# File 'lib/adlint/cc1/type.rb', line 5900
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
6072
6073
6074
6075
|
# File 'lib/adlint/cc1/type.rb', line 6072
def _arithmetic_type_with_struct(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_undeclared(lhs_type, rhs_type = self) ⇒ Object
5835
5836
5837
|
# File 'lib/adlint/cc1/type.rb', line 5835
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
6077
6078
6079
6080
|
# File 'lib/adlint/cc1/type.rb', line 6077
def _arithmetic_type_with_union(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_unresolved(lhs_type, rhs_type = self) ⇒ Object
5839
5840
5841
|
# File 'lib/adlint/cc1/type.rb', line 5839
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
5933
5934
5935
5936
5937
|
# File 'lib/adlint/cc1/type.rb', line 5933
def _arithmetic_type_with_unsigned(lhs_type, rhs_type = self)
lhs_type
end
|
#_arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self) ⇒ Object
5865
5866
5867
5868
5869
5870
|
# File 'lib/adlint/cc1/type.rb', line 5865
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
5939
5940
5941
5942
5943
5944
|
# File 'lib/adlint/cc1/type.rb', line 5939
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
5959
5960
5961
5962
5963
5964
|
# File 'lib/adlint/cc1/type.rb', line 5959
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
5979
5980
5981
5982
5983
5984
|
# File 'lib/adlint/cc1/type.rb', line 5979
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
6000
6001
6002
6003
6004
6005
|
# File 'lib/adlint/cc1/type.rb', line 6000
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
6021
6022
6023
6024
6025
6026
|
# File 'lib/adlint/cc1/type.rb', line 6021
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
5886
5887
5888
5889
5890
5891
|
# File 'lib/adlint/cc1/type.rb', line 5886
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
5907
5908
5909
5910
5911
5912
|
# File 'lib/adlint/cc1/type.rb', line 5907
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
5843
5844
5845
|
# File 'lib/adlint/cc1/type.rb', line 5843
def _arithmetic_type_with_void(lhs_type, rhs_type = self)
rhs_type.arithmetic_type_with(lhs_type)
end
|
#aligned_bit_size ⇒ Object
5576
5577
5578
|
# File 'lib/adlint/cc1/type.rb', line 5576
def aligned_bit_size
@length ? @base_type.aligned_bit_size * @length : 0
end
|
#arbitrary_value ⇒ Object
5761
5762
5763
|
# File 'lib/adlint/cc1/type.rb', line 5761
def arbitrary_value
ArrayValue.new(impl_length.times.map { @base_type.arbitrary_value })
end
|
5826
5827
5828
|
# File 'lib/adlint/cc1/type.rb', line 5826
def argument_promoted_type
self
end
|
#arithmetic_type_with(type) ⇒ Object
5830
5831
5832
5833
|
# File 'lib/adlint/cc1/type.rb', line 5830
def arithmetic_type_with(type)
type._arithmetic_type_with_array(self)
end
|
#array? ⇒ Boolean
5649
5650
5651
|
# File 'lib/adlint/cc1/type.rb', line 5649
def array?
true
end
|
#bit_alignment ⇒ Object
5572
5573
5574
|
# File 'lib/adlint/cc1/type.rb', line 5572
def bit_alignment
aligned_bit_size
end
|
5568
5569
5570
|
# File 'lib/adlint/cc1/type.rb', line 5568
def bit_size
@length ? @base_type.bit_size * @length : 0
end
|
#bitfield? ⇒ Boolean
5709
5710
5711
|
# File 'lib/adlint/cc1/type.rb', line 5709
def bitfield?
false
end
|
#brief_image ⇒ Object
5556
5557
5558
|
# File 'lib/adlint/cc1/type.rb', line 5556
def brief_image
create_brief_image(@base_type, @length)
end
|
#coerce_array_value(val) ⇒ Object
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
|
# File 'lib/adlint/cc1/type.rb', line 5782
def coerce_array_value(val)
vals = ([@base_type] * impl_length).zip(val.values).map { |type, v|
v ? v.coerce_to(type) : type.arbitrary_value
}
ArrayValue.new(vals)
end
|
#coerce_composite_value(val) ⇒ Object
5813
5814
5815
5816
|
# File 'lib/adlint/cc1/type.rb', line 5813
def coerce_composite_value(val)
undefined_value
end
|
#coerce_scalar_value(val) ⇒ Object
5777
5778
5779
5780
|
# File 'lib/adlint/cc1/type.rb', line 5777
def coerce_scalar_value(val)
undefined_value
end
|
#coercible?(to_type) ⇒ Boolean
5597
5598
5599
|
# File 'lib/adlint/cc1/type.rb', line 5597
def coercible?(to_type)
to_type.array? && @base_type.coercible?(to_type.base_type)
end
|
#compatible?(to_type) ⇒ Boolean
5592
5593
5594
5595
|
# File 'lib/adlint/cc1/type.rb', line 5592
def compatible?(to_type)
to_type.array? &&
@length == to_type.length && @base_type.compatible?(to_type.base_type)
end
|
#const? ⇒ Boolean
5697
5698
5699
|
# File 'lib/adlint/cc1/type.rb', line 5697
def const?
@base_type.const?
end
|
#convertible?(to_type) ⇒ Boolean
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
|
# File 'lib/adlint/cc1/type.rb', line 5601
def convertible?(to_type)
lhs_unqualified = self.real_type.unqualify
rhs_unqualified = to_type.real_type.unqualify
if rhs_unqualified.pointer? || rhs_unqualified.array?
lhs_base = lhs_unqualified.base_type
rhs_base = rhs_unqualified.base_type
unless lhs_base.more_cv_qualified?(rhs_base)
rhs_base.void? || lhs_base.convertible?(rhs_base)
else
false
end
else
false
end
end
|
#corresponding_signed_type ⇒ Object
6089
6090
6091
|
# File 'lib/adlint/cc1/type.rb', line 6089
def corresponding_signed_type
self
end
|
#corresponding_unsigned_type ⇒ Object
6093
6094
6095
|
# File 'lib/adlint/cc1/type.rb', line 6093
def corresponding_unsigned_type
self
end
|
6097
6098
6099
|
# File 'lib/adlint/cc1/type.rb', line 6097
def dup
ArrayType.new(type_table, @base_type.dup, @length)
end
|
#enum? ⇒ Boolean
5673
5674
5675
|
# File 'lib/adlint/cc1/type.rb', line 5673
def enum?
false
end
|
#enumerators ⇒ Object
5733
5734
5735
|
# File 'lib/adlint/cc1/type.rb', line 5733
def enumerators
[]
end
|
#explicitly_signed? ⇒ Boolean
5717
5718
5719
|
# File 'lib/adlint/cc1/type.rb', line 5717
def explicitly_signed?
false
end
|
#floating? ⇒ Boolean
5645
5646
5647
|
# File 'lib/adlint/cc1/type.rb', line 5645
def floating?
false
end
|
#function? ⇒ Boolean
5669
5670
5671
|
# File 'lib/adlint/cc1/type.rb', line 5669
def function?
false
end
|
#have_va_list? ⇒ Boolean
5721
5722
5723
|
# File 'lib/adlint/cc1/type.rb', line 5721
def have_va_list?
false
end
|
5545
5546
5547
5548
5549
5550
|
# File 'lib/adlint/cc1/type.rb', line 5545
def id
ArrayTypeId.new(@base_type, @length)
end
|
5552
5553
5554
|
# File 'lib/adlint/cc1/type.rb', line 5552
def image
create_image(@base_type, @length)
end
|
#impl_length ⇒ Object
5540
5541
5542
5543
|
# File 'lib/adlint/cc1/type.rb', line 5540
def impl_length
@length ? [[0, @length].max, MAX_LENGTH].min : 0
end
|
#incomplete? ⇒ Boolean
5588
5589
5590
|
# File 'lib/adlint/cc1/type.rb', line 5588
def incomplete?
@base_type.incomplete? || @length.nil?
end
|
#integer? ⇒ Boolean
5641
5642
5643
|
# File 'lib/adlint/cc1/type.rb', line 5641
def integer?
false
end
|
#integer_conversion_rank ⇒ Object
5818
5819
5820
|
# File 'lib/adlint/cc1/type.rb', line 5818
def integer_conversion_rank
0
end
|
5822
5823
5824
|
# File 'lib/adlint/cc1/type.rb', line 5822
def integer_promoted_type
self
end
|
5560
5561
5562
|
# File 'lib/adlint/cc1/type.rb', line 5560
def location
nil
end
|
5749
5750
5751
|
# File 'lib/adlint/cc1/type.rb', line 5749
def max
0
end
|
#member_named(name) ⇒ Object
5741
5742
5743
|
# File 'lib/adlint/cc1/type.rb', line 5741
def member_named(name)
nil
end
|
5737
5738
5739
|
# File 'lib/adlint/cc1/type.rb', line 5737
def members
[]
end
|
5745
5746
5747
|
# File 'lib/adlint/cc1/type.rb', line 5745
def min
0
end
|
#named? ⇒ Boolean
5564
5565
5566
|
# File 'lib/adlint/cc1/type.rb', line 5564
def named?
true
end
|
#nil_value ⇒ Object
5753
5754
5755
|
# File 'lib/adlint/cc1/type.rb', line 5753
def nil_value
ArrayValue.new(impl_length.times.map { @base_type.nil_value })
end
|
#parameter_types ⇒ Object
5729
5730
5731
|
# File 'lib/adlint/cc1/type.rb', line 5729
def parameter_types
[]
end
|
#parameter_value ⇒ Object
5769
5770
5771
|
# File 'lib/adlint/cc1/type.rb', line 5769
def parameter_value
ArrayValue.new(impl_length.times.map { @base_type.parameter_value })
end
|
#pointer? ⇒ Boolean
5661
5662
5663
|
# File 'lib/adlint/cc1/type.rb', line 5661
def pointer?
false
end
|
#qualified? ⇒ Boolean
5665
5666
5667
|
# File 'lib/adlint/cc1/type.rb', line 5665
def qualified?
false
end
|
#real_type ⇒ Object
5580
5581
5582
|
# File 'lib/adlint/cc1/type.rb', line 5580
def real_type
type_table.array_type(@base_type.real_type, @length)
end
|
#restrict? ⇒ Boolean
5705
5706
5707
|
# File 'lib/adlint/cc1/type.rb', line 5705
def restrict?
@base_type.restrict?
end
|
#return_type ⇒ Object
5725
5726
5727
|
# File 'lib/adlint/cc1/type.rb', line 5725
def return_type
nil
end
|
#return_value ⇒ Object
5773
5774
5775
|
# File 'lib/adlint/cc1/type.rb', line 5773
def return_value
ArrayValue.new(impl_length.times.map { @base_type.return_value })
end
|
#same_as?(type) ⇒ Boolean
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
|
# File 'lib/adlint/cc1/type.rb', line 5619
def same_as?(type)
lhs_unqualified = self.real_type.unqualify
rhs_unqualified = type.real_type.unqualify
case
when rhs_unqualified.array?
if lhs_unqualified.length
lhs_unqualified.length == rhs_unqualified.length
else
lhs_unqualified.base_type.same_as?(rhs_unqualified.base_type)
end
when rhs_unqualified.pointer?
lhs_unqualified.base_type.same_as?(rhs_unqualified.base_type)
else
false
end
end
|
#scalar? ⇒ Boolean
5637
5638
5639
|
# File 'lib/adlint/cc1/type.rb', line 5637
def scalar?
false
end
|
#signed? ⇒ Boolean
5713
5714
5715
|
# File 'lib/adlint/cc1/type.rb', line 5713
def signed?
false
end
|
#standard? ⇒ Boolean
5685
5686
5687
|
# File 'lib/adlint/cc1/type.rb', line 5685
def standard?
false
end
|
#struct? ⇒ Boolean
5653
5654
5655
|
# File 'lib/adlint/cc1/type.rb', line 5653
def struct?
false
end
|
#undeclared? ⇒ Boolean
5689
5690
5691
|
# File 'lib/adlint/cc1/type.rb', line 5689
def undeclared?
@base_type.undeclared?
end
|
#undefined_value ⇒ Object
5765
5766
5767
|
# File 'lib/adlint/cc1/type.rb', line 5765
def undefined_value
ArrayValue.new(impl_length.times.map { @base_type.undefined_value })
end
|
#union? ⇒ Boolean
5657
5658
5659
|
# File 'lib/adlint/cc1/type.rb', line 5657
def union?
false
end
|
#unqualify ⇒ Object
5584
5585
5586
|
# File 'lib/adlint/cc1/type.rb', line 5584
def unqualify
self
end
|
#unresolved? ⇒ Boolean
5693
5694
5695
|
# File 'lib/adlint/cc1/type.rb', line 5693
def unresolved?
@base_type.unresolved?
end
|
#user? ⇒ Boolean
5677
5678
5679
|
# File 'lib/adlint/cc1/type.rb', line 5677
def user?
false
end
|
#void? ⇒ Boolean
5681
5682
5683
|
# File 'lib/adlint/cc1/type.rb', line 5681
def void?
false
end
|
#volatile? ⇒ Boolean
5701
5702
5703
|
# File 'lib/adlint/cc1/type.rb', line 5701
def volatile?
@base_type.volatile?
end
|
#zero_value ⇒ Object
5757
5758
5759
|
# File 'lib/adlint/cc1/type.rb', line 5757
def zero_value
ArrayValue.new(impl_length.times.map { @base_type.zero_value })
end
|