Class: AdLint::Cc1::VariableDefinition
- Inherits:
-
Definition
- Object
- SyntaxNode
- Definition
- AdLint::Cc1::VariableDefinition
- Includes:
- SymbolicElement
- Defined in:
- lib/adlint/cc1/syntax.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#init_declarator ⇒ Object
readonly
Returns the value of attribute init_declarator.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Attributes inherited from Definition
#declaration_specifiers, #type
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(dcl_specs, init_dcr, sym) ⇒ VariableDefinition
constructor
A new instance of VariableDefinition.
- #initializer ⇒ Object
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods included from SymbolicElement
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_dcr, sym) ⇒ VariableDefinition
Returns a new instance of VariableDefinition.
2486 2487 2488 2489 2490 2491 |
# File 'lib/adlint/cc1/syntax.rb', line 2486 def initialize(dcl_specs, init_dcr, sym) super(dcl_specs) @init_declarator = init_dcr @symbol = sym end |
Instance Attribute Details
#init_declarator ⇒ Object (readonly)
Returns the value of attribute init_declarator.
2493 2494 2495 |
# File 'lib/adlint/cc1/syntax.rb', line 2493 def init_declarator @init_declarator end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
2494 2495 2496 |
# File 'lib/adlint/cc1/syntax.rb', line 2494 def symbol @symbol end |
Instance Method Details
#identifier ⇒ Object
2496 2497 2498 |
# File 'lib/adlint/cc1/syntax.rb', line 2496 def identifier @init_declarator.declarator.identifier end |
#initializer ⇒ Object
2500 2501 2502 |
# File 'lib/adlint/cc1/syntax.rb', line 2500 def initializer @init_declarator.initializer end |
#inspect(indent = 0) ⇒ Object
2508 2509 2510 2511 |
# File 'lib/adlint/cc1/syntax.rb', line 2508 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{location.inspect}) " + identifier.value end |
#location ⇒ Object
2504 2505 2506 |
# File 'lib/adlint/cc1/syntax.rb', line 2504 def location identifier.location end |