Class: AdLint::Cc1::EnumTypeDeclaration

Inherits:
TypeDeclaration show all
Defined in:
lib/adlint/cc1/syntax.rb

Direct Known Subclasses

PseudoEnumTypeDeclaration

Instance Attribute Summary collapse

Attributes inherited from TypeDeclaration

#symbol

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods included from SymbolicElement

#mark_as_referred_by

Methods inherited from SyntaxNode

#head_location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(enum_spec, sym) ⇒ EnumTypeDeclaration

Returns a new instance of EnumTypeDeclaration.



2628
2629
2630
2631
2632
# File 'lib/adlint/cc1/syntax.rb', line 2628

def initialize(enum_spec, sym)
  super(sym)
  @enum_specifier = enum_spec
  @type = nil
end

Instance Attribute Details

#enum_specifierObject (readonly)

Returns the value of attribute enum_specifier.



2634
2635
2636
# File 'lib/adlint/cc1/syntax.rb', line 2634

def enum_specifier
  @enum_specifier
end

#typeObject

Returns the value of attribute type.



2635
2636
2637
# File 'lib/adlint/cc1/syntax.rb', line 2635

def type
  @type
end

Instance Method Details

#enumeratorsObject



2645
2646
2647
# File 'lib/adlint/cc1/syntax.rb', line 2645

def enumerators
  @enum_specifier.enumerators
end

#identifierObject



2637
2638
2639
# File 'lib/adlint/cc1/syntax.rb', line 2637

def identifier
  @enum_specifier.identifier
end

#inspect(indent = 0) ⇒ Object



2649
2650
2651
2652
# File 'lib/adlint/cc1/syntax.rb', line 2649

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{location.inspect}) " +
    "#{identifier.value}"
end

#locationObject



2641
2642
2643
# File 'lib/adlint/cc1/syntax.rb', line 2641

def location
  identifier.location
end