--- layout: fc_discuss_archives title: Message 2 from Frama-C-discuss on March 2018 ---
[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



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>