Class: AdLint::Cc1::ArrayDeclarator

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(base_dcr, size_expr) ⇒ ArrayDeclarator



3196
3197
3198
3199
3200
# File 'lib/adlint/cc1/syntax.rb', line 3196

def initialize(base_dcr, size_expr)
  super()
  @base = base_dcr
  @size_expression = size_expr
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



3202
3203
3204
# File 'lib/adlint/cc1/syntax.rb', line 3202

def base
  @base
end

#size_expressionObject (readonly)

Returns the value of attribute size_expression.



3203
3204
3205
# File 'lib/adlint/cc1/syntax.rb', line 3203

def size_expression
  @size_expression
end

Instance Method Details

#function?(stack = []) ⇒ Boolean



3225
3226
3227
3228
3229
3230
# File 'lib/adlint/cc1/syntax.rb', line 3225

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

#identifierObject



3209
3210
3211
# File 'lib/adlint/cc1/syntax.rb', line 3209

def identifier
  @base.identifier
end

#identifier_listObject



3221
3222
3223
# File 'lib/adlint/cc1/syntax.rb', line 3221

def identifier_list
  @base.identifier_list
end

#innermost_parameter_type_listObject



3217
3218
3219
# File 'lib/adlint/cc1/syntax.rb', line 3217

def innermost_parameter_type_list
  @base.innermost_parameter_type_list
end

#inspect(indent = 0) ⇒ Object



3232
3233
3234
# File 'lib/adlint/cc1/syntax.rb', line 3232

def inspect(indent = 0)
  " " * indent + "#{short_class_name}\n" + @base.inspect(indent + 1)
end

#locationObject



3205
3206
3207
# File 'lib/adlint/cc1/syntax.rb', line 3205

def location
  @base ? @base.location || head_location : head_location
end

#parameter_type_listObject



3213
3214
3215
# File 'lib/adlint/cc1/syntax.rb', line 3213

def parameter_type_list
  @base.parameter_type_list
end