function CompleterEngine( repl, completer, ostream, ttyWrite ) {
	if ( !( this instanceof CompleterEngine ) ) {
		return new CompleterEngine( repl, completer, ostream, ttyWrite );
	}
	debug( 'Creating a completer engine...' );

	// Cache a reference to the provided REPL instance:
	this._repl = repl;

	// Cache a reference to the readline interface:
	this._rli = repl._rli;

	// Cache a reference to the output writable stream:
	this._ostream = ostream;

	// Cache a reference to the provided completer;
	this._completer = completer;

	// Cache a reference to the private readline interface `ttyWrite` to allow calling the method when wanting default behavior:
	this._ttyWrite = ttyWrite;

	// Cache a reference to the REPL's multi-line handler:
	this._multiline = repl._multilineHandler;

	// Initialize a flag indicating whether a user is navigating TAB completions:
	this._isNavigating = false;

	// Create a callback for processing completions:
	this._onCompletions = this._completionCallback();

	// Initialize a buffer containing the input line being processed:
	this._inputLine = '';

	// Initialize a buffer containing the remaining line after cursor:
	this._remainingLine = '';

	// Initialize a buffer containing the completion prefix:
	this._completionPrefix = '';

	// Initialize a buffer containing the list of generated completions:
	this._completionsList = [];

	// Initialize a buffer containing the list of highlighted completions:
	this._highlightedCompletions = [];

	// Initialize a buffer array storing the lengths of all completions:
	this._completionsLength = [];

	// Initialize a buffer storing the width of a column:
	this._widthOfColumn = -1;

	// Initialize a buffer to store the index of the current completion:
	this._idx = -1;

	return this;
}
Constructor for creating a completer engine.

@private
@constructor
@param {REPL} repl - REPL instance
@param {Function} completer - function for generating possible completions
@param {WritableStream} ostream - writable stream
@param {Function} ttyWrite - function to trigger the default behavior of the keypress
@returns {CompleterEngine} completer engine instance