For what it is worth, I solved the problem by doing this:

private static native int eval(int x, int y, int z) /*-{
  eval("var x = " + x);
  eval("var y = " + y);
  eval("var z = " + z);
  return parseInt(eval("x + y * z"));
}-*/;

And it seems to work, but seems there could be a smarter way.  This
method is called *very* often so it's in my best interest for it to be
as efficient as possible.

A bit more explanation, I'm allowing users to define expressions that
I want to evaluate (think of a calculator).  Rather than writing my
own lexical analyzer I thought I'd use the one built into javascript.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to