> I've had a look at Compiler.java, and looks like a nice parser... have
> you  considered JavaCC for this?
There were several problems with using JavaCC
 - the rasmol language isn't really a language
   * the 'grammer' is inconsistent
   * the behavior can depend upon the evaluation context
     (not context-free)
 - JavaCC is too big and complicated for something this simple

If/when we do something with XML then we won't need a lexical parser ...
we can use the XML tools.

The rest of it will be quite straightforward.

> Anyway, since the Compiler.java was not that easy to read,
sorry ... I think that I actually put a few comments in that code ...
thought it would be easier to understand ... :-)

> I took the
> documentation for an overview of commands...
I recommend that you use the RasMol documentation:
  http://www.openrasmol.org/doc

> As I said on email, I've
> never written an consistent grammer yet, so it's just a one-to-one
> conversion, so  please comment on the stupid bits with this first draft
> inherits from Chime  scripts...
>
> 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.
>
> 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"/>
Here is a random list of comments:

 * this is a direct translation ... you want something better
 * change the names that are stupid
   'zap' -> clear/erase or something
   'monitor' -> measurement ... or something
 * forget rasmolUnits. Everything in Angstroms
 * the fact that values are percentages should be made consistent
 * cartoons/ribbons/strands are all variations of the same thing, protein
secondary structure. Therefore, they should all be the same operation,
but with a different type of 'style'
 * be consistent in use of true vs. on


Enough for now.

Miguel





-------------------------------------------------------
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

Reply via email to