To Miguel, and all (see below),
To all:
below is a first draft of a XML based scripting language. The examples below don't have any schema yet, but it will have one when things become a bit more solid. I intend to make all script command elements empty.
This is the time to make script command requests and post any issues you have with other script languages.
It could be useful to look at scripting languages in XML. What come to mind are:
- ant
- bpel4ws
- SMIL
and
- svg
- xslt
Next, do you wish the language to have constructs like if, loop, break etc.
Also do you wish to have a persistent data structure (for logs, displays, repeats, etc.)
Personally I prefer to see XML elements as objects rather than verbs, as this may make it easier to create Java classes mapping onto them. I would prefer to see
<axis rotate="..."/>
or use the SVG-like: <axis> <rotate/> </axis>
from my point of view it makes it easier to map onto CML objects <molecule rotate="..."/> etc.
animate X -> <animate command="X"/>
e.g. <animate command="play"/>
background <color> -> <background color="colorExpression"/>
color {<object>} <color> -> <color object="X" color="colorExpression">
where X = atoms|labels|bonds|axes
cpk <boolean> -> <set field="cpk" value="on"/>
on|true|yes
cpk <value> -> <cpk percentage="90"/> | <cpk rasmolUnit="50"/>
define <var> <expression> -> <define variable="X" expression="Y"/>
delay {<delaytime}} -> <delay/> | <delay seconds="5"/>
echo <string> -> <echo message="Hello Jmol user"/>
exit -> <exit/>
label <boolean> -> <set field="label" value="on"/>
see cpk <boolean>
label <string> -> <label expression="%a"/>
load {<format>} <filename> -> <load file="some.pdb"/>
load {<format>} <url> -> <load format="pdb" url="http://sf.net/stream.cgi"/>
loop {<delaytime>} -> <loop/> | <loop seconds="5"/>
monitor <number> <number> -> <monitor distance="num1 num2"/>
monitor <num> <num> <num> -> <monitor angle="num1 num2 num3"/>
monitor <num> <num> <num> <num> -> <monitor dihedral="num1 num2 num3 num4"/>
move <xRot> <yRot> <zRot> <zoom> <xTrans> <yTrans> <zTrans> <slab> <time>
{<FPS>} {<MaxAccel>} -> <move rotateX="60" zoomFactor="200" translateX="5"
time="3"/>
this might better be done differently, by using loops? see also rotate
quit -> <quit/>
refresh -> <refresh/>
reset -> <reset/>
rotate <axis> <value> -> <rotate axis="x" angle="60"/>
script <filename|url> -> <script format="chime" url="http://some.where/"/>
select {<expression>} -> <select expression="*"/>
set <parameter> <value> -> <set field="param" value="value"/>
see also label and cpk
slab <boolean> -> <set field="slab" value="on"/>
slab <percentage> -> <slab percentage="56"/>
spacefill -> <set field="cpk" value="on"/>
translate <axis> <value> -> translate axis="x" angle="6"/>
wireframe <boolean> -> <set field="wireframe" value="on"/>
wireframe <value> -> <wireframe value="40"/>
zap -> <zap/>
zoom <boolean> -> <set field="zoom" value="on"/>
zoom <value> -> zoom value="40"/>
Because an XML doc needs a root element, commands are wrapped in a <script> element:
<script xmlns="http://jmol.sf.net/schema/jmolscript"> <zap/> <load url="http://www.matrix.org/aceticAcid.cml"/> <set field="cpk" value="true"/> <monitor angle="1 2 3"/> </script>
Note that expressions are not XML-ized... is that worth doing it? Would it be required in the first version of the scripting language?
Where are the expressions? I assume you are concerned about whether there is a need for microparsing. It's always a balance.
P.
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Jmol-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-users