From: Miguel <mi...@jm...> - 2005-10-23 19:00:14
|
Nicolas wrote: > I have some troubles with the Eval / Compile parts to add a new command= . > Can you help me ? What should I do to add new commands ? 1. In Token.java, add a new token for the 'nico' command: final static int isosurface =3D command =7C 94; final static int nico =3D command =7C 95; // Nico's command 2. In Token.java, add the token to the symbol lookup table: =22isosurface=22, new Token(isosurface,varArgCount,=22isosurfa= ce=22), =22nico=22, new Token(nico, varArgCount, =22nico=22), 3. In Eval.java, dispatch when the nico token is seen: case Token.stereo: stereo(); break; case Token.nico: nico(); break; 4. In Eval.java, implement the nico() function: void nico() throws ScriptException =7B System.out.println(=22Nico was here=21=22); =7D Miguel ----- Open Source Molecular Visualization www.jmol.org miguel=40jmol.org ----- |