Hi,
Does anyone know of a good place to look for a starting point -- I'm
building an application on J2ME and I want to have a scripting
language to both access my UI and the database RMS. Most phones have
very limited resources so the interpreter should be small and fast.
Does anyone know of a simple scripting language source to handle if (
) { } else {} and while ( ) { } and expressions and function calls
back into Java. I'm using javacc at the moment and it's good but it
generates a lot of code.
Plus, I'd like the script to be compiled into a bytestream and then
executed on the phone. The compilation will happen before loading on
the phone. It's a little like javac compiling .java to .class and then
the KVM executing the bytecode. The problem is that ClassLoader
support is not in J2ME ( or I would compile the scripts as .class
[renaming them, of course] and load via ClassLoader) and the size of
the class is limited by the phone's preverifier, but the resource
limits are much higher. Therefore, we can put the scripts and
database stuff in a resource and allow our app do more than the limits
of phone's preverifier allows.
Basically, the question is:
Is there a small language/ compiler/ executor example out there?
Or is it better to simply obfuscate the source script (making it
smaller) and run that?
Thanks,
Ralph