Skip to content

emareg/c2ada

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages