Translation C to Pascal

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Translation C to Pascal

Marc Santhoff-2
Hi,

since fpc supports a lot of intresting SoCs and Microcontrollers - has
anyone really used Allwinner A20? - I need an update:

Which translator do you use for making Object Pascal code from C?

For headers there is the very well working h2pas. But what tool is
recommendable for .c files?

The one I used in the past had many flaws, at first a strongly limited
subset of translatable statements. Secondly it is not actively
developed, thats why I'm searching a new and better one.

TIA,
Marc


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Translation C to Pascal

fredvs
Hello.

The best (IMHO) is c2pas32 --> http://www.astonshell.com/freeware/c2pas32/

But it is old and translate into Delphi code, so still work after...

Fre;D
Many thanks ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Translation C to Pascal

Marc Santhoff-2
On Di, 2017-05-02 at 08:33 -0700, fredvs wrote:
> Hello.
>
> The best (IMHO) is c2pas32 --> http://www.astonshell.com/freeware/c2pas32/

Nice program, i fed the adc.c source from STMs fwlib for stm32f4 through
and the generated code looks fine. There is some guessing on type casts,
but I hope those can be cleared using simple scripting or the like.

> But it is old and translate into Delphi code, so still work after...

Will see that when trying the compiler on it, not enough time for mkore
than some preparations currently. Maybe switching to mode Delphi is
fine, if anything is working for embedded targets.

Many thanks,
Marc


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Translation C to Pascal

noreply
On 2017-05-02 18:49, Marc Santhoff wrote:

> On Di, 2017-05-02 at 08:33 -0700, fredvs wrote:
>> Hello.
>>
>> The best (IMHO) is c2pas32 -->
>> http://www.astonshell.com/freeware/c2pas32/
>
> Nice program, i fed the adc.c source from STMs fwlib for stm32f4
> through
> and the generated code looks fine. There is some guessing on type
> casts,
> but I hope those can be cleared using simple scripting or the like.

There was also a mailing list thread about this a few weeks/months ago,
where I was discussing the idea with a few other people on the list.

Another idea is to link in C source as .a files into your fpc program?
If you want to write wrappers around the C code and use the C code
directly as .a files from gcc generated...

But depends.. what you need.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal