org.jmol.viewer
Class Compiler
class
Compiler
extends Object
Method Summary |
void | addContextVariable(String ident) |
boolean | addNextToken() |
boolean | addNextTokenIf(int tok) |
boolean | addSubstituteTokenIf(int tok, Token token) |
boolean | addTokenToPostfix(int tok, Object value) |
boolean | addTokenToPostfix(int tok, int intValue, Object value) |
boolean | addTokenToPostfix(Token token) |
void | addTokenToPrefix(Token token) |
boolean | charToken() |
boolean | checkForCoordinate(boolean isImplicitExpression) |
boolean | checkForItemSelector() |
boolean | clauseAlternateSpec() |
boolean | clauseAnd() |
boolean | clauseAtomSpec() |
boolean | clauseCell() |
boolean | clauseChainSpec(int tok) |
boolean | clauseComparator() |
boolean | clauseConnected() |
boolean | clauseDefine() |
boolean | clauseItemSelector() |
boolean | clauseModelSpec() |
boolean | clauseNot() |
boolean | clauseOr(boolean allowComma) |
boolean | clausePrimitive() |
boolean | clauseResidueSpec() |
boolean | clauseResNameSpec() |
boolean | clauseSequenceSpec() |
boolean | clauseSubstructure() |
boolean | clauseWithin() |
static String | cleanScriptComments(String script)
allows for three kinds of comments.
|
boolean | commandExpected() |
boolean | compile(String filename, String script, boolean isPredefining, boolean isSilent, boolean debugScript, boolean isCheckOnly) |
boolean | compile0() |
boolean | compileCommand() |
boolean | compileExpression() |
boolean | eol(char ch) |
boolean | error(int error) |
boolean | error(int error, String value) |
boolean | error(int error, String value, String more) |
boolean | error(String errorMessage) |
float | floatValue() |
boolean | generateResidueSpecCode(Token token) |
Token[][] | getAatokenCompiled() |
Compiler.FlowContext | getBreakableContext(int nLevelsUp) |
Hashtable | getContextVariables() |
boolean | getData(String key) |
String | getErrorMessage() |
static int | getHexitValue(char ch) |
int[] | getLineIndices() |
short[] | getLineNumbers() |
boolean | getNumericalToken() |
String | getScript() |
Token | getSequenceCode(boolean isSecond) |
Token | getToken()
gets the next token and sets global theToken and theValue |
String | getUnescapedStringLiteral() |
boolean | handleError() |
int | intPeek() |
boolean | isExpressionNext() |
boolean | isFunction(String name) |
boolean | isLineContinuation(int ichT) |
static boolean | isSpaceOrTab(char ch) |
boolean | isSpecTerminator(int tok) |
boolean | isToken(int tok) |
BitSet | lookingAtBitset() |
boolean | lookingAtComment() |
boolean | lookingAtDecimal() |
boolean | lookingAtEndOfLine()
check for leading #jx or
if you see it, then only strip those 4 characters
if they put in #jx then they are not going to
execute anything, and the regular code will take care of it
|
boolean | lookingAtEndOfStatement() |
float | lookingAtExponential() |
boolean | lookingAtInteger() |
boolean | lookingAtLeadingWhitespace() |
boolean | lookingAtLoadFormat() |
boolean | lookingAtLookupToken() |
boolean | lookingAtObjectID(boolean allowWildID) |
boolean | lookingAtSeqcode() |
boolean | lookingAtSpecialString() |
boolean | lookingAtString() |
static int | modelValue(String strDecimal) |
boolean | moreTokens() |
boolean | returnToken() |
int | tokAt(int i) |
static boolean | tokAttr(int a, int b) |
static boolean | tokAttrOr(int a, int b1, int b2) |
static boolean | tokenAttr(Token token, int tok) |
Token | tokenNext()
increments the pointer; does NOT set theToken or theValue |
boolean | tokenNext(int tok) |
int | tokPeek() |
boolean | tokPeek(int tok) |
Object | valuePeek() |
private
Token[][] aatokenCompiled
private int cchScript
private int cchToken
private Hashtable contextVariables
private String errorLine
private String errorMessage
private static final String[] errors
private static final int ERROR_badArgumentCount
private static final int ERROR_badContext
private static final int ERROR_commandExpected
private static final int ERROR_coordinateExpected
private static final int ERROR_endOfCommandUnexpected
private static final int ERROR_endOfExpressionExpected
private static final int ERROR_identifierOrResidueSpecificationExpected
private static final int ERROR_invalidAtomSpecification
private static final int ERROR_invalidChainSpecification
private static final int ERROR_invalidExpressionToken
private static final int ERROR_invalidModelSpecification
private static final int ERROR_missingEnd
private static final int ERROR_numberExpected
private static final int ERROR_numberOrVariableNameExpected
private static final int ERROR_residueSpecificationExpected
private static final int ERROR_tokenExpected
private static final int ERROR_tokenUnexpected
private static final int ERROR_unrecognizedExpressionToken
private static final int ERROR_unrecognizedParameter
private static final int ERROR_unrecognizedToken
private String filename
static Hashtable globalFunctions
boolean haveString
private int ichCurrentCommand
private int ichToken
private int iCommand
private boolean iHaveQuotedString
private boolean isCheckOnly
boolean isCommaAsOrAllowed
boolean isEmbeddedExpression
boolean isImplicitExpression
private boolean isNewSet
private boolean isSetBrace
boolean isSetOrDefine
private boolean isShowCommand
private boolean isShowScriptOutput
private boolean isSilent
int itokenInfix
private short lineCurrent
private int[] lineIndices
private short[] lineNumbers
static String[] loadFormats
Hashtable localFunctions
private boolean logMessages
private Vector ltoken
Vector ltokenPostfix
private int nSemiSkip
private boolean preDefining
private int ptNewSetModifier
private boolean residueSpecCodeGenerated
private String script
Object theValue
int tokCommand
private void addContextVariable(String ident)
private boolean addNextToken()
private boolean addNextTokenIf(int tok)
private boolean addSubstituteTokenIf(int tok,
Token token)
private boolean addTokenToPostfix(int tok, Object value)
private boolean addTokenToPostfix(int tok, int intValue, Object value)
private boolean addTokenToPostfix(
Token token)
private void addTokenToPrefix(
Token token)
private boolean charToken()
private boolean checkForCoordinate(boolean isImplicitExpression)
private boolean checkForItemSelector()
private boolean clauseAlternateSpec()
private boolean clauseAnd()
private boolean clauseAtomSpec()
private boolean clauseCell()
private boolean clauseChainSpec(int tok)
private boolean clauseComparator()
private boolean clauseConnected()
private boolean clauseDefine()
private boolean clauseItemSelector()
private boolean clauseModelSpec()
private boolean clauseNot()
private boolean clauseOr(boolean allowComma)
private boolean clausePrimitive()
private boolean clauseResidueSpec()
private boolean clauseResNameSpec()
private boolean clauseSequenceSpec()
private boolean clauseSubstructure()
private boolean clauseWithin()
private static String cleanScriptComments(String script)
allows for three kinds of comments.
NOTE: closing involves two asterisks and slash together, but that can't be shown here.
1) /** .... ** /
2) /* ..... * / may be INSIDE /**....** /).
3) \n//.....\n single-line comments -- like #, but removed entirely
The reason is that /* ... * / will appear as standard in MOVETO command
but we still might want to escape it, so around that you can have /** .... ** /
also,
Parameters: script
Returns: cleaned script
private boolean commandExpected()
boolean compile(String filename, String script, boolean isPredefining, boolean isSilent, boolean debugScript, boolean isCheckOnly)
private boolean compile0()
private boolean compileCommand()
private boolean compileExpression()
private boolean eol(char ch)
private boolean error(int error)
private boolean error(int error, String value)
private boolean error(int error, String value, String more)
private boolean error(String errorMessage)
private float floatValue()
private boolean generateResidueSpecCode(
Token token)
Token[][] getAatokenCompiled()
Hashtable getContextVariables()
private boolean getData(String key)
String getErrorMessage()
static int getHexitValue(char ch)
int[] getLineIndices()
short[] getLineNumbers()
private boolean getNumericalToken()
String getScript()
private
Token getSequenceCode(boolean isSecond)
gets the next token and sets global theToken and theValue
Returns: the next token
String getUnescapedStringLiteral()
private boolean handleError()
private int intPeek()
private boolean isExpressionNext()
boolean isFunction(String name)
private boolean isLineContinuation(int ichT)
private static boolean isSpaceOrTab(char ch)
private boolean isSpecTerminator(int tok)
private boolean isToken(int tok)
BitSet lookingAtBitset()
private boolean lookingAtComment()
private boolean lookingAtDecimal()
private boolean lookingAtEndOfLine()
check for leading #jx or
if you see it, then only strip those 4 characters
if they put in #jx then they are not going to
execute anything, and the regular code will take care of it
private boolean lookingAtEndOfStatement()
private float lookingAtExponential()
private boolean lookingAtInteger()
private boolean lookingAtLeadingWhitespace()
private boolean lookingAtLoadFormat()
private boolean lookingAtLookupToken()
private boolean lookingAtObjectID(boolean allowWildID)
private boolean lookingAtSeqcode()
private boolean lookingAtSpecialString()
private boolean lookingAtString()
static int modelValue(String strDecimal)
private boolean moreTokens()
private boolean returnToken()
private int tokAt(int i)
static boolean tokAttr(int a, int b)
static boolean tokAttrOr(int a, int b1, int b2)
private static boolean tokenAttr(
Token token, int tok)
private
Token tokenNext()
increments the pointer; does NOT set theToken or theValue
Returns: the next token
private boolean tokenNext(int tok)
private int tokPeek()
private boolean tokPeek(int tok)
private Object valuePeek()