Package net.hydromatic.morel
Class Main.Shell
java.lang.Object
net.hydromatic.morel.Main.Shell
- All Implemented Interfaces:
Session.Shell
- Direct Known Subclasses:
Main.SubShell
- Enclosing class:
Main
Shell (or sub-shell created via
net.hydromatic.morel.compile.BuiltIn#INTERACT_USE) that can execute
commands and handle errors.-
Field Summary
FieldsModifier and TypeFieldDescriptionContains the environment created by previous commands in this shell.protected final Environmentprotected final Main -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearEnv()Clears the environment.voidhandle(RuntimeException e, StringBuilder buf) Handles an exception.(package private) voidrun(Session session, Main.BufferingReader in2, Consumer<String> echoLines, Consumer<String> outLines) void
-
Field Details
-
main
-
env0
-
echoLines
-
outLines
-
bindingMap
Contains the environment created by previous commands in this shell. It is a multimap so that overloads with the same name can all be stored.
-
-
Constructor Details
-
Shell
-
-
Method Details
-
run
-
use
- Specified by:
usein interfaceSession.Shell
-
handle
Description copied from interface:Session.ShellHandles an exception. Particular implementations may re-throw the exception, or may format the exception to a buffer that will be added to the output. Typically, a root shell will handle the exception, and sub-shells will re-throw.- Specified by:
handlein interfaceSession.Shell
-
clearEnv
public void clearEnv()Description copied from interface:Session.ShellClears the environment. Default implementation does nothing.- Specified by:
clearEnvin interfaceSession.Shell
-