Package coneforest.psylla
Class Interpreter
java.lang.Object
java.lang.Thread
coneforest.psylla.Interpreter
- All Implemented Interfaces:
PsyContext
,PsyConvertableToName
,PsyConvertableToString
,PsyObject
,Runnable
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 -
Method Summary
Modifier and TypeMethodDescriptionbanner()
Returns the current dictionary.int
Returns the current namespace.int
Returns the dictionary stack.int
Returns the execution stack.void
fork()
boolean
void
void
handleExecutionStack
(int level) void
void
void
void
interpretBraced
(PsyReader oReader) <T extends PsyObject>
Tboolean
loadLibraryResource
(String resourceName) boolean
Returns the operand stack.operandStackBacked
(int count) int
int
prompt()
<T extends PsyObject>
TpsyLoad
(PsyTextual oKey) void
psyRequire
(PsyTextual oResourceName) psyWhere
(PsyTextual oKey) int
int
void
quit()
void
repl()
void
setClassPath
(String[] classPath) void
setEnvironment
(Map<String, String> env) void
setErrorWriter
(Writer writer) void
setLibraryPath
(String[] libraryPath) void
setRandomSeed
(Long randomSeed) void
void
setScriptName
(String scriptName) void
setShellArguments
(String[] args) void
setStopFlag
(boolean stopFlag) void
void
void
stop_()
Returns system dictionary.userDict()
Returns the user dictionary.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
-
Constructor Details
-
Interpreter
public Interpreter()Creates a new Psylla language interpreter.
-
-
Method Details
-
fork
- Specified by:
fork
in interfacePsyContext
- Throws:
PsyErrorException
-
operandStack
Returns the operand stack.- Specified by:
operandStack
in interfacePsyContext
- Returns:
- the operand stack.
-
operandStackBacked
- Specified by:
operandStackBacked
in interfacePsyContext
- Throws:
PsyErrorException
-
dictStack
Returns the dictionary stack.- Specified by:
dictStack
in interfacePsyContext
- Returns:
- the dictionary stack.
-
executionStack
Returns the execution stack.- Specified by:
executionStack
in interfacePsyContext
- Returns:
- the execution stack.
-
classLoader
-
where
-
psyWhere
- Specified by:
psyWhere
in interfacePsyContext
-
load
- Throws:
PsyErrorException
-
psyLoad
- Specified by:
psyLoad
in interfacePsyContext
- Throws:
PsyErrorException
-
handleExecutionStack
public void handleExecutionStack()- Specified by:
handleExecutionStack
in interfacePsyContext
-
handleExecutionStack
public void handleExecutionStack(int level) - Specified by:
handleExecutionStack
in interfacePsyContext
-
currentDict
Returns the current dictionary.- Specified by:
currentDict
in interfacePsyContext
- Returns:
- the current dictionary.
-
systemDict
Returns system dictionary.- Specified by:
systemDict
in interfacePsyContext
- Returns:
- the system dictionary.
-
userDict
Returns the user dictionary.- Returns:
- the user dictionary.
-
namespacePool
- Specified by:
namespacePool
in interfacePsyContext
-
currentNamespace
Returns the current namespace.- Returns:
- the current namespace.
-
setReader
-
setWriter
-
setErrorWriter
-
setRandomSeed
- Throws:
PsyErrorException
-
setClassPath
- Throws:
PsyErrorException
-
setLibraryPath
- Throws:
PsyErrorException
-
interpret
-
interpret
-
interpret
- Specified by:
interpret
in interfacePsyContext
-
interpretBraced
- Specified by:
interpretBraced
in interfacePsyContext
- Throws:
PsyErrorException
-
errorDict
- Throws:
PsyErrorException
-
showStacks
public void showStacks() -
execLevel
public int execLevel()- Specified by:
execLevel
in interfacePsyContext
-
getStopFlag
public boolean getStopFlag()- Specified by:
getStopFlag
in interfacePsyContext
-
setStopFlag
public void setStopFlag(boolean stopFlag) - Specified by:
setStopFlag
in interfacePsyContext
-
pushLoopLevel
public int pushLoopLevel()- Specified by:
pushLoopLevel
in interfacePsyContext
-
popLoopLevel
public int popLoopLevel()- Specified by:
popLoopLevel
in interfacePsyContext
-
currentLoopLevel
public int currentLoopLevel()- Specified by:
currentLoopLevel
in interfacePsyContext
-
pushStopLevel
public int pushStopLevel()- Specified by:
pushStopLevel
in interfacePsyContext
-
popStopLevel
public int popStopLevel()- Specified by:
popStopLevel
in interfacePsyContext
-
currentStopLevel
public int currentStopLevel()- Specified by:
currentStopLevel
in interfacePsyContext
-
setScriptName
-
setShellArguments
- Throws:
PsyErrorException
-
setEnvironment
-
quit
public void quit()- Specified by:
quit
in interfacePsyContext
-
repl
- Specified by:
repl
in interfacePsyContext
- Throws:
PsyErrorException
-
banner
-
prompt
-
stop_
public void stop_()- Specified by:
stop_
in interfacePsyContext
-
loadLibraryResource
- Throws:
PsyErrorException
-
loadType
- Throws:
PsyErrorException
-
psyRequire
- Specified by:
psyRequire
in interfacePsyContext
- Throws:
PsyErrorException
-