Class: AdLint::Cpp::IdentifierList

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

#initialize(ids = []) ⇒ IdentifierList

Returns a new instance of IdentifierList.



58
59
60
# File 'lib/adlint/cpp/syntax.rb', line 58

def initialize(ids = [])
  @identifiers = ids
end

Instance Attribute Details

#identifiersObject (readonly)

Returns the value of attribute identifiers.



62
63
64
# File 'lib/adlint/cpp/syntax.rb', line 62

def identifiers
  @identifiers
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



73
74
75
76
# File 'lib/adlint/cpp/syntax.rb', line 73

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

#locationObject



69
70
71
# File 'lib/adlint/cpp/syntax.rb', line 69

def location
  @identifiers.first.location
end

#push(id) ⇒ Object



64
65
66
67
# File 'lib/adlint/cpp/syntax.rb', line 64

def push(id)
  @identifiers.push(id)
  self
end