Frama-C API - frama_c_visitor

Class type for a database-aware visitor. This is done by defining auxiliary methods that can be redefined in inherited classes, while the corresponding ones from Cil.cilVisitor must retain their values as defined here. Otherwise, annotations may not be visited properly. The replaced functions are

  • vstmt (use vstmt_aux instead)
  • vglob (use vglob_aux instead)

A few hints on how to use correctly this visitor

  • SkipChildren and ChangeTo must be used with extreme care in a visitor with copy behavior, or some nodes may be shared between the original and the copy.
  • Do not erase a statement during the visit, as there might be annotations attached to it. Change it to Skip instead, the generic_frama_c_visitor will know what to do.
  • Be careful if you change the vid or sid: this must be done before anything has been attached to the corresponding variable or statement in the new project, which means -- for statements, in vstmt, for the current statement only -- for variables, at their declaration point.
method frama_c_plain_copy : frama_c_visitor

same as plain_copy_visitor but for frama-c specific methods

method current_kf : Frama_c_kernel.Cil_types.kernel_function option

link to the kernel function currently being visited. NB: for copy visitors, the link is to the original kf (anyway, the new kf is created only after the visit is over).

method set_current_kf : Frama_c_kernel.Cil_types.kernel_function -> unit

Internal use only.

method reset_current_kf : unit -> unit

Internal use only.