Package coneforest.psylla
Class Interpreter
- java.lang.Object
-
- java.lang.Thread
-
- coneforest.psylla.Interpreter
-
- All Implemented Interfaces:
PsyContext,PsyConvertableToName,PsyConvertableToString,PsyObject,Runnable
public class Interpreter extends Thread implements PsyContext
An interpreter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Fields inherited from interface coneforest.psylla.core.PsyContext
OPERATORS
-
-
Constructor Summary
Constructors Constructor Description Interpreter()Creates a new Psylla language interpreter.
-
Method Summary
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface coneforest.psylla.core.PsyContext
getId, join, toSyntaxString
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
-
-
-
Method Detail
-
operandStack
public OperandStack operandStack()
Returns the operand stack.- Specified by:
operandStackin interfacePsyContext- Returns:
- the operand stack.
-
operandStackBacked
public OperandStack operandStackBacked(int count) throws PsyException
- Specified by:
operandStackBackedin interfacePsyContext- Throws:
PsyException
-
dictStack
public DictStack dictStack()
Returns the dictionary stack.- Specified by:
dictStackin interfacePsyContext- Returns:
- the dictionary stack.
-
executionStack
public ExecutionStack executionStack()
Returns the execution stack.- Specified by:
executionStackin interfacePsyContext- Returns:
- the execution stack.
-
classLoader
public ClassLoader classLoader()
-
where
public PsyFormalDict where(String name)
-
psyWhere
public PsyFormalDict psyWhere(PsyTextual oKey)
- Specified by:
psyWherein interfacePsyContext
-
load
public <T extends PsyObject> T load(String name) throws PsyException
- Throws:
PsyException
-
psyLoad
public <T extends PsyObject> T psyLoad(PsyTextual oKey) throws PsyException
- Specified by:
psyLoadin interfacePsyContext- Throws:
PsyException
-
handleExecutionStack
public void handleExecutionStack()
- Specified by:
handleExecutionStackin interfacePsyContext
-
handleExecutionStack
public void handleExecutionStack(int level)
- Specified by:
handleExecutionStackin interfacePsyContext
-
currentDict
public PsyFormalDict currentDict()
Returns the current dictionary.- Specified by:
currentDictin interfacePsyContext- Returns:
- the current dictionary.
-
systemDict
public PsyFormalDict systemDict()
Returns system dictionary.- Specified by:
systemDictin interfacePsyContext- Returns:
- the system dictionary.
-
userDict
public PsyFormalDict userDict()
Returns the user dictionary.- Returns:
- the user dictionary.
-
namespacePool
public NamespacePool namespacePool()
- Specified by:
namespacePoolin interfacePsyContext
-
currentNamespace
public PsyNamespace currentNamespace()
Returns the current namespace.- Returns:
- the current namespace.
-
setReader
public void setReader(Reader reader)
-
setWriter
public void setWriter(Writer writer)
-
setErrorWriter
public void setErrorWriter(Writer writer)
-
setRandomSeed
public void setRandomSeed(Long randomSeed) throws PsyException
- Throws:
PsyException
-
setClassPath
public void setClassPath(String[] classPath) throws PsyException
- Throws:
PsyException
-
setLibraryPath
public void setLibraryPath(String[] libraryPath) throws PsyException
- Throws:
PsyException
-
interpret
public void interpret(Reader reader)
-
interpret
public void interpret(String string)
-
interpret
public void interpret(PsyReader oReader)
- Specified by:
interpretin interfacePsyContext
-
interpretBraced
public void interpretBraced(PsyReader oReader) throws PsyException
- Specified by:
interpretBracedin interfacePsyContext- Throws:
PsyException
-
errorDict
public PsyFormalDict errorDict() throws PsyException
- Throws:
PsyException
-
handleError
public void handleError(PsyException oException)
- Specified by:
handleErrorin interfacePsyContext
-
showStacks
public void showStacks()
-
execLevel
public int execLevel()
- Specified by:
execLevelin interfacePsyContext
-
getStopFlag
public boolean getStopFlag()
- Specified by:
getStopFlagin interfacePsyContext
-
setStopFlag
public void setStopFlag(boolean stopFlag)
- Specified by:
setStopFlagin interfacePsyContext
-
pushLoopLevel
public int pushLoopLevel()
- Specified by:
pushLoopLevelin interfacePsyContext
-
popLoopLevel
public int popLoopLevel()
- Specified by:
popLoopLevelin interfacePsyContext
-
currentLoopLevel
public int currentLoopLevel()
- Specified by:
currentLoopLevelin interfacePsyContext
-
pushStopLevel
public int pushStopLevel()
- Specified by:
pushStopLevelin interfacePsyContext
-
popStopLevel
public int popStopLevel()
- Specified by:
popStopLevelin interfacePsyContext
-
currentStopLevel
public int currentStopLevel()
- Specified by:
currentStopLevelin interfacePsyContext
-
setScriptName
public void setScriptName(String scriptName)
-
setShellArguments
public void setShellArguments(String[] args) throws PsyException
- Throws:
PsyException
-
quit
public void quit()
- Specified by:
quitin interfacePsyContext
-
repl
public void repl() throws PsyException- Specified by:
replin interfacePsyContext- Throws:
PsyException
-
banner
public String banner()
-
prompt
public String prompt()
-
stop_
public void stop_()
- Specified by:
stop_in interfacePsyContext
-
loadLibraryResource
public boolean loadLibraryResource(String resourceName) throws PsyException
- Throws:
PsyException
-
loadType
public boolean loadType(String typeName) throws PsyException
- Throws:
PsyException
-
psyRequire
public void psyRequire(PsyTextual oResourceName) throws PsyException
- Specified by:
psyRequirein interfacePsyContext- Throws:
PsyException
-
-