org.jmol.script
Class ScriptCompilationTokenParser
java.lang.Object
org.jmol.script.ScriptCompilationTokenParser
- Direct Known Subclasses:
- ScriptCompiler
abstract class ScriptCompilationTokenParser
- extends Object
Method Summary |
private boolean |
addNextToken()
|
private boolean |
addNextTokenIf(int tok)
|
private boolean |
addSubstituteTokenIf(int tok,
Token token)
|
private boolean |
addTokenToPostfix(int tok,
int intValue,
Object value)
|
private boolean |
addTokenToPostfix(int tok,
Object value)
|
private boolean |
addTokenToPostfix(Token token)
|
private boolean |
checkForCoordinate(boolean isImplicitExpression)
|
private boolean |
checkForItemSelector(boolean allowNumeric)
|
private boolean |
clauseAlternateSpec()
|
private boolean |
clauseAnd()
|
private boolean |
clauseAtomSpec()
|
private boolean |
clauseCell()
|
private boolean |
clauseChainSpec(int tok)
|
private boolean |
clauseComparator(boolean isOptional)
|
private boolean |
clauseConnected()
|
private boolean |
clauseDefine(boolean haveToken,
boolean forceString)
|
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()
|
protected boolean |
commandExpected()
|
protected boolean |
compileExpression()
|
protected boolean |
compileExpressions()
|
protected boolean |
error(int error)
|
protected boolean |
error(int error,
String value)
|
protected boolean |
error(int iError,
String value,
String more)
|
protected boolean |
error(String errorMessage,
String strUntranslated)
|
(package private) static String |
errorString(int iError,
String value,
String more,
boolean translated)
|
private float |
floatValue()
|
private boolean |
generateResidueSpecCode(Token token)
|
private boolean |
getNumericalToken()
|
private Token |
getSequenceCode(boolean isSecond)
|
private Token |
getToken()
gets the next token and sets global theToken and theValue |
private int |
intPeek()
|
private boolean |
isError()
|
private boolean |
isExpressionNext()
|
private boolean |
isSpecTerminator(int tok)
|
private boolean |
isToken(int tok)
|
protected boolean |
isUserFunction(String name)
|
private boolean |
moreTokens()
|
private boolean |
returnToken()
|
protected int |
tokAt(int i)
|
protected static boolean |
tokenAttr(Token token,
int tok)
|
private Token |
tokenNext()
increments the pointer; does NOT set theToken or theValue |
private boolean |
tokenNext(int tok)
|
private int |
tokPeek()
|
private boolean |
tokPeek(int tok)
|
private Object |
valuePeek()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
viewer
protected Viewer viewer
script
protected String script
isStateScript
boolean isStateScript
lineCurrent
protected short lineCurrent
iCommand
protected int iCommand
ichCurrentCommand
protected int ichCurrentCommand
ichComment
protected int ichComment
ichEnd
protected int ichEnd
ichToken
protected int ichToken
theToken
protected Token theToken
lastFlowCommand
protected Token lastFlowCommand
tokenCommand
protected Token tokenCommand
lastToken
protected Token lastToken
tokenAndEquals
protected Token tokenAndEquals
theTok
protected int theTok
nTokens
protected int nTokens
tokCommand
protected int tokCommand
ptNewSetModifier
protected int ptNewSetModifier
isNewSet
protected boolean isNewSet
logMessages
protected boolean logMessages
atokenInfix
protected Token[] atokenInfix
itokenInfix
protected int itokenInfix
isSetBrace
protected boolean isSetBrace
isMathExpressionCommand
protected boolean isMathExpressionCommand
isSetOrDefine
protected boolean isSetOrDefine
ltokenPostfix
private List ltokenPostfix
isEmbeddedExpression
protected boolean isEmbeddedExpression
isCommaAsOrAllowed
protected boolean isCommaAsOrAllowed
theValue
private Object theValue
htUserFunctions
protected Map htUserFunctions
haveString
boolean haveString
residueSpecCodeGenerated
private boolean residueSpecCodeGenerated
errorMessage
protected String errorMessage
errorMessageUntranslated
protected String errorMessageUntranslated
errorLine
protected String errorLine
errorType
protected String errorType
ERROR_badArgumentCount
protected static final int ERROR_badArgumentCount
- See Also:
- Constant Field Values
ERROR_badContext
protected static final int ERROR_badContext
- See Also:
- Constant Field Values
ERROR_commandExpected
protected static final int ERROR_commandExpected
- See Also:
- Constant Field Values
ERROR_endOfCommandUnexpected
protected static final int ERROR_endOfCommandUnexpected
- See Also:
- Constant Field Values
ERROR_invalidExpressionToken
protected static final int ERROR_invalidExpressionToken
- See Also:
- Constant Field Values
ERROR_missingEnd
protected static final int ERROR_missingEnd
- See Also:
- Constant Field Values
ERROR_tokenExpected
protected static final int ERROR_tokenExpected
- See Also:
- Constant Field Values
ERROR_tokenUnexpected
protected static final int ERROR_tokenUnexpected
- See Also:
- Constant Field Values
ERROR_unrecognizedParameter
protected static final int ERROR_unrecognizedParameter
- See Also:
- Constant Field Values
ERROR_unrecognizedToken
protected static final int ERROR_unrecognizedToken
- See Also:
- Constant Field Values
ERROR_coordinateExpected
private static final int ERROR_coordinateExpected
- See Also:
- Constant Field Values
ERROR_endOfExpressionExpected
private static final int ERROR_endOfExpressionExpected
- See Also:
- Constant Field Values
ERROR_identifierOrResidueSpecificationExpected
private static final int ERROR_identifierOrResidueSpecificationExpected
- See Also:
- Constant Field Values
ERROR_invalidAtomSpecification
private static final int ERROR_invalidAtomSpecification
- See Also:
- Constant Field Values
ERROR_invalidChainSpecification
private static final int ERROR_invalidChainSpecification
- See Also:
- Constant Field Values
ERROR_invalidModelSpecification
private static final int ERROR_invalidModelSpecification
- See Also:
- Constant Field Values
ERROR_numberExpected
private static final int ERROR_numberExpected
- See Also:
- Constant Field Values
ERROR_numberOrVariableNameExpected
private static final int ERROR_numberOrVariableNameExpected
- See Also:
- Constant Field Values
ERROR_residueSpecificationExpected
private static final int ERROR_residueSpecificationExpected
- See Also:
- Constant Field Values
ERROR_unrecognizedExpressionToken
private static final int ERROR_unrecognizedExpressionToken
- See Also:
- Constant Field Values
ScriptCompilationTokenParser
ScriptCompilationTokenParser()
compileExpressions
protected boolean compileExpressions()
compileExpression
protected boolean compileExpression()
isUserFunction
protected boolean isUserFunction(String name)
isExpressionNext
private boolean isExpressionNext()
tokenAttr
protected static boolean tokenAttr(Token token,
int tok)
moreTokens
private boolean moreTokens()
tokAt
protected int tokAt(int i)
tokPeek
private int tokPeek()
tokPeek
private boolean tokPeek(int tok)
intPeek
private int intPeek()
valuePeek
private Object valuePeek()
tokenNext
private Token tokenNext()
- increments the pointer; does NOT set theToken or theValue
- Returns:
- the next token
tokenNext
private boolean tokenNext(int tok)
returnToken
private boolean returnToken()
getToken
private Token getToken()
- gets the next token and sets global theToken and theValue
- Returns:
- the next token
isToken
private boolean isToken(int tok)
getNumericalToken
private boolean getNumericalToken()
floatValue
private float floatValue()
addTokenToPostfix
private boolean addTokenToPostfix(int tok,
Object value)
addTokenToPostfix
private boolean addTokenToPostfix(int tok,
int intValue,
Object value)
addTokenToPostfix
private boolean addTokenToPostfix(Token token)
addNextToken
private boolean addNextToken()
addNextTokenIf
private boolean addNextTokenIf(int tok)
addSubstituteTokenIf
private boolean addSubstituteTokenIf(int tok,
Token token)
clauseOr
private boolean clauseOr(boolean allowComma)
clauseAnd
private boolean clauseAnd()
clauseNot
private boolean clauseNot()
clausePrimitive
private boolean clausePrimitive()
checkForCoordinate
private boolean checkForCoordinate(boolean isImplicitExpression)
checkForItemSelector
private boolean checkForItemSelector(boolean allowNumeric)
clauseWithin
private boolean clauseWithin()
clauseConnected
private boolean clauseConnected()
clauseSubstructure
private boolean clauseSubstructure()
clauseItemSelector
private boolean clauseItemSelector()
clauseComparator
private boolean clauseComparator(boolean isOptional)
clauseCell
private boolean clauseCell()
clauseDefine
private boolean clauseDefine(boolean haveToken,
boolean forceString)
generateResidueSpecCode
private boolean generateResidueSpecCode(Token token)
clauseResidueSpec
private boolean clauseResidueSpec()
clauseResNameSpec
private boolean clauseResNameSpec()
clauseSequenceSpec
private boolean clauseSequenceSpec()
getSequenceCode
private Token getSequenceCode(boolean isSecond)
clauseChainSpec
private boolean clauseChainSpec(int tok)
isSpecTerminator
private boolean isSpecTerminator(int tok)
clauseAlternateSpec
private boolean clauseAlternateSpec()
clauseModelSpec
private boolean clauseModelSpec()
clauseAtomSpec
private boolean clauseAtomSpec()
errorString
static String errorString(int iError,
String value,
String more,
boolean translated)
commandExpected
protected boolean commandExpected()
error
protected boolean error(int error)
error
protected boolean error(int error,
String value)
error
protected boolean error(int iError,
String value,
String more)
isError
private boolean isError()
error
protected boolean error(String errorMessage,
String strUntranslated)