Hans-Peter Diettrich wrote:
A transformation of C files into Pascal units, as ToPas can do (to some
degree), IMO is only a provisional solution. When manual intervention is
required in this step, it will be required for every following bugfix or
improvement to the C code.
Yes. That's the main problem with an off-line tool :(
Whatever the mechanism used it must work without manual intervention.
A better way could be to hack a C compiler (GCC ?) and use only the
parser and the first compilation stage to have the symbols related to
the available functions and structures
This part of ToPas is already finished :-)
That's nice.
The hardest problem I found in ToPas is an automated handling of the
#defines. They should be classified into literal constants, functions,
macros, and (incomplete) code snippets - where code snippets IMO are of
no use in a Pascal unit. Such classification could be done easily by an
LR parser, but an LL parser only can deal with complete source files.
Yes, that is one of the nastiest problems.
I think that a compromise solution would be an extra file where the
macros could be classified by an human. Then, the conversion mechanism
would use that information when called. Usually, the macros don't change
very often and a warning could be issued when a new macro appeared
without classification.
Paulo Costa
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus