REPLBase

trait REPLBase[C <: REPLConfig]

General support for applications that implement read-eval-print loops (REPLs).

General support for applications that implement read-eval-print loops (REPLs).

class Object
trait Matchable
class Any
trait ParsingREPLBase[T, C]
trait ParsingREPL[T]
trait REPL

Value members

Abstract methods

def createConfig(args: Seq[String]): C

Create the configuration for a particular run of the REPL.

Create the configuration for a particular run of the REPL.

def processline(source: Source, console: Console, config: C): Option[C]

Process user input from the given source. The return value allows the processing to optionally return a new configuration that will be used in subsequent processing. A return value of None indicates that no more lines from the current console should be processed.

Process user input from the given source. The return value allows the processing to optionally return a new configuration that will be used in subsequent processing. A return value of None indicates that no more lines from the current console should be processed.

Concrete methods

def createAndInitConfig(args: Seq[String]): Either[String, C]

Create and initialise the configuration for a particular run of the REPL. Default: call createConfig and then initialise the resulting configuration. Returns either the created configuration or an error message describing why the configuration couldn't be created.

Create and initialise the configuration for a particular run of the REPL. Default: call createConfig and then initialise the resulting configuration. Returns either the created configuration or an error message describing why the configuration couldn't be created.

def driver(args: Seq[String]): Unit

Driver for this REPL. First, use the argument list to create a configuration for this execution. If the arguments parse ok, then print the REPL banner. Read lines from the console and pass non-null ones to processline. If ignoreWhitespaceLines is true, do not pass lines that contain just whitespace, otherwise do. Continue until processline returns false. Call prompt each time input is about to be read.

Driver for this REPL. First, use the argument list to create a configuration for this execution. If the arguments parse ok, then print the REPL banner. Read lines from the console and pass non-null ones to processline. If ignoreWhitespaceLines is true, do not pass lines that contain just whitespace, otherwise do. Continue until processline returns false. Call prompt each time input is about to be read.

def main(args: Array[String]): Unit

The entry point for this REPL.

The entry point for this REPL.

@tailrec
final def processconsole(console: Console, prompt: String, config: C): C

Process interactively entered lines, one by one, until end of file.

Process interactively entered lines, one by one, until end of file.

def processfile(filename: String, config: C): C

Process a file argument by passing its contents line-by-line to processline.

Process a file argument by passing its contents line-by-line to processline.

final def processfiles(config: C): C

Process the files one by one, allowing config to be updated each time and updated config to be used by the next file.

Process the files one by one, allowing config to be updated each time and updated config to be used by the next file.

def processlines(config: C): Unit

Process interactively entered lines, one by one, until end of file. Prompt with the given prompt.

Process interactively entered lines, one by one, until end of file. Prompt with the given prompt.

def prompt: String

Define the prompt (default: "> ").

Define the prompt (default: "> ").

Concrete fields

val messaging: Messaging

The messaging facilitiy used by this REPL.

The messaging facilitiy used by this REPL.

val positions: Positions

The position store used by this REPL.

The position store used by this REPL.