Class: AdLint::Cc1::PostfixDecrementExpression

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) ⇒ PostfixDecrementExpression

Returns a new instance of PostfixDecrementExpression.



1209
1210
1211
1212
# File 'lib/adlint/cc1/syntax.rb', line 1209

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

Instance Attribute Details

#operandObject (readonly)

Returns the value of attribute operand.



1214
1215
1216
# File 'lib/adlint/cc1/syntax.rb', line 1214

def operand
  @operand
end

Instance Method Details

#arithmetic?Boolean

Returns:

  • (Boolean)


1224
1225
1226
# File 'lib/adlint/cc1/syntax.rb', line 1224

def arithmetic?
  true
end

#bitwise?Boolean

Returns:

  • (Boolean)


1228
1229
1230
# File 'lib/adlint/cc1/syntax.rb', line 1228

def bitwise?
  false
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


1216
1217
1218
# File 'lib/adlint/cc1/syntax.rb', line 1216

def have_side_effect?
  true
end

#inspect(indent = 0) ⇒ Object



1249
1250
1251
1252
# File 'lib/adlint/cc1/syntax.rb', line 1249

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

#logical?Boolean

Returns:

  • (Boolean)


1220
1221
1222
# File 'lib/adlint/cc1/syntax.rb', line 1220

def logical?
  false
end

#to_complemental_logicalObject



1241
1242
1243
# File 'lib/adlint/cc1/syntax.rb', line 1241

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



1232
1233
1234
1235
1236
1237
1238
1239
# File 'lib/adlint/cc1/syntax.rb', line 1232

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



1245
1246
1247
# File 'lib/adlint/cc1/syntax.rb', line 1245

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