Skip to content
Translation script from C to Ada
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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


python FILES 

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

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

or you can use find on a code directory:

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


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
You can’t perform that action at this time.