class AdLint::Cpp::EvalPhase

Public Class Methods

new(phase_ctxt) click to toggle source
Calls superclass method AdLint::Cpp::CppPhase::new
# File lib/adlint/cpp/phase.rb, line 89
def initialize(phase_ctxt)
  super(phase_ctxt, "cpp")
end

Private Instance Methods

do_execute(phase_ctxt, *) click to toggle source
# File lib/adlint/cpp/phase.rb, line 94
def do_execute(phase_ctxt, *)
  pp_ctxt = PreprocessContext.new(phase_ctxt)
  process_cinit_header(phase_ctxt, pp_ctxt)
  process_pinit_header(phase_ctxt, pp_ctxt)
  process_target_source(phase_ctxt, pp_ctxt)
end
process_cinit_header(phase_ctxt, pp_ctxt) click to toggle source
# File lib/adlint/cpp/phase.rb, line 101
def process_cinit_header(phase_ctxt, pp_ctxt)
  if fpath = traits.of_compiler.initial_header
    fenc = traits.of_project.file_encoding
    init_header = Source.new(Pathname.new(fpath), fenc)
  else
    init_header = EmptySource.new
  end
  phase_ctxt[:cpp_ast] =
    phase_ctxt[:cpp_interpreter].execute(pp_ctxt, init_header)
end
process_pinit_header(phase_ctxt, pp_ctxt) click to toggle source
# File lib/adlint/cpp/phase.rb, line 112
def process_pinit_header(phase_ctxt, pp_ctxt)
  if fpath = traits.of_project.initial_header
    fenc = traits.of_project.file_encoding
    init_header = Source.new(Pathname.new(fpath), fenc)
  else
    init_header = EmptySource.new
  end
  phase_ctxt[:cpp_ast].concat(
    phase_ctxt[:cpp_interpreter].execute(pp_ctxt, init_header))
end
process_target_source(phase_ctxt, pp_ctxt) click to toggle source
# File lib/adlint/cpp/phase.rb, line 123
def process_target_source(phase_ctxt, pp_ctxt)
  root_src = phase_ctxt[:sources].first
  phase_ctxt[:cpp_ast].concat(
    phase_ctxt[:cpp_interpreter].execute(pp_ctxt, root_src))
end