JudoScript Language Version 0.9 Release Note

  1. Install and Run
  2. Release Notes
  3. Changes
  4. Documentation and Examples
  5. Report Bugs and Feedbacks
  6. Copyright and Warranty Notice
  7. Acknowledgement


Install and Run

Now that you are reading this page, you have successfully obtained the software and have it unpacked. Check the following list before run any JudoScript programs:

  1. Your JVM version must be JDK 1.3 or equivalent or highter. Better to use JDK 1.4 or equivalent or higher.
  2. Put file judo.jar in your JVM's class path.
  3. If you intend to use Windows COM and/or registry scripting, make sure the jcom.dll and/or ICE_JNIRegistry.dll are in the path!
  4. If you intend to use JDBC, make sure the JDBC driver classes for your database is in the class path.
  5. If you intend to use XML features, make sure a Java XML parser is in the class path. We recommend Apache Xerces parser, available from Apache's site. For JDK 1.4 users, a XML parser is already included; Xerces may still be preferrable for advanced XML features. Just make sure Xerces class files are before JDK classes.
  6. If you intend to send e-mail, make sure javax.mail.* classes are in your class path. The JavaMail package can be downloaded from JavaSoft's site. It is also part of J2EE.
  7. If you intend to use Ant task scripting, you need to need ant.jar from Apache.
  8. If you intend to use JUSP to develop web sites, register the servlet class com.judoscript.jusp.JuspServlet to your servlet engine and provide a juspRoot init parameter that serves as the root directory for all JUSP pages. If it is not specified, JUSP pages are resolved the same way as other web pages.
  9. To use the SSH and SCP features, the MindTerm/SSH package must be downloaded and installed.


Release Notes


Changes

