Class: AdLint::Cpp::PreprocessingFile

Inherits:
SyntaxNode
  • Object
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(fpath, group = nil) ⇒ PreprocessingFile

Returns a new instance of PreprocessingFile.



80
81
82
83
# File 'lib/adlint/cpp/syntax.rb', line 80

def initialize(fpath, group = nil)
  @fpath = fpath
  @group = group
end

Instance Attribute Details

#fpathObject (readonly)

Returns the value of attribute fpath.



85
86
87
# File 'lib/adlint/cpp/syntax.rb', line 85

def fpath
  @fpath
end

#groupObject (readonly)

Returns the value of attribute group.



86
87
88
# File 'lib/adlint/cpp/syntax.rb', line 86

def group
  @group
end

Instance Method Details

#concat(pp_file) ⇒ Object



92
93
94
# File 'lib/adlint/cpp/syntax.rb', line 92

def concat(pp_file)
  @group.group_parts.concat(pp_file.group.group_parts)
end

#inspect(indent = 0) ⇒ Object



96
97
98
99
# File 'lib/adlint/cpp/syntax.rb', line 96

def inspect(indent = 0)
  " " * indent + "#{short_class_name}\n" +
    (@group ? @group.inspect(indent + 1) : "")
end

#locationObject



88
89
90
# File 'lib/adlint/cpp/syntax.rb', line 88

def location
  @group.location
end