Class: AdLint::Cc1::PostfixIncrementExpression

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(op, ope) ⇒ PostfixIncrementExpression

Returns a new instance of PostfixIncrementExpression.



1162
1163
1164
1165
# File 'lib/adlint/cc1/syntax.rb', line 1162

def initialize(op, ope)
  super(op)
  @operand = ope
end

Instance Attribute Details

#operandObject (readonly)

Returns the value of attribute operand.



1167
1168
1169
# File 'lib/adlint/cc1/syntax.rb', line 1167

def operand
  @operand
end

Instance Method Details

#arithmetic?Boolean

Returns:

  • (Boolean)


1177
1178
1179
# File 'lib/adlint/cc1/syntax.rb', line 1177

def arithmetic?
  true
end

#bitwise?Boolean

Returns:

  • (Boolean)


1181
1182
1183
# File 'lib/adlint/cc1/syntax.rb', line 1181

def bitwise?
  false
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


1169
1170
1171
# File 'lib/adlint/cc1/syntax.rb', line 1169

def have_side_effect?
  true
end

#inspect(indent = 0) ⇒ Object



1202
1203
1204
1205
# File 'lib/adlint/cc1/syntax.rb', line 1202

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{location.inspect}) " +
    @operand.inspect
end

#logical?Boolean

Returns:

  • (Boolean)


1173
1174
1175
# File 'lib/adlint/cc1/syntax.rb', line 1173

def logical?
  false
end

#to_complemental_logicalObject



1194
1195
1196
# File 'lib/adlint/cc1/syntax.rb', line 1194

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



1185
1186
1187
1188
1189
1190
1191
1192
# File 'lib/adlint/cc1/syntax.rb', line 1185

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



1198
1199
1200
# File 'lib/adlint/cc1/syntax.rb', line 1198

def to_s
  "#{@operand.to_s}++"
end