Changes for 0.9 are mainly directed towards ECMAScript compatibility. There are incompatible syntactic changes but hopefully acceptable to current users.

  • [2005-11-06] Added the default command-line expansion of wildcards on Unix, and use exec /asis option to disable it.
  • [2005-11-06] Switched mail::send to commons-email-1.0 and supports embedding within HTML mails. Retired mail::connect and mail::disconnect commands.
  • [2005-11-06] Introduced a "syntax help" mechanism, starting with mail::send.
  • [2005-11-06] Syntax error only print out the message, not the stack trace.
  • [2005-11-06] Added !include "!..." to force include from CLASSPATH.
  • [2005-11-06] For include file syntax errors, print out the file name.
  • [2005-11-06] Corrected line/column numbers for sub-parser syntax errors, including SQL statements and here-doc text.
  • [2005-11-06] JudoScript code can be embedded by any language source files, provided the language supports multi-line comments.
  • [2005-11-06] The last ; prior to } can now be omitted, except for SQL statements. This unadvertized feature is for JavaScript compatibility.
  • [2005-10-21] Everything is now in cvs.sourceforge.net! This includes source code, examples, source for documentation and all the build tools. You can check out from CVS, install JDK1.3 and JDK1.4 and are ready to use the super easy, menu-driven build tools.
  • [2005-10-21] Added getFileCanonicalPath() method to string.
  • [2005-10-21] Added distanceInKM/MilesByRadians/Degrees() system function.
  • [2005-10-21] Added allGlobalVariables() system function.
  • [2005-8-28] Added copyProperties() system function.
  • [2005-8-28] Enhanced JuSP, including new tags such as <%+ %>, <%!email%>, <%!zip%>, <%!int%>, <%!float%>, <%!alpha%>, <%!cancel%>, etc.
  • [2005-8-28] Fixed regex of empty string.
  • [2005-7-31] Added $$parser for do as html statement, and the parser object has a rushToTag() and a skipToTag() method; they can both take one or more tag names; the former returns the text while the latter discards it. Also, for HTML, JavaScript code in <script> tag are handled better.
  • [2005-7-24] Added a toAbsoluteUrl() method for String.
  • [2005-7-24] For the regular expression Matcher object, added a getGrous() method.
  • [2005-6-14] Allow hyphens and other characters in the SGML/XML tag names.
  • [2005-6-14] Refactor to use org.apache.commons.lang as much as possible.
  • [2005-5-1] Added exponential operator **.
  • [2005-5-1] Added getOne() method to the Set.
  • [2005-4-6] Added `..` and ``..`` expression to take shell executable output as string or array.
  • [2005-4-6] Added openSocket(), pushd() and popd() functions.
  • [2005-4-6] String literals can be used directly to call their methods.
  • [2005-4-6] The loadProperties() function can optionally evaluate ${} tags in the values with corresponding key values.
  • [2005-4-6] Added these methods to String: chomp(), replaceTags(), linesToArray() and writeToZip().
  • [2005-4-6] Support for (x, y, ..) = array; and var (x, y, ..) = array;
  • [2005-4-6] Added "copy .. into .. as .." for single file archiving.
  • [2005-3-11] Support /xxx options for exec. Added "asis" option not to convert command line and env var values to OS style.
  • [2005-3-11] eval, evalFile, evalSeparate and evalFileSeparate now takes parameters.
  • [2005-2-23] The JuSP Platform!
  • [2005-2-23] Added robust logging, using Jakarta's commons-logging package.
  • [2005-2-23] Added embedded function declartion.
  • [2005-2-23] Added function annotation, which is programmatically available via $$annotation
  • [2005-2-23] Added function context access via $$context.
  • [2005-2-23] Added these pragmas: !pragma undefinedAccessPolicy and !pragma assertAs.
  • [2005-2-23] Added the copy operator := for maps, arrays, sets and lists.
  • [2005-1-30] Added Hibernate ORM/HQL support.
  • [2004-11-27] Added wsdl:: operator and support for SOAP web service scripting!
  • [2004-11-14] Added do .. as jsp statement.
  • [2004-11-14] Added saveProperties system function.
  • [2004-11-14] In copy command, added a dupOk option to allow duplicate entries copied from multiple file sets into a single archive.
  • [2004-11-9] For the simple values, added splitWithMatches() and splitWithMatchesOnly() and writeToFile() methods, and improved startsWith(), endsWith() and trim() methods.
  • [2004-11-9] In listFiles command, option fileOnly is now default. To show directories as well, specify showDir option.
  • [2004-11-3] Use db:: namespace for all SQL scripting statements.
  • [2004-11-3] Use mail:: namespace for mail statements/functions: mail::connect, mail::send (instead of sendMail) and mail::disconnect.
  • [2004-11-3] Use new com:: to obtain ActiveX controls.
  • [2004-11-3] Use gui::events instead of guiEvents.
  • [2004-11-3] Change eval/evalExternal/evalFile to systems functions and become eval, evalFile, evalSeparate and evalFileSeparate. The latter two commands return the exit values.
  • [2004-11-3] Change SGML/XML events to be prefixed with ":", to reduce reserved words.
  • [2004-09-22] Support named bind parameters within prepared SQL statements!
  • [2004-09-22] Allow name-value pair initialization of new java.util.Map instances, and allow dots in keys in Object and java.util.Map initialization.
  • [2004-09-22] Add addToClasspath and limit clause to the listFiles command.
  • [2004-09-22] Support closure-like syntax for annonymous function declaration.
  • [2004-09-12] Greatly enhanced listFiles, so that this command not only finds and return files, but also a generic file processing statement. For each selected file, you can also choose to do remove, setFileTime, setReadOnly, or apply O.S. commands via the exec clause, or do any processing with a block of code, where $_ represents the file. Consequently, a number of file processing commands, such as remove, chmod, chgrp, chown, setFileTime and setReadOnly have be removed. Also, the transform clause in copy has been removed as well.
  • [2004-09-12] Now $_ can be used in string literals directly just like ${xxx}.
  • [2004-08-14] Enhanced Java interface adapter, so that you can do like this:
    a = new java::MouseListener, WindowListener, KeyListener {
      .... // The body is same as Java-extension class.
    };
    
  • [2004-08-14] Added #classpath and user classpath support.
  • [2004-08-14] exec by default runs synchronously. To run asynchronously, use this syntax:
    exec && cmdline;
    
  • [2004-07-30] Ant task scripting support. Any Ant action tasks can be specified with this syntax:
    anttask::<echo message="Hello, ${var}!"/>
    anttask::<echo>
     Hello, ${var}!
    </echo>
    
  • [2004-07-30] Have a native <judoscript> tag for Ant build scripts. Enhanced ${} operator to take names with dots. ${} searches for variables first; if not found, it tries the system properties. This feature is mainly for use in Ant build scripts.
  • [2004-07-30] Use predefined #sysprops to get and set system properties.
  • [2004-07-14] The list command has been replaced by listFiles! The listPrint command has been replaced by listPrintFiles!
  • [2004-07-14] The regex() system function has been deprecated (but not removed); use an array of two elements if regex mode is needed and simply pass it to String's regex methods.
  • [2004-07-14] The dynamic function parameters with an array is changed to use {{ }} instead of { }, as { } is also used to initialize an Object which can be passed as a parameter as well. So now,
    params = [ 1, 2, 4 ];
    foo({{params}});
    
    instead of
    params = [ 1, 2, 4 ];
    foo({params});
    
  • [2004-06-20] The preparedExecuteQuery, preparedExecuteUpdate, preparedExecuteQueryCall and preparedExecuteUpdateCall have all been deprecated and replaced by the counterparts without prepared prefix.
  • [2004-06-20] Syntax for using Java has been improved by treating Java classes as a special namespace; also supports the Java-like import mechanism. The old way is deprecated but is kept for backward compatibility for now. The following are examples of the new way:
    a = new java::Hashtable;
    b = new java::int[4];
    c = java::Map;
    
    class MyClass extends java::HashMap { ... }
    
    where the old way is:
    a = javanew java.util.Hashtable;
    b = javanew int[4];
    c = javaclass java.util.Map;
    
    class MyClass extendsjava HashMap { ... }
    
  • Syntax for array, struct and set initialization has been changed! The following are examples of the new initialization syntax:
    a = [ 1, 'abc', Date(2003,6,26) ]; // array
    a = new Array(); // same as a = new array;
    a = Set [ 1, 'abc', Date(2003,6,26) ]; // set
    a = new Set( 1, 'abc', Date(2003,6,26) ); 
    a = { name : 'James Huang', 'last name' : 'Huang' }; // struct
    a = new Object(); // same as a = new struct;
    
    where the old way is:
    a = { 1, 'abc', Date(2003,6,26) }; // array
    a = new Struct ( name : 'James Huang', 'last name' : 'Huang' );
    
    Hence, the new syntax is [] for array literals and {} for struct.
  • The + operator has changed meaning! It is also used for string concatenation. This means the string values are not converted to numbers automatically in arithmic expressions. The @ operator is still available as explicit string concatenation.
  • Added NaN (Not-a-Number) and Infinity values. There are also MAX_VALUE and MIN_VALUE for nubmers.
  • Function reference calls have been simplified. The -> is still available but is not necessary any more. For foo(), it looks for the function named foo first; if not found, JudoScript tries to resolve the name from the variable foo for a function reference. If -> operator is used, it will explicitly use function reference.
  • Built-in object names have the first letter capitalized. They become Struct, Array, TableData, Set, etc. The old names are still available but not recommended.
  • The Struct is deprecated and becomes Object.
  • The for-in for struct and java.util.Map iterates through the keys.
  • Tim Endre's Windows Registry package is bundled with software.
  • Example library has been re-tested and updated, and documentation, including articles, are updated for the new features.

