Class: AdLint::Cc1::Declaration
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cc1::Declaration
- Includes:
- DeclarationSpecifiersHolder
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#declaration_specifiers ⇒ Object
readonly
Returns the value of attribute declaration_specifiers.
-
#init_declarators ⇒ Object
readonly
Returns the value of attribute init_declarators.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(dcl_specs, init_dcrs, sym_tbl) ⇒ Declaration
constructor
A new instance of Declaration.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods included from DeclarationSpecifiersHolder
#explicitly_typed?, #function_specifier, #implicitly_typed?, #storage_class_specifier, #type_qualifiers, #type_specifiers
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(dcl_specs, init_dcrs, sym_tbl) ⇒ Declaration
Returns a new instance of Declaration.
2303 2304 2305 2306 2307 2308 |
# File 'lib/adlint/cc1/syntax.rb', line 2303 def initialize(dcl_specs, init_dcrs, sym_tbl) super() @declaration_specifiers = dcl_specs @init_declarators = init_dcrs @items = build_items(dcl_specs, init_dcrs, sym_tbl) end |
Instance Attribute Details
#declaration_specifiers ⇒ Object (readonly)
Returns the value of attribute declaration_specifiers.
2310 2311 2312 |
# File 'lib/adlint/cc1/syntax.rb', line 2310 def declaration_specifiers @declaration_specifiers end |
#init_declarators ⇒ Object (readonly)
Returns the value of attribute init_declarators.
2311 2312 2313 |
# File 'lib/adlint/cc1/syntax.rb', line 2311 def init_declarators @init_declarators end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
2312 2313 2314 |
# File 'lib/adlint/cc1/syntax.rb', line 2312 def items @items end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
2318 2319 2320 2321 |
# File 'lib/adlint/cc1/syntax.rb', line 2318 def inspect(indent = 0) ([" " * indent + "#{short_class_name} (#{location.inspect})"] + @items.map { |item| item.inspect(indent + 1) }).join("\n") end |
#location ⇒ Object
2314 2315 2316 |
# File 'lib/adlint/cc1/syntax.rb', line 2314 def location head_location end |