translater tool, whoa

MisterX b.xavier at internet.lu
Sat Aug 7 11:20:35 CDT 2004


Andrew,

Glad you asked. Surely I need a faq to answer those...

Pointers are not handled. Or they will be mishandled.
I may leave a choice to convert the notations

this.that
and 
this->that

 as this[that]

I've seen object.rect->topleft and this gets more confusing...
so object[rect,topleft] is the answer but it's gets weirder
the more code you see ;)

Pointers can be much more complex 
than just simple assignment of variable addresses. 
Even a for loop can hard to parse 
for(mystruct* s->t=0; (x ? i,z)< thisfcuntion();++i) // etc...
is a beast to translate... 

But I got some ways of doing some of these cases. 
Recognizing how a for loop is incremented alone
means different strategies for repeat statements.

Like basic's goto statements what do you do?

Now, pointers...

How could I translate a register barrel shifter for example?
in a code like this
#define SIZEOF(thisstruct)
int *b=thisstruct->nextpointer

where you move from struct element to another using the pointer
is best done with a simple 
thisstruct[b,element]

Some C++ or Java oriented constructs/logic must be done 
by hand. 

As I said it does the tedious translation and parsing the job.

you did see the screen shots right?

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of
> Meitnik at aol.com
> Sent: Saturday, August 07, 2004 14:22
> To: use-revolution at lists.runrev.com
> Subject: Re: translater tool, whoa
> 
> 
> 
> > I wrote a transcript translator engine for c, pascal, basic
> > which also handles parts of fortran, php, flash, java and js.
> > 
> > -- Please send me more info on it. Btw, how did you handle the 
> pointer stuff 
> in those languages???
> 
> Andrew
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution


More information about the use-livecode mailing list