Changes for 0.8a and 0.8:

  1. JudoScript supports ActiveX scripting!
  2. JudoScript supports Java extension classes, that is, you can extend Java classes and interfaces. Because of this, the embedded Java class and adapter mechanisms are deprecated.
  3. JudoScript supports variables embedded inside string literals with ${Xyz}. They can be used individually as well. If a variable named Xyz exists, its value is taken, otherwise, the environment variable with that name, if exists, is retrieved. There are also a number of predefined shortcuts, such as ${~} for home directory, ${.} for the current directory, ${:} for path separator and ${/} for file separator.
  4. JudoScript now uses an easy way to consistently document scripts with its usage mechanism.

Changes for 0.7:

  1. Documentation has been completely re-written, accompanying the overall code review and functionality finalization. There are still a few areas need be finished, but it is much better than the older version under the title Language Specification.
  2. Variable names no longer need to start with $! Dollar signs in variable names make an immeidate false impression that JudoScript is somewhat like some archaic language, which is unfortunate. However, it does segregate the name spaces for variables, object data members and function names. Now that dollar sign is not required to start variable names, they all fall in the same name space and can potentially clash. This causes two problems in terms of the syntax:
    • Class data member and variables:
      class Foo {
        function bar { aData = 'abcde'; }
      }
      Is aData a local variable or a data member of class Foo? It is resolved to be a variable if already exists (not available in this example), or a data member if the variable did not exist but the data member does, or as a new variable if not variable nor data member exist at the moment. To ensure it is a data member, use the this modifier to reference a data member inside a class method: this.aData = 'abcde';
    • Function variables. In the case of a(), say, it is not clear whether a is a function name or a variable that holds a reference to a function. JudoScript chooses to interpret it as a function name. To invoke a function reference, use this new notation: a->(). This applies to class data members as well: obj.a->(), whereas obj.a() invokes the object's method. If the function reference is stored in an array, however, this notation is not needed: arr[i]().
  3. Changed the way static Java member usage, e.g.
    java.lang.System::out.println('hello');
  4. Changed function alias declarations for Java static methods, e.g.
    function rt for java.lang.Runtime::getRuntime();
  5. Added "sgml" as a synonym to "html".
  6. Added "do ... as lines" statement.
  7. String contains() method also works with regex's.
  8. Added "hsqldb" and "pointbase" to the known JDBC driver list.
  9. Added <!--> as a separate case than <!>; <!> includes <!--> only if the latter is not handled.
  10. UserDefined, added method "copy(UserDefined)".
  11. Added isA() method to all value objects.
  12. Added "isOdd" and "isEven" user methods to values.
  13. Added "fmt/formatRoman" and "parseIntRoman" user methods to numeric values.
  14. Added "isAlpha/isLetter", "isAlnum/isLetterOrDigit" and "isWhite/isWhitespace" user methods to character values.
  15. Added "exists" user methods to array.
  16. Added "createTreeOutput" system method.
  17. Added "ear" and "war" in addition to "jar" for FS commands.

