View Single Post
  #15  
Old 03-26-2008, 02:09 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Alright fixed all 3 of those problems you gave PFA as well as added support for arrays. It's all in the top post.

PHP Code:
this.evl("(3*(1+2))*2"); 
This didn't work because there was a problem when sending nested parantesses. It would actually call convertToPostFix(3*1+2) instead of convertToPostFix(3*(1+2)). Works now after adding 2 small lines of code.

PHP Code:
this.evl("3--2"); 
If you put this into Graal, it will give you a compile error actually. Since I added support for negatives, just do 3- -2 or so.

PHP Code:
this.evl("3-(-2.2)"); 
Works now since I added support for negatives. Basically it will use - as an operator if there was no operator proceding it. Otherwise it just adds it to the operand. Probably will not work right if you did something like:
PHP Code:
- -this.foo 
Since it will try to get makevar("-this.foo") which doesn't exist. I will fix that later too.
__________________
Do it with a DON!
Reply With Quote