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.



3069
3070
3071
3072
3073
# File 'lib/adlint/cc1/syntax.rb', line 3069

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

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



3075
3076
3077
# File 'lib/adlint/cc1/syntax.rb', line 3075

def pointer
  @pointer
end

Instance Method Details

#abstract?Boolean

Returns:

  • (Boolean)


3081
3082
3083
# File 'lib/adlint/cc1/syntax.rb', line 3081

def abstract?
  false
end

#baseObject



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

def base
  subclass_responsibility
end

#full=(dcr_is_full) ⇒ Object



3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
# File 'lib/adlint/cc1/syntax.rb', line 3085

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)


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

def full?
  @full
end

#function?Boolean

Returns:

  • (Boolean)


3116
3117
3118
# File 'lib/adlint/cc1/syntax.rb', line 3116

def function?
  subclass_responsibility
end

#identifierObject



3077
3078
3079
# File 'lib/adlint/cc1/syntax.rb', line 3077

def identifier
  subclass_responsibility
end

#identifier_listObject



3132
3133
3134
# File 'lib/adlint/cc1/syntax.rb', line 3132

def identifier_list
  subclass_responsibility
end

#innermost_parameter_type_listObject



3128
3129
3130
# File 'lib/adlint/cc1/syntax.rb', line 3128

def innermost_parameter_type_list
  subclass_responsibility
end

#parameter_type_listObject



3124
3125
3126
# File 'lib/adlint/cc1/syntax.rb', line 3124

def parameter_type_list
  subclass_responsibility
end

#variable?Boolean

Returns:

  • (Boolean)


3120
3121
3122
# File 'lib/adlint/cc1/syntax.rb', line 3120

def variable?
  !function?
end