View Single Post
Old 12th April 2004, 16:14   #35
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
hmm... a<b and a==b and the likes would be quite hard to code. I'd have to parse the whole string for something like == > <
i'd also have to respect precedence
(a+b)==(c+d)
and
a+b==c+d
don't have to be the same

atm all functions are treated equally: first, they're split to command name and parameter list
commandname(parameterlist)
the program looks for commas and keeps track of the bracket level. If it finds a comma and the current bracket level is 0, the string up to the comma is taken as a command block and translated recursively. when the translation returns, the command is composed from the the command name and the translated parameters.

If someone has a good parsing/replacement algorithm for the comparisons, i'll put it into the program (provided, i have the permission to do so ).
Needed is basically something that takes an AVS command block as input and replaces all occurances of some+term-goes*here==another+term-goes*here by equal(some+term-goes*here,another+term-goes*here)
The programming language can be VB, VBA, PHP, Perl, C/++, Pascal/Delphi/Kylix, J(ava)Script, VBScript, and maybe even Java
(ordered from best to worst )

I also found out that some bugs cause certain combinations of code not to translate to what i intended, namely:
code:

loop(5,
somefn(param);
otherfn(param);
);


does not translate correctly

code:

a=b+loop(5,
assign(a,b);
assign(a,b);
c=d;
);


generates an ERR

both result from a simple (and quite stupid ) bug and are fixed in 1.10.01
see CHANGELOG.txt for details
TomyLobo is offline   Reply With Quote