abstract class ScriptExpr extends ScriptParam
Modifier and Type | Field and Description |
---|---|
private CmdExt |
cmdExt |
boolean |
debugHigh |
private IsoExt |
isoExt |
private MathExt |
mathExt |
private javajs.util.P3 |
ptTemp |
private SmilesExt |
smilesExt |
protected T[] |
tempStatement |
contextVariables, coordinatesAreFractional, fractionalPoint, isBondSet, iToken, slen, st, theTok, theToken, thisContext
chk, error, ERROR_axisExpected, ERROR_backgroundModelError, ERROR_badArgumentCount, ERROR_badMillerIndices, ERROR_badRGBColor, ERROR_booleanExpected, ERROR_booleanOrNumberExpected, ERROR_booleanOrWhateverExpected, ERROR_cannotSet, ERROR_colorExpected, ERROR_colorOrPaletteRequired, ERROR_commandExpected, ERROR_coordinateOrNameOrExpressionRequired, ERROR_drawObjectNotDefined, ERROR_endOfStatementUnexpected, ERROR_expressionExpected, ERROR_expressionOrIntegerExpected, ERROR_filenameExpected, ERROR_fileNotFoundException, ERROR_incompatibleArguments, ERROR_insufficientArguments, ERROR_integerExpected, ERROR_integerOutOfRange, ERROR_invalidArgument, ERROR_invalidParameterOrder, ERROR_keywordExpected, ERROR_moCoefficients, ERROR_moIndex, ERROR_moModelError, ERROR_moOccupancy, ERROR_moOnlyOne, ERROR_multipleModelsDisplayedNotOK, ERROR_multipleModelsNotOK, ERROR_noData, ERROR_noPartialCharges, ERROR_noUnitCell, ERROR_numberExpected, ERROR_numberMustBe, ERROR_numberOutOfRange, ERROR_objectNameExpected, ERROR_planeExpected, ERROR_propertyNameExpected, ERROR_spaceGroupNotFound, ERROR_stringExpected, ERROR_stringOrIdentifierExpected, ERROR_tooManyPoints, ERROR_tooManyScriptLevels, ERROR_unrecognizedAtomProperty, ERROR_unrecognizedBondProperty, ERROR_unrecognizedCommand, ERROR_unrecognizedExpression, ERROR_unrecognizedObject, ERROR_unrecognizedParameter, ERROR_unrecognizedParameterWarning, ERROR_unrecognizedShowParameter, ERROR_what, ERROR_writeWhat, errorMessage, errorMessageUntranslated, errorType, iCommandError, ignoreError, vwr
Constructor and Description |
---|
ScriptExpr() |
Modifier and Type | Method and Description |
---|---|
BS |
atomExpression(T[] code,
int pcStart,
int pcStop,
boolean allowRefresh,
boolean allowUnderflow,
java.lang.Object[] ret,
boolean andNotDeleted) |
BS |
atomExpressionAt(int index) |
private BS |
bitSetForModelFileNumber(int m) |
protected boolean |
compareFloat(int tokOperator,
float a,
float b) |
protected BS |
compareFloatData(int tokWhat,
float[] data,
int tokOperator,
float comparisonFloat) |
private BS |
compareInt(int tokWhat,
int tokOperator,
int ival) |
private BS |
compareString(int tokWhat,
int tokOperator,
java.lang.String comparisonString) |
private boolean |
compareStringValues(int tokOperator,
java.lang.String propertyValue,
java.lang.String comparisonValue) |
protected java.util.Map<java.lang.String,java.lang.Object> |
getAssocArray(int i) |
protected BS |
getAtomBits(int tokType,
java.lang.Object specInfo) |
java.lang.Object |
getBitsetProperty(BS bs,
int tok,
javajs.util.P3 ptRef,
javajs.util.P4 planeRef,
java.lang.Object tokenValue,
java.lang.Object opValue,
boolean useAtomMap,
int index,
boolean asVectorIfAll) |
private SV |
getBitsetPropertySelector(int i,
int xTok) |
CmdExt |
getCmdExt() |
private BS |
getComparison(T t,
int tokWhat,
int tokOp,
java.lang.String strOp,
float[] data) |
private java.lang.Object |
getExt(java.lang.String type) |
IsoExt |
getIsoExt() |
MathExt |
getMathExt() |
protected static int |
getSeqCode(T instruction) |
SmilesExt |
getSmilesExt() |
private java.lang.Object |
getStringObjectAsVariable(java.lang.Object obj) |
protected javajs.util.Lst<SV> |
listBS(BS bs) |
protected boolean |
noCopy(int i,
int dir) |
private java.lang.Object |
parameterExpression(int pt,
int ptMax,
java.lang.String key,
boolean ignoreComma,
boolean asVector,
int ptAtom,
boolean isArrayItem,
java.util.Map<java.lang.String,SV> localVars,
java.lang.String localVar,
boolean isSpecialAssignment)
This is the primary driver of the RPN (reverse Polish notation) expression
processor.
|
protected boolean |
parameterExpressionBoolean(int pt,
int ptMax) |
protected javajs.util.Lst<SV> |
parameterExpressionList(int pt,
int ptAtom,
boolean isArrayItem) |
protected boolean |
parameterExpressionSelect(java.util.Map<java.lang.String,SV> h,
T[] where) |
protected java.lang.String |
parameterExpressionString(int pt,
int ptMax) |
protected SV |
parameterExpressionToken(int pt) |
private void |
setBitsetProperty(BS bs,
int tok,
int iValue,
float fValue,
T tokenValue) |
protected boolean |
setStatement(T[] st0,
int pt0)
provides support for @x and @{....} in statements.
|
protected SV |
setVariable(int pt,
int ptMax,
java.lang.String key,
boolean isSet) |
atomCenterOrCoordinateParameter, centerParameter, centerParameterForModel, checkLast, checkLength, checkLength23, checkLength34, checkLengthErrorPt, checkToken, floatParameter, floatParameterRange, floatParameterSet, getArgbParam, getArgbParamLast, getArgbParamOrNone, getBondOrderFromString, getContextVariableAsVariable, getFloatEncodedInt, getHklPlane, getMadParameter, getParameter, getPartialBondOrderFromFloatEncodedInt, getPoint3f, getPoint4f, getPointArray, getPointOrPlane, getPointVector, getQuaternionParameter, getToken, getVarParameter, hklParameter, intParameter, intParameterRange, isArrayParameter, isCenterParameter, isColorParam, isFloatParameter, isPoint3f, listParameter, modelNumberParameter, objectNameParameter, optParameterAsString, paramAsStr, planeParameter, setBooleanProperty, setFloatProperty, setIntProperty, setStringProperty, stringParameter, stringParameterSet, tickParamAsStr, tokAt, xypParameter, xyzpParameter
bad, error, errorMore, errorStr, errorStr2, errorString, evalError, getErrorLineMessage, getErrorMessage, getErrorMessageUntranslated, integerOutOfRange, invArg, numberOutOfRange, setCursorWait, setErrorMessage, showStringPrint, warning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkScriptSilent, checkSelect, compileScriptFile, compileScriptString, deleteAtomsInVariables, evalFunctionFloat, evalParallel, evaluateCompiledScript, evaluateExpression, getAllowJSThreads, getAtomBitSet, getNextStatement, getScript, getScriptContext, getThisContext, haltExecution, isExecuting, isPaused, isStateScript, isStepping, isStopped, loadFileResourceAsync, notifyResumeStatus, pauseExecution, pushContextDown, resumeEval, resumePausedExecution, runScript, runScriptBuffer, setCompiler, setDebugging, setObjectPropSafe, setStatic, setViewer, stepPausedExecution, stopScriptThreads
public boolean debugHigh
private CmdExt cmdExt
private IsoExt isoExt
private MathExt mathExt
private SmilesExt smilesExt
protected T[] tempStatement
private javajs.util.P3 ptTemp
public CmdExt getCmdExt()
public IsoExt getIsoExt()
public MathExt getMathExt()
public SmilesExt getSmilesExt()
private java.lang.Object getExt(java.lang.String type)
protected javajs.util.Lst<SV> parameterExpressionList(int pt, int ptAtom, boolean isArrayItem) throws ScriptException
ScriptException
protected java.lang.String parameterExpressionString(int pt, int ptMax) throws ScriptException
ScriptException
protected boolean parameterExpressionBoolean(int pt, int ptMax) throws ScriptException
ScriptException
protected SV parameterExpressionToken(int pt) throws ScriptException
ScriptException
protected boolean parameterExpressionSelect(java.util.Map<java.lang.String,SV> h, T[] where) throws ScriptException
ScriptException
private java.lang.Object parameterExpression(int pt, int ptMax, java.lang.String key, boolean ignoreComma, boolean asVector, int ptAtom, boolean isArrayItem, java.util.Map<java.lang.String,SV> localVars, java.lang.String localVar, boolean isSpecialAssignment) throws ScriptException
pt
- token index in statement start of expression or negative for one
expression only.ptMax
- token index in statement end of expressionkey
- variable name for debugging reference only -- null indicates return
Boolean -- "" indicates return StringignoreComma
- asVector
- a flag passed on to RPN;ptAtom
- this is a for() or select() function with a specific atom selectedisArrayItem
- we are storing A[x] = ... so we need to deliver "x" as welllocalVars
- see below -- lists all nested for(x, {exp}, select(y, {ex},...))
variableslocalVar
- x or y in above for(), select() examplesisSpecialAssignment
- x[n] = ....ScriptException
- errors are thrown directly to the Eval error system.public BS atomExpressionAt(int index) throws ScriptException
ScriptException
public BS atomExpression(T[] code, int pcStart, int pcStop, boolean allowRefresh, boolean allowUnderflow, java.lang.Object[] ret, boolean andNotDeleted) throws ScriptException
code
- pcStart
- pcStop
- allowRefresh
- allowUnderflow
- ret
- -- true return value; may not be a BSandNotDeleted
- IGNOREDScriptException
private BS getComparison(T t, int tokWhat, int tokOp, java.lang.String strOp, float[] data) throws ScriptException
ScriptException
protected boolean noCopy(int i, int dir)
protected java.util.Map<java.lang.String,java.lang.Object> getAssocArray(int i) throws ScriptException
ScriptException
protected BS compareFloatData(int tokWhat, float[] data, int tokOperator, float comparisonFloat)
tokWhat
- data
- tokOperator
- comparisonFloat
- protected boolean compareFloat(int tokOperator, float a, float b)
private BS compareString(int tokWhat, int tokOperator, java.lang.String comparisonString) throws ScriptException
ScriptException
private boolean compareStringValues(int tokOperator, java.lang.String propertyValue, java.lang.String comparisonValue) throws ScriptException
ScriptException
private BS compareInt(int tokWhat, int tokOperator, int ival)
private SV getBitsetPropertySelector(int i, int xTok) throws ScriptException
ScriptException
public java.lang.Object getBitsetProperty(BS bs, int tok, javajs.util.P3 ptRef, javajs.util.P4 planeRef, java.lang.Object tokenValue, java.lang.Object opValue, boolean useAtomMap, int index, boolean asVectorIfAll) throws ScriptException
ScriptException
private BS bitSetForModelFileNumber(int m)
private java.lang.Object getStringObjectAsVariable(java.lang.Object obj)
protected BS getAtomBits(int tokType, java.lang.Object specInfo)
protected static int getSeqCode(T instruction)
protected SV setVariable(int pt, int ptMax, java.lang.String key, boolean isSet) throws ScriptException
pt
- starting point in command token sequenceptMax
- ending point in command token sequenec, possibly -1 for "all"key
- the variable name to save the result in. This must be a standard
user variable, either local or globalisSet
- from Set ... or Var .... or just xxx ....ScriptException
private void setBitsetProperty(BS bs, int tok, int iValue, float fValue, T tokenValue) throws ScriptException
ScriptException
protected boolean setStatement(T[] st0, int pt0) throws ScriptException
st0
- aaToken[i]pt0
- ScriptException