Changes for 0.6:

  1. Changed package names to com.judoscript.*. This affects BSF and embedded engine.
  2. Modified syntax error message, so it does not print out a long list of "expected symbols".

Changes for 0.5:

  1. Open source!
  2. Added transform clause for the copy command.
  3. Provides a console debugger. This is rudimental, and is more or less a reference for a more robust, GUI-based debugger.
  4. Provides the Java file white-box testing feature.

Changes for pre.0.4:

  1. Added support for generic Java package lists; the built-in package lists have become aliases using this feature.
  2. Added support for conditional include and const definitions.
  3. Added support for initialization script, ".judoscript".
  4. Added countLines option to list/ls commands.
  5. Added support for SSH and SCP (requires ISNetworks distribution of MindTerm/SCP version 1.2.1 SCP Release 3).
  6. Added support for encryption (requires JCE1.2.1; in JDK1.4 already).
  7. Added support for XSLT (requires Xalan/Xerces).
  8. Added support for Windows registry (requires Tim Endres' JNI Registry Library at http://www.trustice.com) (Included since v0.8b so no such need any more).
  9. Added support for Unix syslog (uses Jef Poskanzer's Acme package class).

Changes for pre.0.3:

  1. Added regular expression support (requires JDK1.4).
  2. Added TAR file support -- use just like ZIP/JAR.
  3. Added chown/chgrp/chmod commands.
  4. Added database table dumping feature.
  5. Added better database meta data support.
  6. Added tableData data structure.
  7. Added printTable statement for tabular data printing.
  8. Added evalFile statement (in addition to eval and evalExternal).
  9. For JDBC, allow PreparedStatement and ResultSet methods to be called directly. These can be RDBMS-specific.
  10. Added FTP support (uses the Java FTP Client Library from http://www.enterprisedt.com).

Changes for pre.0.2:

  1. Bean Scripting Framework support.
  2. Bug fix: XML packages should not be mandatory but optional.


Documentation and Examples

Documentation includes a Language Comprehensive Documentation that describes each feature precisely, and a set of articles discussing major features with a lot of code examples. The source code of the formal code listings are all included in the examples directory.


Report Bugs and Feedbacks

To report bugs, submit feedback or have a question, come to www.judoscript.com and click the feedback link. When submitting bugs, check the latest version first, and make sure the version number is included in the message. To get a version information, do this:

  java judo -x . versionInfo()


Copyright and Warranty Notice

JudoScript is free software; you can embed, modify and redistribute it under the terms of the GNU Lesser General Public License version 2.1 or up as published by the Free Software Foundation, which you should have received a copy along with this software. It can be found at the GNU site.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.


Acknowledgement

A handful of Java source files concerning HTTP cookies are derived from Apache Tomcat project; they are in a different Java package, so name clashes is prevented. This also serves the purpose of fulfilling the licence requirement of using such source files.

Some of the examples are ported from Java programs in Java tutorials from JavaSoft. You may download the Java source from Sun.

JudoScript bundles some other software packages that are either public domain without licensing restrictions or under the same license for this software (i.e., LGPL). Their package names are usually changed so that no conflicts would occur should a user machine have another version of the same software available in the class path. Their source code is included in the source code distribution of this software. The following is a descriptiong of these.

A number of Apache commons packages are included and used, such as org.apache.commons.lang.

The Microsoft COM support is by JCom package by Yoshinori Watanabe. It is included verbatim.

The TAR support of JudoScript uses classes developed and contributed to the public domain by Timothy Gerard Endres. Many thanks for his wonderful work!

The Unix syslog feature is included from ACME Labs

An FTP client is included (but not documented and used yet). This software is created by Enterprise Distributed Technologies Ltd.