Class: AdLint::Cc1::StructTypeDeclaration
- Inherits:
-
TypeDeclaration
- Object
- SyntaxNode
- TypeDeclaration
- AdLint::Cc1::StructTypeDeclaration
- Defined in:
- lib/adlint/cc1/syntax.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#struct_declarations ⇒ Object
readonly
Returns the value of attribute struct_declarations.
-
#struct_specifier ⇒ Object
readonly
Returns the value of attribute struct_specifier.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from TypeDeclaration
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(struct_spec, sym) ⇒ StructTypeDeclaration
constructor
A new instance of StructTypeDeclaration.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
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(struct_spec, sym) ⇒ StructTypeDeclaration
Returns a new instance of StructTypeDeclaration.
2558 2559 2560 2561 2562 2563 |
# File 'lib/adlint/cc1/syntax.rb', line 2558 def initialize(struct_spec, sym) super(sym) @struct_specifier = struct_spec @struct_declarations = struct_spec.struct_declarations @type = nil end |
Instance Attribute Details
#struct_declarations ⇒ Object (readonly)
Returns the value of attribute struct_declarations.
2566 2567 2568 |
# File 'lib/adlint/cc1/syntax.rb', line 2566 def struct_declarations @struct_declarations end |
#struct_specifier ⇒ Object (readonly)
Returns the value of attribute struct_specifier.
2565 2566 2567 |
# File 'lib/adlint/cc1/syntax.rb', line 2565 def struct_specifier @struct_specifier end |
#type ⇒ Object
Returns the value of attribute type.
2567 2568 2569 |
# File 'lib/adlint/cc1/syntax.rb', line 2567 def type @type end |
Instance Method Details
#identifier ⇒ Object
2569 2570 2571 |
# File 'lib/adlint/cc1/syntax.rb', line 2569 def identifier @struct_specifier.identifier end |
#inspect(indent = 0) ⇒ Object
2577 2578 2579 2580 2581 |
# File 'lib/adlint/cc1/syntax.rb', line 2577 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{location.inspect}) " + "#{identifier.value}\n" + @struct_declarations.map { |sd| sd.inspect(indent + 1) }.join("\n") end |
#location ⇒ Object
2573 2574 2575 |
# File 'lib/adlint/cc1/syntax.rb', line 2573 def location identifier.location end |