Class: AdLint::Cc1::ExpressionStatement

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

Instance Attribute Summary collapse

Attributes inherited from Statement

#executed

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from Statement

#executed?

Methods inherited from SyntaxNode

#head_location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(expr) ⇒ ExpressionStatement

Returns a new instance of ExpressionStatement.



3468
3469
3470
3471
# File 'lib/adlint/cc1/syntax.rb', line 3468

def initialize(expr)
  super()
  @expression = expr
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



3473
3474
3475
# File 'lib/adlint/cc1/syntax.rb', line 3473

def expression
  @expression
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3479
3480
3481
3482
# File 'lib/adlint/cc1/syntax.rb', line 3479

def inspect(indent = 0)
  " " * indent + "#{short_class_name}" +
    (@expression ? "\n#{@expression.inspect(indent + 1)}" : "")
end

#locationObject



3475
3476
3477
# File 'lib/adlint/cc1/syntax.rb', line 3475

def location
  head_location
end