Class: AdLint::Cc1::ReturnStatement

Inherits:
JumpStatement 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 JumpStatement

#location

Methods inherited from Statement

#executed?

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

Returns a new instance of ReturnStatement.



3947
3948
3949
3950
# File 'lib/adlint/cc1/syntax.rb', line 3947

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

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



3952
3953
3954
# File 'lib/adlint/cc1/syntax.rb', line 3952

def expression
  @expression
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3954
3955
3956
3957
# File 'lib/adlint/cc1/syntax.rb', line 3954

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