Class: AdLint::Cpp::IfStatement

Inherits:
IfGroup show all
Defined in:
lib/adlint/cpp/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from IfGroup

#keyword

Instance Method Summary collapse

Methods inherited from IfGroup

#location

Methods inherited from SyntaxNode

#location, #short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(keyword, expr, group) ⇒ IfStatement

Returns a new instance of IfStatement.



167
168
169
170
171
# File 'lib/adlint/cpp/syntax.rb', line 167

def initialize(keyword, expr, group)
  super(keyword)
  @expression = expr
  @group = group
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



173
174
175
# File 'lib/adlint/cpp/syntax.rb', line 173

def expression
  @expression
end

#groupObject (readonly)

Returns the value of attribute group.



174
175
176
# File 'lib/adlint/cpp/syntax.rb', line 174

def group
  @group
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



176
177
178
179
180
# File 'lib/adlint/cpp/syntax.rb', line 176

def inspect(indent = 0)
  [" " * indent + "#{short_class_name}",
    @expression.inspect(indent + 1),
    @group ? @group.inspect(indent + 1) : nil].compact.join("\n")
end