class AdLint::Exam::CBuiltin::AssignmentExtraction

Public Class Methods

new(phase_ctxt) click to toggle source
Calls superclass method AdLint::Examination::new
# File lib/adlint/exam/c_builtin/cc1_code.rb, line 286
def initialize(phase_ctxt)
  super
  trav = phase_ctxt[:cc1_ast_traversal]
  trav.enter_simple_assignment_expression   += T(:extract)
  trav.enter_compound_assignment_expression += T(:extract)
end

Private Instance Methods

do_execute(*) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_code.rb, line 295
def do_execute(*) end
do_prepare(*) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_code.rb, line 294
def do_prepare(*) end
extract(assign_expr) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_code.rb, line 297
def extract(assign_expr)
  ASSIGNMENT(assign_expr.operator.location, assign_expr.lhs_operand.to_s,
             stringify(assign_expr))
end
stringify(assign_expr) click to toggle source
# File lib/adlint/exam/c_builtin/cc1_code.rb, line 302
def stringify(assign_expr)
  "#{assign_expr.operator.value} #{assign_expr.rhs_operand.to_s}"
end