class AdLint::Exam::CBuiltin::W0036::DeclaratorCounter

Attributes

result[R]

Public Class Methods

new() click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 852
def initialize
  @result = 0
end

Public Instance Methods

visit_abbreviated_function_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 889
def visit_abbreviated_function_declarator(node)
  super
  @result += 1
  if ptr = node.pointer
    @result += ptr.count { |tok| tok.type == "*" }
  end
end
visit_ansi_function_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 873
def visit_ansi_function_declarator(node)
  node.base.accept(self)
  @result += 1
  if ptr = node.pointer
    @result += ptr.count { |tok| tok.type == "*" }
  end
end
visit_array_abstract_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 902
def visit_array_abstract_declarator(node)
  super
  @result += 1
end
visit_array_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 865
def visit_array_declarator(node)
  super
  @result += 1
  if ptr = node.pointer
    @result += ptr.count { |tok| tok.type == "*" }
  end
end
visit_function_abstract_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 907
def visit_function_abstract_declarator(node)
  node.base.accept(self) if node.base
  @result += 1
end
visit_identifier_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 858
def visit_identifier_declarator(node)
  super
  if ptr = node.pointer
    @result += ptr.count { |tok| tok.type == "*" }
  end
end
visit_kandr_function_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 881
def visit_kandr_function_declarator(node)
  super
  @result += 1
  if ptr = node.pointer
    @result += ptr.count { |tok| tok.type == "*" }
  end
end
visit_pointer_abstract_declarator(node) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 897
def visit_pointer_abstract_declarator(node)
  super
  @result += node.pointer.count { |tok| tok.type == "*" }
end