Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

c2ada

Python script that translates Ansi C to Ada. Translates .c and .h files to .adb and .ads files

Usage:

python c2ada.py FILES 

In order to resolve include dependencies, all files must be specified in one call.

Example: python c2ada.py main.c module.c module.h

or you can use find on a code directory:

find . -type f -regex '.*\.\(c\|h\)' -exec python c2ada.py {} + 

Note

The script is based on regular expressions and will not properly parse C according to its specification! It is only a helper script intended to reduce the manual translation effort.

Translation Features:

  • keeps (and translates) all your comments
  • translates C functions to Ada functions or procedures
  • translates enum, struct
  • preprocessor #define
  • numbers: 0b10101010 -> 2#10101010#

Not working:

  • pointers
  • Array initialization
  • resolving comments between function signature and body
  • many other things

About

Translation script from C to Ada

Resources

Releases

No releases published

Packages

No packages published

Languages