Class: AdLint::Cc1::DeclarationSpecifiers

Inherits:
SyntaxNode
  • Object
show all
Defined in:
lib/adlint/cc1/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from SyntaxNode

#head_location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initializeDeclarationSpecifiers

Returns a new instance of DeclarationSpecifiers.



2664
2665
2666
2667
2668
2669
2670
# File 'lib/adlint/cc1/syntax.rb', line 2664

def initialize
  super
  @storage_class_specifier = nil
  @function_specifier = nil
  @type_qualifiers = []
  @type_specifiers = []
end

Instance Attribute Details

#function_specifierObject

Returns the value of attribute function_specifier.



2673
2674
2675
# File 'lib/adlint/cc1/syntax.rb', line 2673

def function_specifier
  @function_specifier
end

#storage_class_specifierObject

Returns the value of attribute storage_class_specifier.



2672
2673
2674
# File 'lib/adlint/cc1/syntax.rb', line 2672

def storage_class_specifier
  @storage_class_specifier
end

#type_qualifiersObject (readonly)

Returns the value of attribute type_qualifiers.



2674
2675
2676
# File 'lib/adlint/cc1/syntax.rb', line 2674

def type_qualifiers
  @type_qualifiers
end

#type_specifiersObject (readonly)

Returns the value of attribute type_specifiers.



2675
2676
2677
# File 'lib/adlint/cc1/syntax.rb', line 2675

def type_specifiers
  @type_specifiers
end

Instance Method Details

#explicitly_typed?Boolean

Returns:

  • (Boolean)


2681
2682
2683
# File 'lib/adlint/cc1/syntax.rb', line 2681

def explicitly_typed?
  !implicitly_typed?
end

#implicitly_typed?Boolean

Returns:

  • (Boolean)


2685
2686
2687
# File 'lib/adlint/cc1/syntax.rb', line 2685

def implicitly_typed?
  @type_specifiers.empty?
end

#inspect(indent = 0) ⇒ Object



2689
2690
2691
# File 'lib/adlint/cc1/syntax.rb', line 2689

def inspect(indent = 0)
  " " * indent + short_class_name
end

#locationObject



2677
2678
2679
# File 'lib/adlint/cc1/syntax.rb', line 2677

def location
  head_location
end