Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] How can I get line number from Cil_types.location


  • Subject: [Frama-c-discuss] How can I get line number from Cil_types.location
  • From: diarr_rokiatou at yahoo.fr (Rokiatou DIARRA)
  • Date: Sun, 11 Mar 2018 20:39:32 +0000 (UTC)
  • References: <602385959.22438711.1520800772402.ref@mail.yahoo.com>

Hi,
I want to get only line number in source file. With Printer.pp_location I get the full path to the source like <dir/f>:<l>. But I want just the line number.
I looked in Frama-c sources, and I found in Cil_datatype.Location module a printer : val pretty_line: t Pretty_utils.formatter . 
So I tried it with the following instructions:
    let line =( Cil_datatype.Location.pretty_line loc); (where loc has type Cil_types.location = Lexing.position * Lexing.position) but I got this error message:

Error: This expression has type
         Cil_types.location = Lexing.position * Lexing.position
       but an expression was expected of type Lexing.position

Are there any functions, in Frama-C, to get only the line number?
Thanks.
Rokiatou DIARRAE-Mail: diarr_rokiatou at yahoo.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20180311/3af3f543/attachment.html>