Subj : Re: Is there any JavaScript Syntax/Grammar checker for Rhino To : Jim Wang From : Igor Bukanov Date : Tue Dec 02 2003 10:51 am Jim Wang wrote: > We are developing a browser based development platform and runtime platform > which allow develoeprs to develop web applications using minimum JavaScript > on J2EE appservers with full database support - no Java coding needed. > JavaScript is used for formula scripting and rule scripting. > > We are using Rhino Javascript as the scripting language. While developing > business applications using our platform, our users are facing usibility > issues such as do not know syntax error until at runtime; do not know why > the javascript does not work as intended, etc. > > We wonder > - if there is any Syntax checking API (calling from Java) available for > Rhino JavaScript, so that we can call the API to do the checking when saving > the JavaScript. You can just compile you script without executing them. See compileReader/compileString methods in Context, http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Context.html .. To collect information about syntax errors you may define own ErrorReporter, http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/ErrorReporter.html .. > - if there is any debugging or tracing features (for server side) in Rhino > Javascript - so that we can easily pinpoint out what is not programmed > correctly. You can use Rhino debug API defined in org.mozilla.javascript.debugger, http://lxr.mozilla.org/mozilla/source/js/rhino/src/org/mozilla/javascript/debug to implement debugger for your application. Or you can alter Rhino debugger, http://www.mozilla.org/rhino/debugger.html , which uses the above API to implement full featured GUI debugger, to use some form of RPC to report debugging information to remote clients. But that is not easy. Regards, Igor .