multivalent.std
Class VScript
public
class
VScript
extends Object
Micro scripting language.
Statement evaluator: mini scripting language that can tickle Preferences, Browser attributes, and local (node or behavior) attributes.
Not fast, but fast enough; not powerful, but powerful enough.
Rather than growing into a real language, it will be replaced if necessary, or alternatives will be available.
Like Tcl, as far as it goes.
Syntax
- body = cmd; cmd; ...
- cmd = fn args
- fn = get | set | event
- args = literal | $variable
- literal = String
- variable = [namespace.]field
- namespace = pref | doc
Namespaces
- no namespace => local attrs (passed in call)
- pref => preferences
- doc => current document attrs
Commands (return value of script is return value of last command)
- set (literal | variable) => return value of (literal | variable)
- $(variable) => shorthand for above
- set (literal | variable) (literal | variable) => eval first pair to get name, set to value of eval of second pair
- event => trigger semantic event
Version: $Revision: 1.3 $ $Date: 2003/06/02 05:30:36 $
Method Summary |
static String | eval(Object expr, Document doc, Map<String,Object> locals, Node node) Evaluate an expression, returning result in a String. |
static boolean | getBoolean(String name, Document doc, Map<String,Object> locals, String seed) |
static String | getVal(String name, Document doc, Map<String,Object> locals, String seed) |
static String | getVal(String name, Document doc, Map<String,Object> locals) |
static String | getVar(String name, Document doc, Map<String,Object> locals) |
static String | putVal(String name, String val, Document doc, Map<String,Object> locals) |
public static final String[] commands
public static String eval(Object expr,
Document doc, Map<String,Object> locals,
Node node)
Evaluate an expression, returning result in a String.
public static boolean getBoolean(String name,
Document doc, Map<String,Object> locals, String seed)
public static String getVal(String name,
Document doc, Map<String,Object> locals, String seed)
public static String getVal(String name,
Document doc, Map<String,Object> locals)
public static String getVar(String name,
Document doc, Map<String,Object> locals)
public static String putVal(String name, String val,
Document doc, Map<String,Object> locals)