Simkin for Java (c)2000-2004 Simon Whiteside Version 1.29 17/12/2004 * added break statement Version 1.28 30/10/2004 * fixed parsing bug in TreeNodeObject.java (line 284) * fixed bug parsing floats * made the parser support unicode character sequences, such as \u012ab * replaced use of StringBufferInputStream with StringReader in Interpreter Version 1.27 18/12/2003 * fixed bug in integer evaluation * allowed an empty empression in the return statement * added type-coercion functions * added documentation for built-in functions Version 1.26 27/5/2003 * fixed bugs in parameter parsing in TreeNodeObject.java - this would fail if there were any spaces before the bracket (thanks Iain Alexander) * fixed bugs in constructing of messages sent in runtime exceptions (thanks Iain Alexander) Version 1.25 6/5/2003 * added support for a MIDP version - please see the documentation for more information Version 1.24 19/3/2003 * added getAttributes function to Executable - to help debugger support added this function to XMLElementObject * TreeNodeObject now parses the parameters to methods rather than relying on the Simkin parser to do it - this improves line number mapping for TreeNode scripts when viewed in the debugger * added method evaluateExpression to Interpreter, which evaluates an arbitrary expression. You need to prepend the expression with an "=", for example "=1+2" * made script line numbers start with line 0 - to be in line with the C++ version * added location fields to XMLElementObject. You now need to pass an additional location parameter to constructor methods in this class, and in XMLExecutableElement * added a new example, showing how Simkin can be used within a Servlet Version 1.23 23/2/2003 * added more data type conversion information to the documentation (including values of "true") - see the page entitled "Simkin Script Syntax"/"Data Types" * extended the "true" value of an object to include non-zero integers or floats * fixed some bugs in "AddIfNotPresent" support in base classes * added a new example called DynamicTreeNode showing how new fields can be added to a TreeNode object by scripts. This can be used to store dynamic data in arbitrary structures. * added an overview of the classes in the Simkin library to the documentation Version 1.22 22/1/2003 * added new variable to ExecutableRoot, allowing the setting of the interpreter to be used for executing methods * added new function to interface TraceCallback to handle tracing exceptions * added option to Interpreter to disable reflective calls * added "addChild" and "removeChild" to TreeNodeObject * added "clear" to TreeNode * added "include_tabs" option to TreeNode.write to leave tab stops out of a text writing of a treenode * added float type to TreeNode * made callers responsible for creating instances of Interpreter * added new classes ExecutableContext and StackFrame * added support in the interpreter and the Executable interface for more debugger functionality Version 1.21 Date: 13/2/2002 * added Context object and synchronization around the Global Variables to make interpreter thread-safe * added additional information to RuntimeExceptions * now store messages from the Interpreter in a separate Messages class to help translations Version 1.20 Date: 25/9/2001 * added new method "removeNode" to TreeNodeObject * fixed bug when accessing fields of native Java fields of XMLElementObjects * new classes FieldNotSupportedException and MethodNotSupportedException to lead the way to Simkin working with J2ME - you will need to modify your methods inherited from Executable. J2ME doesn't support reflection!! Version 1.19 Date: 5/7/2001 * added line numbers to Runtime Exception * removed local variable cache - could cause memory leaks if exceptions are thrown * ExecutableRoot trace() method calls into Interpreter trace() method. This in turn calls either Tracer or a TraceCallback registered with that instance of the Interpreter. Please see the setTracerCallback() method of Interpreter * added StatementStepper to be called for each statement executed * added new operators "less than or equal", le and '<=' and "more than or equal", ge and '>=' * added a new "for" statement, e.g. "for x=1 to 10 step 5" * added "for each in " statement. This is supported in the TreeNodeObject and XMLElementObject classes. Version 1.18 * not released! * * added Reader load and save to XMLExecutable * addElement in XMLElementObject now returns the newly created object * new methods in TreeNodeObject to bring similar functionality as XMLElementObject * reflective method calls in the interpreter now fall back to looking for String arguments in place of non-primitive types * minor change in assignment code e.g. field:attribute=value; Version 1.17 * bug fix in array index operator for cases a=foo[0] and foo[0]=a * bug fix in methods plus attributes, foo():attr will now behave correctly * bug fix in XMLElementObject - nodes from other documents are now *imported* rather than *cloned* * added AddIfNotPresent feature to XMLElementObject: this means that elements that are references but do not exist can be added on the fly (by default the feature is disabled) Version 1.16 Date: 22nd May 2001 * made the equality operator more reponsive in the interpreter * added "an interpreter per-thread" option - which defaults to one interpreter per thread. * added an example showing "inherits" tag * changed imports to match Sun's Java XML Parser version 1.1. References to the com.sun.xml.tree package are replaced with org.apache.crimson.tree * fixed bug where a null could be propagated from a method which returns no value * added the createXMLElementObject() to XMLElementObject - this feature is used to provide special behaviour in the inherits example. * changed interpreter to use the non-deprecated StringReader rather than StringBufferInputStream * now using javacc 2.0 to generate the parser Version 1.15 Date: 14th May 2001 * bug fix in XMLElementObject - now adds a text node to an element if there isn't already one * bug fix in Interpreter - wasn't coping with "field:attribute=value" properly Version 1.14 * bug fixes in parameter evaluation: foo.bar() the was evaluated in the context of the foo object rather than in the method calling the statement * bug fixes in array index evaluation: foo.bar[] the was evaluated in the context of the foo object rather than in the method calling the statement * made the intValue method in interpreter tolerate floating values * fixed bug where @ was not recognised in field list * added a tagName() method to XMLElementObject * added various functions to XMLElementObject for adding elements * fixed bug where compile errors might be reported for the wrong method Version 1.13 Date: 8th May 2001 -------------------- * added support for the array index operator. This works by calling into two new functions in the Executable class: setValueAt and getValueAt. Java arrays are also supported directly. * The XMLElementObject and TreeNodeObject both support the new array index operator, so you can step through XML or TreeNode children using code like: while (i lt count){ value=variable[i]; } * XMLElementObject and TreeNodeObject also support a function "numChildren" which returns the number of children of a given node or element Version 1.12 10/2/2001 ---------------------- New features: * added support for a "null" object * added new enumerate() method to enumerate over XML and TreeNode elements, please see new Enumerate example and classes XMLElementObjectEnumerator and TreeNodeObjectEnumerator * expression syntax is more flexible - you can now write a=b.c().d(), or b.c().d=e; * a new "!=" (not equal to) operator has been added Bugs fixed: * fixed some errors where attributes could not be said Version 1.11 25/1/2001 ------------------------ New features: * added support for the switch statement Version 1.1 ------------------------ Major changes have been made to make much more use of Java reflection. Simkin scripts can now call *any* Java object's public methods and fields. This has resulted in quite a few changes: * the classes RValue, RValueArray and RValueTable are no longer used - instead Object, Object[] and Hashtable are used * the methods setValue, getValue and method in the Executable interface have changed their prototypes - all other functions have been removed from the interface * you do not have to implement Executable to be available to Simkin scripts - just have public methods or fields The Executable interface is now used as a way of *overriding* the default behaviour of the interpreter - which is to use introspection to find fields and methods. This overriding is the way XMLElementObject and TreeNodeObject find additional methods within XML or TreeNode files. New Features: i) a new datatype, Character, has been added to the language. Characters are enclosed within single quotes Examples: i) have added a new "Person" example - showing how Simkin can call arbitrary Java Documentation: i) the documentation has been altered to reflect the changes Version 1.03 ------------------------ Bug fixes: i) XMLElementObject.setValue: the local variable "other" was called before it was set (sdw) New Features: i) Put some extra information into runtime exceptions (sdw) ii) Added the TreeNode, TreeNodeObject and ScriptedExecutable classes, giving an alternative file format to XML (sdw) Documentation: i) Harmonized the documentation with the C++ version Version 1.02 21/12/2000 ------------------------ The Documentation now contains an EBNF grammar for the language. A new example has been added: HelloWorld Bug fixes: i) incorrect call in ExecutableRoot setValue method to field.getDeclaringClass() rather than field.getType() (Kelly Voltz ) ii) missing break statements when dividing expressions in Interpreter.java (Kelly Voltz ) iii) fixed code in XMLElementObject which would always add fields, negating local variable scope, now these will *not* be added (sdw) Version 1.01 28/11/2000 ------------------------ A few new features: * xml files now use the tag to embed methods. This makes doing validated xml files easier * ExecutableRoot can use introspection to look for matching methods and fields (you can turn this behaviour off) * new syntax has been added to access xml attributes - using the ":" operator The applet demo has been spruced up to show a dialog when it is run. There is a new directory in the examples directory called "applet" which has the applet in it. We have also decided to release Simkin as a free open-source product. Support and customization are available from the author, please email Simon Whiteside at sdw@larts.co.uk. Version 1 1/10/2000 ------------------------ The distribution now includes full source code for Simkin, which unpacks into the simkin subdirectory Beta Version 1 4/9/2000 ------------------------ Welcome to Simkin for Java/XML. Simkin unpacks into a subdirectory called "simkin". This version is contains the following: simkin/Readme.txt - this readme file simkin/Simkin.jar - the class files for the interpreter, place these on your classpath simkin/docs - documentation directory simkin/docs/api - API documentation produced by Javadoc simkin/examples - please put the directory above the simkin directory into your classpath so that you can run the examples, simkin/RunSimpleDemo.bat - this batch file runs the simple script example simkin/RunFieldDemo.bat - this batch file runs the FieldAccess script example simkin/RunDialogDemo.bat - this batch file runs the dialog example