Class: AdLint::Cpp::IfdefStatement

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

Returns a new instance of IfdefStatement.



184
185
186
187
188
# File 'lib/adlint/cpp/syntax.rb', line 184

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

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



191
192
193
# File 'lib/adlint/cpp/syntax.rb', line 191

def group
  @group
end

#identifierObject (readonly)

Returns the value of attribute identifier.



190
191
192
# File 'lib/adlint/cpp/syntax.rb', line 190

def identifier
  @identifier
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



193
194
195
196
# File 'lib/adlint/cpp/syntax.rb', line 193

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