This program attempts to translate source code from Draco to ANSI C. Draco
is a programming language by Chris Gray, the most recent version of which
is Draco 1.2, dated 28/1/89. As development of Draco has ceased, it is
important to be able to convert programs written in that language to C.
This program has been written with that end in mind.
SAS/C source code is included.
Usage is as follows:
1> Draco2C <file> [-a|AMIGATYPES]
1> Draco2C sieve.d -a
Output goes to CON: by default. You can redirect this if desired:
1> Draco2C sieve.d >sieve.c
The AMIGATYPES argument makes the program use Amiga-style type
definitions such as ULONG, etc., otherwise K&R-style type definitions
such as unsigned int, etc. are used.
It is assumed that the input file is a valid Draco file which conforms
to Draco syntax rules; passing malformed files will most likely cause
the program to hang. In most cases the .c file produced will require
some amount of hand editing before it will compile and run correctly;
however, the program at least does the repetitive gruntwork for you
automatically. It has been tested with a variety of Draco source code.
The following are supported:
(:, :), ($, $), /=, $-, $/, ^, # trigraphs.
and, bool, by, byte, case, char, corp, default, do, downto, elif, else,
esac, false, fi, for, if, ignore, incase, int, long, nil, not, od, or,
proc, short, then, true, type, uint, ulong, upto, ushort, while
signed, unsigned (these may be larger in C than they would be in Draco).
in string literals: \e, ''
:=, ~=, *., ><, = operators.
The following are unsupported:
, arbptr, boid, code, dim, enum, error, free, make, new, pretend, range.
| prefix numeric absolute value operator.
[*] array sizing method.
Range notation (eg. 'a' .. 'z').
: (as used in I/O subsystem).
"\(number)", "0bnumber" notation styles.
escaped quotes in strings.
* postfix dereferencing operator.
James Jacobs of Amigan Software
30 July 2005