Class: AdLint::Cc1::UnionTypeDeclaration
- Inherits:
-
TypeDeclaration
- Object
- SyntaxNode
- TypeDeclaration
- AdLint::Cc1::UnionTypeDeclaration
- 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.
-
#type ⇒ Object
Returns the value of attribute type.
-
#union_specifier ⇒ Object
readonly
Returns the value of attribute union_specifier.
Attributes inherited from TypeDeclaration
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(union_spec, sym) ⇒ UnionTypeDeclaration
constructor
A new instance of UnionTypeDeclaration.
- #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(union_spec, sym) ⇒ UnionTypeDeclaration
Returns a new instance of UnionTypeDeclaration.
2593 2594 2595 2596 2597 2598 |
# File 'lib/adlint/cc1/syntax.rb', line 2593 def initialize(union_spec, sym) super(sym) @union_specifier = union_spec @struct_declarations = union_spec.struct_declarations @type = nil end |
Instance Attribute Details
#struct_declarations ⇒ Object (readonly)
Returns the value of attribute struct_declarations.
2601 2602 2603 |
# File 'lib/adlint/cc1/syntax.rb', line 2601 def struct_declarations @struct_declarations end |
#type ⇒ Object
Returns the value of attribute type.
2602 2603 2604 |
# File 'lib/adlint/cc1/syntax.rb', line 2602 def type @type end |
#union_specifier ⇒ Object (readonly)
Returns the value of attribute union_specifier.
2600 2601 2602 |
# File 'lib/adlint/cc1/syntax.rb', line 2600 def union_specifier @union_specifier end |
Instance Method Details
#identifier ⇒ Object
2604 2605 2606 |
# File 'lib/adlint/cc1/syntax.rb', line 2604 def identifier @union_specifier.identifier end |
#inspect(indent = 0) ⇒ Object
2612 2613 2614 2615 2616 |
# File 'lib/adlint/cc1/syntax.rb', line 2612 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
2608 2609 2610 |
# File 'lib/adlint/cc1/syntax.rb', line 2608 def location identifier.location end |