Expression evalution code

R

Robert M. Gary

I'm looking for some sort of expression evaluation code. I want my customer
to be able to send me something like (if foo="hello" and j> 0 ) to
*dynamically* control logic flow. I don't want them to have to install a
java compiler so I'm not as interested in javacc.
I noticed that the JSP package as an expression evaluation language
(http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html) but it
appears to be attached to JSP (which I'm not using). I wonder if I could
pull it out and construct fake pages to serve it.
Does anyone know of an existing avialable quicky syntax language evaluator
for this type of application? Even a lex/yacc would be a start.

-Robert
 
S

Steve W. Jackson

Robert M. Gary said:
I'm looking for some sort of expression evaluation code. I want my customer
to be able to send me something like (if foo="hello" and j> 0 ) to
*dynamically* control logic flow. I don't want them to have to install a
java compiler so I'm not as interested in javacc.
I noticed that the JSP package as an expression evaluation language
(http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html) but it
appears to be attached to JSP (which I'm not using). I wonder if I could
pull it out and construct fake pages to serve it.
Does anyone know of an existing avialable quicky syntax language evaluator
for this type of application? Even a lex/yacc would be a start.

-Robert

That's essentially what javacc is. It's not a compiler for end users.
Instead, it's a tool for developers to construct a language syntax and
generate code for that language. The application I work on does
simulation and modeling, and it supports its own Expression language.
The entire expression language is built around javacc grammar
definitions so that users can type text into an editor that's part of
our application and have it evaluated and executed in Java code we
derived from what javacc creates. It's not trivial.

= Steve =
 
T

TechBookReport

Robert said:
I'm looking for some sort of expression evaluation code. I want my customer
to be able to send me something like (if foo="hello" and j> 0 ) to
*dynamically* control logic flow. I don't want them to have to install a
java compiler so I'm not as interested in javacc.
I noticed that the JSP package as an expression evaluation language
(http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html) but it
appears to be attached to JSP (which I'm not using). I wonder if I could
pull it out and construct fake pages to serve it.
Does anyone know of an existing avialable quicky syntax language evaluator
for this type of application? Even a lex/yacc would be a start.

-Robert
Have you looked at Beanshell? http://www.beanshell.org, it sounds
exactly what you're looking for.

Pan
========================================================
TechBookReport - Java: http://www.techbookreport.com/JavaIndex.html
 
R

Robert M. Gary

That sounds pretty cool!

I've also run across JEL http://galaxy.fzu.cz/JEL/ which looks really cool.
The examples are set up using predefined variables (but the valuation and
comparisons are dynamic). I want to see if I can make the variables
themselves dynamic.

-Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top