18/09/2017

Editors Design and Types

Editors

Text Editor Comes In Following Forms:
1. Line editors
2. Stream editors
3. Screen editors
4. Word processors
5. Structure editors

Line Editor

The scope of edit operations in a line editor is limited to a line of text. The line is designated positionally e.g. by specifying its serial number in the lext or contextually, e.g. By specifying a context which uniquely identifies it The primary benefit of line editors is their simplicity.



Stream Editor

A stream editor views the whole text as a stream of characters. This permits edit operations to cross line boundaries . Stream editors typically support the character, line and context oriented commands based on the current edit context.

The pointer can be manipulated using positioning or search commands Line and stream editors usually maintain multiple representations of text. One representation (the display form) shows a sequence of lines. The editor maintains an internal form which is used to perform the edit operations. This form contains end-of-line characters and other edit characters. The editor makes sure that all the presentations are compatible.

Screen Editors

A line or stream editor does not display the text in the way it will appear if printed. A screen editor uses the design. The editor displays a screenful of text at a time.

The user can move the cursor over the screen, position it at the point where he wants to perform some editing and proceed with editing directly. Thus it is possible  to see the effect of an edit operation on screen. This is very useful while formatting the text to produce printed documents.

Word Processors

Word processors are basically document editors with additional features to produce well formatted hard copy output. Essential features of word processors are commands moving sections of text from one place to another, merge of text, and searching and replacement of words. Many word processors supports a spell check options. With the advent of personal computers, word processors have been used among authors, office personnel and computer professionals. Wordstar is a popular Editor of this class.

Structure Editors

A structure editor incorporates an awareness of the structure of a document. This is useful in browsing through a document, e.g. ifa programmer wishes to edit a specific function in a program file. The   structure is specified by the user while creating or modifying the document. Editing requirements are specific using the structure. A special class of structure editors, called syntax guided editors, were used in programming environments.
For Example

NLS (short form for 'on line system') is a early structure editor  oriented toward document editing. A document has a hierarchic structure, with different levels like group, plex, branch and statement. Items in a high level item are siblings (i.e. brothers) with predecessor-successor relations. Thus, one can talk about a group, the preceding or succeeding group, first statement in a group etc.

Contemporary editors support a combination of line, string and screen editing functions. This makes it hard to classify them in categories. The vi editor of Unix and the editors in desk top publishing systems are typical examples of these.


Design of an Editor

The fundamental function in editing are traveling, editing, viewing and display.

Traveling & Editing

Traveling implies movement of editing context to a new position within the text.This may be done explicitly by the user (e.g. the line number command of a line editor) or may be implied in a user command (eg.  he search command of a stream editor).

Viewing

Viewing Implies formatting the text in a manner desired by the user. This is an abstract view ,independent  of physical characteristics of an IO Devices.

Display

The display component maps the view into physical characteristics of the display device being used. This determines where the user's screen appears.

The separation of viewing and display works gives rise to interesting possibilities like multiple windows on the same screen, concurrent edit operations using the same display terminal, etc. A simple text editor will choose to display the display and display functions.

Following Figure illustrates the schematic of a simple editor. For a given position of the editing context, the editing and viewing filters are operated on the internal form of text. These forms are kept in the editing and viewing buffers respectively.
The viewing-and-display manager makes the display eligible for this text. When the cursor changes position, the filters operate on the contents of the buffers. As editing is performed, the editing filter reflects the changes in the internal form and updates the contents of the viewing of the buffer.

Apart from the fundamental editing functions most editors support an undo function to nullify the previous edit operations performed by the or user. The undo function can be implemented by storing a stack of previous views or by devising an inverse for each edit operation. Multilevel undo commands populate the obvious difficulties in implementing overlapping edits.