Home > frontc

frontc

Frontc is a project mainly written in OCAML and C, based on the LGPL-2.1 license.

A fork of Hugues Casse's frontc, an OCAML C parser and pretty-printer.

FrontC fork by Pat Hickey

I'm working on a research project with Professor Chung-chieh Shan which will replace the C preprocessor with an OCAML based code generation system. We think it will be adventageous for a code generator to directly manipulate the C AST. So far I've added support for comments in the pretty printers- in printc, comments are preserved and pretty printed; in ctoxml, comments are pretty printed as XML comments.

I'm working on support for #include directives so that you don't need to run a file through cpp to have all the type names defined.

Front V3.4

FrontC is C language front-end. It provides the program in "C Abstract Form", a tree representation of the original C source. It may be used for many source works including:

  • compilation,
  • source pre-processing,
  • source beautification,
  • source analysis,
  • and so on. In the version 3.1, it provides also an XML back-end making easier to transform the C program using XML tools like XSLT (it was my first goal when I perform this task).

    FrontC is an OCAML library and is easier to use with this language. Usually, it is installed in the /usr/lib/ocaml/site-lib where it creates its own directory. For compiling with FrontC, you must have a command like: ocamlc -I/usr/lib/ocaml/site-lib/frontc ... And for linking, it may be: ocamlc unix.cma /usr/lib/ocaml/site-lib/frontc.cma ...

    Have fun with it. If you are experiencing problems, feel free to contact me at [email protected].

Previous:ZTEcontactsparse