Class: AdLint::Cc1::MemberAccessByPointerExpression

Inherits:
PostfixExpression show all
Defined in:
lib/adlint/cc1/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from PostfixExpression

#operator

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from PostfixExpression

#location

Methods inherited from Expression

#constant?, #full=, #object_specifiers

Methods inherited from SyntaxNode

#head_location, #location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(expr, id, arrow) ⇒ MemberAccessByPointerExpression

Returns a new instance of MemberAccessByPointerExpression.



1015
1016
1017
1018
1019
# File 'lib/adlint/cc1/syntax.rb', line 1015

def initialize(expr, id, arrow)
  super(arrow)
  @expression = expr
  @identifier = id
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



1021
1022
1023
# File 'lib/adlint/cc1/syntax.rb', line 1021

def expression
  @expression
end

#identifierObject (readonly)

Returns the value of attribute identifier.



1022
1023
1024
# File 'lib/adlint/cc1/syntax.rb', line 1022

def identifier
  @identifier
end

Instance Method Details

#arithmetic?Boolean

Returns:

  • (Boolean)


1032
1033
1034
# File 'lib/adlint/cc1/syntax.rb', line 1032

def arithmetic?
  false
end

#bitwise?Boolean

Returns:

  • (Boolean)


1036
1037
1038
# File 'lib/adlint/cc1/syntax.rb', line 1036

def bitwise?
  false
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


1024
1025
1026
# File 'lib/adlint/cc1/syntax.rb', line 1024

def have_side_effect?
  @expression.have_side_effect?
end

#inspect(indent = 0) ⇒ Object



1057
1058
1059
1060
# File 'lib/adlint/cc1/syntax.rb', line 1057

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{location.inspect}) " +
    "#{@expression.inspect}->#{@identifier.value}"
end

#logical?Boolean

Returns:

  • (Boolean)


1028
1029
1030
# File 'lib/adlint/cc1/syntax.rb', line 1028

def logical?
  false
end

#to_complemental_logicalObject



1049
1050
1051
# File 'lib/adlint/cc1/syntax.rb', line 1049

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/adlint/cc1/syntax.rb', line 1040

def to_normalized_logical(parent_expr = nil)
  case parent_expr
  when nil, LogicalAndExpression, LogicalOrExpression
    create_normalized_logical_of(self)
  else
    self
  end
end

#to_sObject



1053
1054
1055
# File 'lib/adlint/cc1/syntax.rb', line 1053

def to_s
  "#{@expression.to_s}->#{@identifier.value}"
end