--- layout: fc_discuss_archives title: Message 2 from Frama-C-discuss on September 2011 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] navigating the Pretty_source and Source_viewer



Hi,

On Thu, Sep 8, 2011 at 3:19 PM, Damien Karkinsky <dak at adelard.com> wrote:
> Appologies for the specific technical question but I spent a few hours
> searching the documentation and am still stuck. I am writing a GUI for
> one of our plugins and I cant figure out how to cause the Pretty_source
> and Source_viewer to navigate to a particular Cil_types.kinstr of
> interest. Ideally I would like the same behaviour as clicking on
> functions within the file tree.

A Cil_types.kinstr is either Kglobal (which represents nothing, and
thus cannot be navigated to), or Kstmt of stmt. Thus you actually need
to navigate to a given statement. The method [view_stmt] of the Design
module should do what you want. Alternatively, to view other things
such as declarations, you can use the method [scroll] of the same
file. The list of [localizable],  that [scroll] scrolls to, is in the
module Pretty_source.

Hope this helps,

-- 
Boris