class ILoop extends LoopCommands
The Scala interactive shell. It provides a read-eval-print loop around the Interpreter class. After instantiation, clients should call the main() method.
If no in0 is specified, then input will come from the console, and the class will attempt to provide input editing feature such as input history.
- Version
1.2
- Alphabetic
- By Inheritance
- ILoop
- LoopCommands
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ILoop()
- new ILoop(in0: BufferedReader, out: JPrintWriter)
- new ILoop(in0: Option[BufferedReader], out: JPrintWriter)
Type Members
- class ILoopInterpreter extends IMain
- class ReplCompletion extends Completion
-
class
LineCmd extends (LoopCommands.this)#LoopCommand
- Definition Classes
- LoopCommands
-
abstract
class
LoopCommand extends (String) ⇒ (LoopCommands.this)#Result
- Definition Classes
- LoopCommands
-
class
NullaryCmd extends (LoopCommands.this)#LoopCommand
- Definition Classes
- LoopCommands
-
case class
Result(keepRunning: Boolean, lineToRecord: Option[String]) extends Product with Serializable
- Definition Classes
- LoopCommands
-
class
VarArgsCmd extends (LoopCommands.this)#LoopCommand
- Definition Classes
- LoopCommands
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addReplay(cmd: String): Unit
Record a command for replay should the user request a :replay
-
def
ambiguousError(cmd: String): Result
- Definition Classes
- LoopCommands
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asyncEcho(async: Boolean, msg: ⇒ String): Unit
-
def
asyncMessage(msg: String): Unit
- Attributes
- protected
-
def
chooseReader(settings: Settings): InteractiveReader
Tries to create a jline.InteractiveReader, falling back to SimpleReader, unless settings or properties are such that it should start with SimpleReader.
Tries to create a jline.InteractiveReader, falling back to SimpleReader, unless settings or properties are such that it should start with SimpleReader. The constructor of the InteractiveReader must take a Completion strategy, supplied as a
() => Completion
; the Completion object provides a concrete Completer. -
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
closeInterpreter(): Unit
Close the interpreter and set the var to null.
-
def
colonCommand(line: String): Result
- Definition Classes
- LoopCommands
-
def
colonCompletion(line: String, cursor: Int): Completion
- Definition Classes
- LoopCommands
-
def
command(line: String): Result
Run one command submitted by the user.
Run one command submitted by the user. Two values are returned: (1) whether to keep running, (2) the line to record for replay, if any.
-
def
commands: List[LoopCommand]
Available commands
Available commands
- Definition Classes
- ILoop → LoopCommands
- def completionsCommand(what: String): Result
-
def
createInterpreter(): Unit
Create a new interpreter.
-
def
echo(msg: String): Unit
- Attributes
- protected
-
def
echoAndRefresh(msg: String): Unit
- Attributes
- protected
-
def
echoCommandMessage(msg: String): Unit
- Definition Classes
- ILoop → LoopCommands
- def editCommand(what: String, editor: Option[String]): Result
- def editCommand(what: String): Result
- def enablePowerMode(isDuringInit: Boolean): Unit
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val fileCompletion: Completion
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
helpCommand(line: String): Result
print a friendly help message
print a friendly help message
- Definition Classes
- LoopCommands
-
def
helpSummary(): Unit
- Definition Classes
- LoopCommands
- def history: History
-
lazy val
historyCommand: LoopCommand { def defaultLines: Int }
Show the history
- var in: InteractiveReader
-
def
interpretAllFrom(file: File, verbose: Boolean = false): Unit
interpret all lines from a specified file
-
final
def
interpretStartingWith(code: String): Option[String]
Interpret expressions starting with the first line.
Interpret expressions starting with the first line. Read lines until a complete compilation unit is available or until a syntax error has been seen. If a full unit is read, go ahead and interpret it. Return the full string to be recorded for replay, if any.
- var intp: IMain
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSbt: Boolean
- Attributes
- protected
- def lineCommand(what: String): Result
- def loadCommand(arg: String): Result
-
final
def
loop(line: String): LineResult
- Annotations
- @tailrec()
-
final
def
loop(): LineResult
The main read-eval-print loop for the repl.
The main read-eval-print loop for the repl. It calls command() for each line of input, and stops when command() returns false.
-
var
mum: Boolean
- Attributes
- protected
- def mumly[A](op: ⇒ A): A
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newJavap(): JavapClass
- Attributes
- protected
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
out: JPrintWriter
- Attributes
- protected
- Definition Classes
- ILoop → LoopCommands
- def pasteCommand(arg: String): Result
- lazy val power: Power[StdReplVals]
- def powerCmd(): Result
-
lazy val
powerCommands: List[LoopCommand]
Power user commands
-
def
printWelcome(): Unit
Print a welcome message!
-
def
process(settings: Settings): Boolean
Start an interpreter with the given settings.
Start an interpreter with the given settings.
- returns
true if successful
- def processLine(line: String): Boolean
-
def
prompt: String
Prompt to print when awaiting input
-
def
replay(): Unit
Announces as it replays.
-
def
replayCommand(line: String): Unit
create a new interpreter and replay the given commands
-
var
replayCommandStack: List[String]
A reverse list of commands to replay if the user requests a :replay
-
def
replayCommands: collection.immutable.List[String]
A list of commands to replay if the user requests a :replay
- val replayQuestionMessage: String
-
def
require(arg: String): Unit
Adds jar file to the current classpath.
Adds jar file to the current classpath. Jar will only be added if it does not contain classes that already exist on the current classpath.
Importantly,
require
adds jars to the classpath without resetting the state of the interpreter. This is in contrast toreplay
which can be used to add jars to the classpath and which creates a new instance of the interpreter and replays all interpreter expressions. -
def
reset(): Unit
Resets without announcements.
-
def
resetCommand(line: String): Unit
reset
the interpreter in an attempt to start fresh.reset
the interpreter in an attempt to start fresh. Supplying settings creates a new compiler. - def saveCommand(filename: String): Result
- def savingReader[T](body: ⇒ T): T
- def savingReplayStack[T](body: ⇒ T): T
-
def
searchHistory(_cmdline: String): Unit
Search the history
- var settings: Settings
- val settingsCompletion: Completion
-
lazy val
shCommand: LoopCommand
fork a shell and run a command
-
lazy val
standardCommands: collection.immutable.List[LoopCommand]
Standard commands *
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def verbosity(): Unit
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def withFile[A](filename: String)(action: (File) ⇒ A): Option[A]
- object LineResults extends Enumeration
-
object
LoopCommand
- Definition Classes
- LoopCommands
-
object
Result extends Serializable
- Definition Classes
- LoopCommands
Deprecated Value Members
-
def
addClasspath(arg: String): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) use reset, replay or require to update class path
-
var
addedClasspath: String
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) use reset, replay or require to update class path
-
def
interpreter: IMain
- Annotations
- @deprecated
- Deprecated
(Since version 2.9.0) use
intp
instead.
-
def
interpreter_=(i: Interpreter): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 2.9.0) use
intp
instead.