Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   AVS (http://forums.winamp.com/forumdisplay.php?f=85)
-   -   Normal AVS Code -> loop() code translator (http://forums.winamp.com/showthread.php?t=173672)

TomyLobo 14th April 2004 16:09

1.11.02 is available and fixes another bug in the recursing parser. i think i've got all of them now :)

[edit]
1.11.02 is done and implements a bracketing check that will mark errors instead of just displaying nothing or even crashing on them ;)
if it finds a bracketing error, it marks the whole block with
code:

BRACKETS(n)->erronous code<-BRACKETS


where n is the number of brackets missing (negative numbers mean too much brackets)
no translations are done if there is a bracketing error
[/edit]

[edit]
yet another version (1.11.04) *argh*
After all these structural changes I could now finally implement megabuf assignments the way i meant them to be :)
code:

megabuf(index)=value


with *round* brackets instead of square brackets :)
They already worked in 1.11.02 but with the restriction I explained in the 1st addition to the 1.09.00 entry
[/edit]

fragmer 15th April 2004 00:47

why do you use the bufdist thing in texer2 in your example?
imho it's easier and fSaster to use
code:

megabuf(t);
megabuf(t+n);
megabuf(t+n2); // etc.


...where t varies from 0 to (n-1).
n*2, n*3 etc can be pre-calculated on ini.
ex.: buggyAVS2 >> particles-II

TomyLobo 15th April 2004 01:27

The base structure of that texer is quite old *g*
I'd write this differently if i did this now :)
It's just 5 points in that texer2... I really don't need to optimize that, do i? :)
atm I'm working on a pattern replacement algorithm for AVSTrans, which would allow writing things like
code:

//$AVSTrans_Replacement_Pattern=variable([a-z*/-+()])->megabuf($1+n2)
a=variable(b);
variable(c)=d;


so i think I'm going to switch over to the t+n2 technique, because the interleaving technique(t*n+1) i'm using now is quite hard to pre-cache/optimize if i use pattern matching :(

TomyLobo 15th April 2004 03:48

AVSTrans 1.12.00 is out :)
Most noticable new feature: Regular Expression Matching/Replacement .
I'm using the RegEx Object from VBScript for that.
For a description of the available Expressions look at the corresponding MSDN site.

The syntax is
code:

//$AVSTrans_Replacement_Pattern=pattern->replacevar


the replacevar may contain things like $1 to get the remembered matches described in the "(pattern)" line in the MSDN document.

a (working) example :
code:

//$AVSTrans_Replacement_Pattern=variable\(([^\)]*)\)->megabuf($1+n2)
a=b;
variable(ab)=d;
e=f


this translates to
code:

a=b;
assign(megabuf(ab+n2),d);
e=f



All times are GMT. The time now is 22:18.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.