/** * JavaCC file */ options { JDK_VERSION = "1.5"; STATIC = false; // OK to create new parsers IGNORE_CASE = true; // all expressions are case insensitive } PARSER_BEGIN(RasmolParser) package org.simtk.parser; import java.io.*; /** * This class is autogenerated from a .jj file by * the javacc parser generator */ public class RasmolParser { public RasmolParser(String commandLine) throws ParseException { this(new BufferedReader(new StringReader(commandLine))); parseInput(); } } PARSER_END(RasmolParser) SKIP : { " " | "\t" | "\n" | "\r" } TOKEN : { < L_BRKT: "[" > | < R_BRKT: "]" > | < COMMA: "," > | < INT: ( )+ > | < #DIGIT: ["0" - "9"] > } void parseInput() : {} { rasMolStatement() } void rasMolStatement() : {} { setBackgroundCommand() } void setBackgroundCommand() : {} { setBackgroundColorPredicate() colorExpression() } void setBackgroundColorPredicate() : {} { "set background" | "background" // second way to set background in pymol | "bg_color" // pymol script syntax } void colorExpression() : {} { rasmolColorNumbers() | rasmolColorName() } void rasmolColorNumbers() : {} { // e.g. [255,255,255] } void rasmolColorName() : {} { "blue" | "cyan" | "greenblue" | "orange" | "red" | "violet" | "yellow" | "black" | "green" | "magenta" | "purple" | "redorange" | "white" // blue [0,0,255] black [0,0,0] // cyan [0,255,255] green [0,255,0] // greenblue [46,139,87] magenta [255,0,255] // orange [255,165,0] purple [160,32,240] // red [255,0,0] redorange [255,69,0] // violet [238,130,238] white [255,255,255] // yellow [255,255,0] }