|
|
#1 |
|
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
expression evaluater in AVS source code
Anyone knows how to use the expression evaluator in the AVS source code. Now that it is open source I can use it in my own code, right? Is there any other alternative?
http://home.iitb.ac*****~shreyaspotnis |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jan 2003
Location: Estonia.
Posts: 851
|
Depends on your needs.
If you don't need efficiency then the better alternative is to simply write your own evaluator. AVS script is so primitive that writing an evaluator (slow one) is almost trivial (parser might be little trickier). If you want portability, then reusing AVS source code is not an option. The code is non-portable mess. Only use AVS source if portability is not a concern and you really need the evaluator to be fast. But even then it might be easier to translate the script into some intermediate form (llvm, C--) and let the compiler do the optimization. If you want to evaluate simple arithmetic expression... then really, write your own code. It should be well below 100 lines. Anyways, you can reuse the AVS code quite freely, I think they use BSD 3 license. Phi = (1+sqrt(5))/2 |
|
|
|
|
|
#3 |
|
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
i wanted something similar to AVS, arithmetic expressions and simple functions. And I want it to be cross platform. When I checked out the evallib code I noticed it used windows.h
does anyone know any other alternative? should be in c++ http://home.iitb.ac*****~shreyaspotnis |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Jan 2003
Location: Estonia.
Posts: 851
|
Then, please, do not use AVS script syntax. You can do so much better than that.
There isn't really easy solution for you. I do not think that there is suitable scripting language already out there, so you probably have to implement your own. It's not that difficult if: a) you don't use C/C++ b) efficiency is not a concern c) language is simple enough If you plan to stick with C/C++ then there are plenty of useful tools to help you. Take a look at yacc and bison. If you're comfortable with "modern" C++ then you should try Boost.Spirit. Phi = (1+sqrt(5))/2 |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
hey thanks!
http://home.iitb.ac*****~shreyaspotnis |
|
|
|
|
|
#6 |
|
Forum King
|
make one. flex(the new yacc) and bison make it trivial
use c++ and function pointers, i have some examples both with and without flex and bison, i have one that builds some trivial .exes too... but clearly not developed enough to be of any value. just to warn you though most alternatives out there are much better if you don't care about speed. python would be a good place to start if you just want to get stuff done... not necessarily done quickly. |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Jan 2003
Location: Estonia.
Posts: 851
|
I disagree, python doesn't have much advantage over C/C++ , especially if you're new to python.
All the cool kinds nowadays use OCaml (or other MLish language) to write compilers, interpreters and code analysis tools. Phi = (1+sqrt(5))/2 Last edited by Jaak; 18th January 2008 at 19:17. |
|
|
|
|
|
#8 | |
|
Forum King
|
Quote:
That makes it several orders of magnitude easier imo... |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|