Class: AdLint::Cc1::Declarator

Inherits:
SyntaxNode 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, #inspect, #location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initializeDeclarator

Returns a new instance of Declarator.



3050
3051
3052
3053
3054
# File 'lib/adlint/cc1/syntax.rb', line 3050

def initialize
  super
  @pointer = nil
  @full = false
end

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



3056
3057
3058
# File 'lib/adlint/cc1/syntax.rb', line 3056

def pointer
  @pointer
end

Instance Method Details

#abstract?Boolean

Returns:

  • (Boolean)


3062
3063
3064
# File 'lib/adlint/cc1/syntax.rb', line 3062

def abstract?
  false
end

#baseObject



3093
3094
3095
# File 'lib/adlint/cc1/syntax.rb', line 3093

def base
  subclass_responsibility
end

#full=(dcr_is_full) ⇒ Object



3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
# File 'lib/adlint/cc1/syntax.rb', line 3066

def full=(dcr_is_full)
  @full = dcr_is_full

  # NOTE: The ISO C99 standard says;
  #
  # 6.7.5 Declarators
  #
  # Semantics
  #
  # 3 A full declarator is a declarator that is not part of another
  #   declarator.  The end of a full declarator is a sequence point.  If,
  #   in the nested sequence of declarators in a full declarator, there is
  #   a declarator specifying a variable length array type, the type
  #   specified by the full declarator is said to be variably modified.
  #   Furthermore, any type derived by declarator type derivation from a
  #   variably modified type is itself variably modified.
  if dcr_is_full
    append_sequence_point!
  else
    delete_sequence_point!
  end
end

#full?Boolean

Returns:

  • (Boolean)


3089
3090
3091
# File 'lib/adlint/cc1/syntax.rb', line 3089

def full?
  @full
end

#function?Boolean

Returns:

  • (Boolean)


3097
3098
3099
# File 'lib/adlint/cc1/syntax.rb', line 3097

def function?
  subclass_responsibility
end

#identifierObject



3058
3059
3060
# File 'lib/adlint/cc1/syntax.rb', line 3058

def identifier
  subclass_responsibility
end

#identifier_listObject



3113
3114
3115
# File 'lib/adlint/cc1/syntax.rb', line 3113

def identifier_list
  subclass_responsibility
end

#innermost_parameter_type_listObject



3109
3110
3111
# File 'lib/adlint/cc1/syntax.rb', line 3109

def innermost_parameter_type_list
  subclass_responsibility
end

#parameter_type_listObject



3105
3106
3107
# File 'lib/adlint/cc1/syntax.rb', line 3105

def parameter_type_list
  subclass_responsibility
end

#variable?Boolean

Returns:

  • (Boolean)


3101
3102
3103
# File 'lib/adlint/cc1/syntax.rb', line 3101

def variable?
  !function?
end