Archive: Including AVSTrans translation into the evallib


20th April 2004 06:03 UTC

Including AVSTrans translation into the evallib
Hi :)
In case you don't know AVSTrans yet here's an abstract:
AVSTrans does some AVS code translations that facilate code writing a lot and enable you to write code that is more readable and easier to understand and debug. Here are a few examples of its translation features:

- you can write things like "megabuf(b)=a" instead of "assign(megabuf(b),a)"

- you can write normal code nested in functions like loop() and if():
normally you'd have to write "loop(n,exec2(assign(a,b),assign(c,d)))". AVSTrans does all these translations for you and allows you to easily write


loop(n,
a=b;
c=d;
)

- AVSTrans also provides a versatile replacement mechanism: You can tell it to replace one string by another string automatically before the other translations are done. Regular Expressions are also supported. You can tell it to automatically change something like "foo(bar+1)" to "megabuf(bar+1+n2)", which greatly improves the readability and reduces errors resulting from wrong indexing of the megabufs.

I had the idea of including the translations AVSTrans does directly in the evallib or something like that. I put the whole Translation algorithm into an ActiveX .dll (it is written in VB6, so i can't use make .dll :(). It should be possible to use this in C++, too.
I think some AVSers would apreciate this.
The source code is included in the download package, in case you need it.
[edit]
This should be completely backwards-compatible as it doesn't translate working normal AVS code at all.
[/edit]

Original AVSTrans Thread
AVSTrans is available here

20th April 2004 06:49 UTC

could be useful