Sunday, April 23, 2017

Psyche-c

"The compilation of incomplete C code can be useful in a variety of scenarios: debugging a snippet retrieved from a bug-tracking tool; running an static analysis on only part of a program; support editing features such as code-completion within an IDE; during cross-platform development when a header is incompatible; in order to generate data-structures straight out of algorithm implementations.

Psyche-c is a compiler for incomplete C code being developed in our lab. It receives as an input an incomplete, but syntactically valid, source code. This means that, if unexpanded macros are present, then those macros in unexpanded form must still conform to the C grammar rules. From this source, psyche-c produces a header file that, once plugged into the original file, leads to compilable code*.

To complete missing parts of programs, psyche-c solves several challenges. The first ones appear during parsing, since, not only syntax, but also semantic information (possibly absent) is required in C. Yet, the really cool challenges appear when we want to produce complete well-typed programs out of the partial ones. Give it a try! Despite being still under research, we can do pretty impressive things. psyche-c seems to be the first ever type inference for C. Its source is available at https://github.com/ltcmelo/psychec."

http://cuda.dcc.ufmg.br/psyche-c/

No comments:

Post a Comment