Class: AdLint::Exam::CBuiltin::DirectiveExtraction

Inherits:
CodeExtraction show all
Defined in:
lib/adlint/exam/c_builtin/cpp_code.rb

Instance Method Summary collapse

Methods inherited from CodeExtraction

required?

Methods inherited from AdLint::Examination

catalog, #execute, registrant_phase_class, required?

Methods included from LogUtil

#log_debug, #log_error, #log_fatal, #log_info, #log_warn

Methods included from ReportUtil

#create_context_message, #write_FL_FUNC, #write_FL_STMT, #write_FN_CALL, #write_FN_CSUB, #write_FN_CYCM, #write_FN_GOTO, #write_FN_LINE, #write_FN_NEST, #write_FN_PARA, #write_FN_PATH, #write_FN_RETN, #write_FN_STMT, #write_FN_UELS, #write_FN_UNRC, #write_FN_UNUV, #write_assignment, #write_error_message, #write_funcall, #write_fundcl, #write_fundef, #write_gvardcl, #write_include, #write_initialization, #write_labeldef, #write_literal, #write_macrodef, #write_pp_directive, #write_typedcl, #write_vardef, #write_warning_message, #write_xref_function, #write_xref_variable

Constructor Details

#initialize(phase_ctxt) ⇒ DirectiveExtraction

Returns a new instance of DirectiveExtraction.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/adlint/exam/c_builtin/cpp_code.rb', line 103

def initialize(phase_ctxt)
  super
  trav = phase_ctxt[:cpp_ast_traversal]
  trav.enter_if_statement                 += T(:extract_if)
  trav.enter_ifdef_statement              += T(:extract_ifdef)
  trav.enter_ifndef_statement             += T(:extract_ifndef)
  trav.enter_elif_statement               += T(:extract_elif)
  trav.enter_else_statement               += T(:extract_else)
  trav.enter_endif_line                   += T(:extract_endif)
  trav.enter_user_include_line            += T(:extract_usr_include)
  trav.enter_system_include_line          += T(:extract_sys_include)
  trav.enter_object_like_define_line      += T(:extract_define)
  trav.enter_function_like_define_line    += T(:extract_define)
  trav.enter_va_function_like_define_line += T(:extract_define)
  trav.enter_undef_line                   += T(:extract_undef)
  trav.enter_line_line                    += T(:extract_line)
  trav.enter_error_line                   += T(:extract_error)
  trav.enter_pragma_line                  += T(:extract_pragma)
  trav.enter_null_directive               += T(:extract_null)
end