Forum > Translations

convert fpc to c ?

<< < (2/2)

skalogryz:

--- Quote from: jack616 on March 09, 2015, 06:07:42 pm ---skalogryz  - crystal revs is a professional development environment for C & C++
it doesn't and never will support pascal.

--- End quote ---
I don't get it. since Crystal Revs produces the result not based on the pascal code, but rather on the translation of pascal code to C/C++.
I'd think there's would be a slight difference, thus using the flowchart might have some traps.

But, could you please provide an example of the flow chart, that you're using right now? (if you have any flow chart produced based of the pascal code)

jack616:
skalogryz - yes you do seem a little confused.
I'll try and explain a little better.

What I am looking for is something that performs a conversion between fpc to C or C++
Nothing more than that.

I dont need it to be a very good conversion so long as it does the basic function of translating
the basic fpc  syntax into c syntax

given a conversion for example of this sort of thing:

function startfunction(somevar etc);
begin
xxx
end;

into

main (somevar etc) {
xxx

}

and so on - even just removing all other code (but allowing for the function tree of course)
I can then give the output to revs which will produce the flowcharts in the correct format for use.

If the converter can include variables, constants and comments etc then so much the better but the
actual output doesn't need to be compilable or even near it.
Simply producing flowcharts from fpc isn't any use in this case because I'm required to stick to
specific methods hence my need to do this round robin approach.

Looking round google I found many programs that claim to be able to do this but none of them I found
can. Others claim to be shareware when in fact they are just crippleware and therefore no use to anyone
to evaluate.

I was hoping someone here might have migrated some code to C and would know of a good program.

If you wanted to see what revs does there is a free download on their site but I dont know what the free
version is capable of (I bought mine a long time ago) . If you do any serious C programming I can  highly recommend it.



 

avra:
I have used some tool (which I can not remember the name) to convert pascal code to flowchart with success, so I don't know what are your expectations.

For easier understanding of someone else's code SciTools Understand is very valuable.

Anyway, every debian distribution should have p2c pascal to c convertor. You might try some downloadable version from here:
http://schneider.ncifcrf.gov/p2c/

jack616:
Thanks avra that link looks like it may well do the job.
I'll need to compile for centos possibly but assuming that goes well that should be job done
judging by the docs.

cheers

Navigation

[0] Message Index

[*] Previous page

Go to full version