Class: AdLint::Cpp::IfndefStatement

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, id, group) ⇒ IfndefStatement

Returns a new instance of IfndefStatement.



200
201
202
203
204
# File 'lib/adlint/cpp/syntax.rb', line 200

def initialize(keyword, id, group)
  super(keyword)
  @identifier = id
  @group = group
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



207
208
209
# File 'lib/adlint/cpp/syntax.rb', line 207

def group
  @group
end

#identifierObject (readonly)

Returns the value of attribute identifier.



206
207
208
# File 'lib/adlint/cpp/syntax.rb', line 206

def identifier
  @identifier
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



209
210
211
212
# File 'lib/adlint/cpp/syntax.rb', line 209

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