Class: AdLint::Cpp::Group

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SyntaxNode

#short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initializeGroup

Returns a new instance of Group.



103
104
105
106
# File 'lib/adlint/cpp/syntax.rb', line 103

def initialize
  super
  @group_parts = []
end

Instance Attribute Details

#group_partsObject (readonly)

Returns the value of attribute group_parts.



108
109
110
# File 'lib/adlint/cpp/syntax.rb', line 108

def group_parts
  @group_parts
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



119
120
121
122
# File 'lib/adlint/cpp/syntax.rb', line 119

def inspect(indent = 0)
  ([" " * indent + short_class_name] +
   @group_parts.map { |child| child.inspect(indent + 1) }).join("\n")
end

#locationObject



115
116
117
# File 'lib/adlint/cpp/syntax.rb', line 115

def location
  @group_parts.first.location
end

#push(group_part) ⇒ Object



110
111
112
113
# File 'lib/adlint/cpp/syntax.rb', line 110

def push(group_part)
  @group_parts.push(group_part)
  self
end