Class: AdLint::Cc1::IdentifierDeclarator

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

Instance Attribute Summary collapse

Attributes inherited from Declarator

#pointer

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from Declarator

#abstract?, #full=, #full?, #variable?

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(id) ⇒ IdentifierDeclarator

Returns a new instance of IdentifierDeclarator.



3138
3139
3140
3141
# File 'lib/adlint/cc1/syntax.rb', line 3138

def initialize(id)
  super()
  @identifier = id
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



3143
3144
3145
# File 'lib/adlint/cc1/syntax.rb', line 3143

def identifier
  @identifier
end

Instance Method Details

#baseObject



3149
3150
3151
# File 'lib/adlint/cc1/syntax.rb', line 3149

def base
  nil
end

#function?(stack = []) ⇒ Boolean

Returns:

  • (Boolean)


3165
3166
3167
3168
# File 'lib/adlint/cc1/syntax.rb', line 3165

def function?(stack = [])
  stack.push(:pointer) if pointer
  stack.last == :function
end

#identifier_listObject



3161
3162
3163
# File 'lib/adlint/cc1/syntax.rb', line 3161

def identifier_list
  nil
end

#innermost_parameter_type_listObject



3157
3158
3159
# File 'lib/adlint/cc1/syntax.rb', line 3157

def innermost_parameter_type_list
  nil
end

#inspect(indent = 0) ⇒ Object



3170
3171
3172
# File 'lib/adlint/cc1/syntax.rb', line 3170

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

#locationObject



3145
3146
3147
# File 'lib/adlint/cc1/syntax.rb', line 3145

def location
  @identifier.location
end

#parameter_type_listObject



3153
3154
3155
# File 'lib/adlint/cc1/syntax.rb', line 3153

def parameter_type_list
  nil
end