Class: AdLint::Cc1::VariableDeclaration
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cc1::VariableDeclaration
- Includes:
- DeclarationSpecifiersHolder, SymbolicElement
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#declaration_specifiers ⇒ Object
readonly
Returns the value of attribute declaration_specifiers.
-
#declarator ⇒ Object
readonly
Returns the value of attribute declarator.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(dcl_specs, dcr, sym) ⇒ VariableDeclaration
constructor
A new instance of VariableDeclaration.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods included from DeclarationSpecifiersHolder
#explicitly_typed?, #function_specifier, #implicitly_typed?, #storage_class_specifier, #type_qualifiers, #type_specifiers
Methods included from SymbolicElement
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(dcl_specs, dcr, sym) ⇒ VariableDeclaration
Returns a new instance of VariableDeclaration.
2444 2445 2446 2447 2448 2449 2450 |
# File 'lib/adlint/cc1/syntax.rb', line 2444 def initialize(dcl_specs, dcr, sym) super() @declaration_specifiers = dcl_specs @declarator = dcr @symbol = sym @type = nil end |
Instance Attribute Details
#declaration_specifiers ⇒ Object (readonly)
Returns the value of attribute declaration_specifiers.
2452 2453 2454 |
# File 'lib/adlint/cc1/syntax.rb', line 2452 def declaration_specifiers @declaration_specifiers end |
#declarator ⇒ Object (readonly)
Returns the value of attribute declarator.
2453 2454 2455 |
# File 'lib/adlint/cc1/syntax.rb', line 2453 def declarator @declarator end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
2454 2455 2456 |
# File 'lib/adlint/cc1/syntax.rb', line 2454 def symbol @symbol end |
#type ⇒ Object
Returns the value of attribute type.
2455 2456 2457 |
# File 'lib/adlint/cc1/syntax.rb', line 2455 def type @type end |
Instance Method Details
#identifier ⇒ Object
2457 2458 2459 |
# File 'lib/adlint/cc1/syntax.rb', line 2457 def identifier @declarator.identifier end |
#inspect(indent = 0) ⇒ Object
2465 2466 2467 2468 |
# File 'lib/adlint/cc1/syntax.rb', line 2465 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{location.inspect}) " + identifier.value end |
#location ⇒ Object
2461 2462 2463 |
# File 'lib/adlint/cc1/syntax.rb', line 2461 def location identifier.location end |