# Class ScriptCompiler

java.lang.Object
org.jmol.script.ScriptCompiler

public class ScriptCompiler extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`protected T[]`
`atokenInfix`
`protected static final int`
`ERROR_badArgumentCount`
`protected static final int`
`ERROR_badContext`
`protected static final int`
`ERROR_commandExpected`
`protected static final int`
`ERROR_endOfCommandUnexpected`
`protected static final int`
`ERROR_invalidExpressionToken`
`protected static final int`
`ERROR_missingEnd`
`protected static final int`
`ERROR_tokenExpected`
`protected static final int`
`ERROR_tokenUnexpected`
`protected static final int`
`ERROR_unrecognizedParameter`
`protected static final int`
`ERROR_unrecognizedToken`
`protected String`
`errorLine`
`protected String`
`errorMessage`
`protected String`
`errorMessageUntranslated`
`protected String`
`errorType`
`protected boolean`
`haveMacro`
`protected Map<String,Boolean>`
`htUserFunctions`
`protected int`
`ichComment`
`protected int`
`ichCurrentCommand`
`protected int`
`ichEnd`
`protected int`
`ichToken`
`protected int`
`iCommand`
`protected boolean`
`isCommaAsOrAllowed`
`protected boolean`
`isEmbeddedExpression`
`protected boolean`
`isMathExpressionCommand`
`protected boolean`
`isNewSet`
`protected boolean`
`isSetBrace`
`protected boolean`
`isSetOrDefine`
`protected boolean`
`isStateScript`
`protected int`
`itokenInfix`
`protected T`
`lastFlowCommand`
`protected T`
`lastToken`
`protected short`
`lineCurrent`
`protected boolean`
`logMessages`
`protected int`
`nTokens`
`protected int`
`ptNewSetModifier`
`protected String`
`script`
`protected int`
`theTok`
`protected T`
`theToken`
`protected int`
`tokCommand`
`protected T`
`tokenAndEquals`
`protected T`
`tokenCommand`
`protected Viewer`
`vwr`

## Constructor Summary

Constructors
Constructor
Description
`ScriptCompiler(Viewer vwr)`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`commandExpected()`
`protected boolean`
`compileExpression()`
`protected boolean`
`compileExpressions()`
`protected boolean`
`error(int error)`
`protected boolean`
`errorIntStr2(int iError, String value, String more)`
`protected boolean`
`errorStr(int error, String value)`
`protected boolean`
`errorStr2(String errorMessage, String strUntranslated)`
`protected boolean`
`isUserFunction(String name)`
`protected int`
`tokAt(int i)`
`protected static boolean`
`tokenAttr(T token, int tok)`
`static String`
`unescapeString(String script, int ich, int nChar)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### vwr

protected Viewer vwr

### htUserFunctions

protected Map<String,Boolean> htUserFunctions

### script

protected String script

### isStateScript

protected 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 T theToken

### lastFlowCommand

protected T lastFlowCommand

### tokenCommand

protected T tokenCommand

### lastToken

protected T lastToken

### tokenAndEquals

protected T tokenAndEquals

### theTok

protected int theTok

### nTokens

protected int nTokens

### tokCommand

protected int tokCommand

### ptNewSetModifier

protected int ptNewSetModifier

### isNewSet

protected boolean isNewSet

### haveMacro

protected boolean haveMacro

### logMessages

protected boolean logMessages

### atokenInfix

protected T[] atokenInfix

### itokenInfix

protected int itokenInfix

### isSetBrace

protected boolean isSetBrace

### isMathExpressionCommand

protected boolean isMathExpressionCommand

### isSetOrDefine

protected boolean isSetOrDefine

### isEmbeddedExpression

protected boolean isEmbeddedExpression

### isCommaAsOrAllowed

protected boolean isCommaAsOrAllowed

### 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

## Constructor Details

### ScriptCompiler

public ScriptCompiler(Viewer vwr)

Parameters:
  `vwr` -

## Method Details

### tokAt

protected int tokAt(int i)

### unescapeString

public static String unescapeString(String script, int ich, int nChar)

### compileExpressions

protected boolean compileExpressions()

### compileExpression

protected boolean compileExpression()

### isUserFunction

protected boolean isUserFunction(String name)

### tokenAttr

protected static boolean tokenAttr(T token, int tok)

### commandExpected

protected boolean commandExpected()

### error

protected boolean error(int error)

### errorStr

protected boolean errorStr(int error, String value)

### errorIntStr2

protected boolean errorIntStr2(int iError, String value, String more)

### errorStr2

protected boolean errorStr2(String errorMessage, String strUntranslated)