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] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- Subject: [Frama-c-discuss] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- From: virgile.prevosto at m4x.org (Virgile Prevosto)
- Date: Mon, 16 Sep 2013 09:54:20 +0200
- In-reply-to: <CAA1cxujdp96RaipAeGSEUJz4K2JF+BQNPm4a9JiD9+sg2Yevkg@mail.gmail.com>
- References: <CAA1cxujdp96RaipAeGSEUJz4K2JF+BQNPm4a9JiD9+sg2Yevkg@mail.gmail.com>
Hello, 2013/9/15 David Yang <abiao.yang at gmail.com>: > 1. Overall, My question is: Whether could I know in advance it would have > errors before adding a file (Kernel.Files.add)? > you can try to parse the file alone in an independent project and catch the exception that is raised by the parser in case of user error. e.g. something like (not tested) ... let prepare_file f = try File.init_from_c_files [File.from_filename f]; true with Log.AbortError s -> MyPlugin.warning "Not adding %s because of %s" f s; false in let prj = Project.create "tmp" in let is_ok = Project.on prj prepare_file "foo.c" in Project.remove prj; if is_ok then Kernel.Files.add "foo.c"; ... Best regards, -- E tutto per oggi, a la prossima volta Virgile
- References:
- [Frama-c-discuss] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- From: abiao.yang at gmail.com (David Yang)
- [Frama-c-discuss] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- Prev by Date: [Frama-c-discuss] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- Next by Date: [Frama-c-discuss] [Why3-club] PVS TCC problem
- Previous by thread: [Frama-c-discuss] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- Next by thread: [Frama-c-discuss] Whether could I know in advance it would have errors before adding a file (Kernel.Files.add)?
- Index(es):