-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does not VeriFast use CIL parser? #82
Comments
We (actually, Jan Smans) made an attempt to put CIL in front of VeriFast some years ago, and it failed. If I remember correctly, a main reason was that comments were not retained. That still seems to be the case, judging by http:https://cil-project.github.io/cil/doc/html/cil/cil011.html . But you're right, Frama-C seems to have solved this problem. I had a peek into the Frama-C source code, and it seems they're using a patched version of CIL that does retain comments. Another problem is this: we would like to have precise source locations, including column numbers, for all program elements. CIL requires that you first run a C preprocessor on the source code, which in general may mess up the column numbers (if the line contains a macro that expands to something of a different width). But that might be a sufficiently unimportant problem that such a frontend would still be useful. We should probably have another go at this. In the meantime, if you are particularly annoyed by some parsing issue, do report it. |
Totally, I think we should port libclang parser onto VeriFast. I need some time to do that... |
I tried to use clang to pick up comment. But it only find global comment...
|
Hello,
Recently I've discovered a very interesting project: https://github.com/cil-project/cil
I wonder why does VeriFast use its own C parser over the CIL one.
CIL seems to be a mature project. Also, given that Frama-C is based on it, it should not be difficult to make it support VeriFast annotations (Frama-C uses ACSL that exploits
/*@ @*/
and//@
comment syntax).At the same time VeriFast parser has some obscure pecularities (e.g. #26, #16, #38, #41).
The only reason for not using it I come up with is the support for Java language. But IMHO it does not hurt to have separate parsers for two different languages.
Is there any reason (except of the obvious porting effort) to not replace the current parser with CIL?
The text was updated successfully, but these errors were encountered: