Class: AdLint::Cc1::ArraySubscriptExpression
Instance Attribute Summary collapse
#operator
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary
collapse
#location
Methods inherited from Expression
#constant?, #full=, #object_specifiers
Methods inherited from SyntaxNode
#head_location, #location, #short_class_name, #tail_location
#analysis_target?
Methods included from Visitable
#accept
Constructor Details
Returns a new instance of ArraySubscriptExpression.
865
866
867
868
869
|
# File 'lib/adlint/cc1/syntax.rb', line 865
def initialize(expr, ary_subs, left_bracket)
super(left_bracket)
@expression = expr
@array_subscript = ary_subs
end
|
Instance Attribute Details
#array_subscript ⇒ Object
Returns the value of attribute array_subscript.
872
873
874
|
# File 'lib/adlint/cc1/syntax.rb', line 872
def array_subscript
@array_subscript
end
|
#expression ⇒ Object
Returns the value of attribute expression.
871
872
873
|
# File 'lib/adlint/cc1/syntax.rb', line 871
def expression
@expression
end
|
Instance Method Details
#arithmetic? ⇒ Boolean
882
883
884
|
# File 'lib/adlint/cc1/syntax.rb', line 882
def arithmetic?
false
end
|
#bitwise? ⇒ Boolean
886
887
888
|
# File 'lib/adlint/cc1/syntax.rb', line 886
def bitwise?
false
end
|
#have_side_effect? ⇒ Boolean
874
875
876
|
# File 'lib/adlint/cc1/syntax.rb', line 874
def have_side_effect?
@expression.have_side_effect? || @array_subscript.have_side_effect?
end
|
#inspect(indent = 0) ⇒ Object
907
908
909
910
911
|
# File 'lib/adlint/cc1/syntax.rb', line 907
def inspect(indent = 0)
" " * indent + "#{short_class_name} (#{location.inspect})\n" +
@expression.inspect(indent + 1) + "\n" +
@array_subscript.inspect(indent + 1)
end
|
#logical? ⇒ Boolean
878
879
880
|
# File 'lib/adlint/cc1/syntax.rb', line 878
def logical?
false
end
|
#to_complemental_logical ⇒ Object
899
900
901
|
# File 'lib/adlint/cc1/syntax.rb', line 899
def to_complemental_logical
self
end
|
#to_normalized_logical(parent_expr = nil) ⇒ Object
890
891
892
893
894
895
896
897
|
# File 'lib/adlint/cc1/syntax.rb', line 890
def to_normalized_logical(parent_expr = nil)
case parent_expr
when nil, LogicalAndExpression, LogicalOrExpression
create_normalized_logical_of(self)
else
self
end
end
|
903
904
905
|
# File 'lib/adlint/cc1/syntax.rb', line 903
def to_s
"#{@expression.to_s}[#{@array_subscript.to_s}]"
end
|