Sei sulla pagina 1di 17

TEXT EDITOR

STRUCTURE OF A EDITOR

Basic Structure of an Editor.

Command language processor.


The most basic component of the editor. Accepts the input from the user input device.

Function The main function is to analyze the tokens and the semantics of the input line with the help of various semantic routines.

Function of a command language processor.


It reads the input and produces an intermediate representation of all the desired editing operations. This then decoded by an interpreter and the required semantic routines are called. The use of intermediate representation provides various languages to have a single semantic routine and with a common representation.

Basic routines
Editing. -they are always explicitly mentioned by the users. Traveling. -they are either explicitly mentioned by the user of changed during the editing process. Viewing. -similar to traveling. Displaying. -This depends on the other three components.

Editing Component.
It is a collection of modules handling various editing tasks. During editing, the start of the area to be edited is determined current editing pointer. The position of the pointer can be set explicitly by the user with travelling commands like next line, next paragraph etc. It can also be set implicitly as a result of previous editing commands.

Working of an editing component.


When the editing command is issued ,the editing component invokes the editing filters. The filters generates a new editing buffer based of the current editing pointer and the parameters passed. The new editing buffer usually contains the part of the document where the editing is to be applied. The semantic routines then act on the filtered subset of the document contained within the buffer to produce the necessary change.

Traveling component.

It decides the current position of the current editing pointer and the current viewing pointer. In other words it determines the area of the document where editing and viewing begins.

Viewing component.
It is a collection of modules that determines the next view. It has a current viewing pointer which determines the start of the area to be viewed. The pointer is set explicitly by any traveling commands or implicitly by the previous editing operation.

Working of a viewing component.


When the display needs to be updated the viewing component invokes the viewing filter. This viewing filter filters the document to generate a new viewing buffer depending on the pointer and the filter parameters. The parameters usually include how many character to be selected, how to select etc. The buffer is sent to the display component where it maps the buffer to the window.

Editing buffer and Viewing buffer.


They are identical. -direct changes of the document in the screen. They might also be independent of each other. -find and replace. In some cases one buffer might be contained within the other. -search till the end of the document.

Relationship between editing and viewing buffer.

Window
This is the display of the user side. This can take up the entire screen or only a potion of it. When only a rectangular portion of it is used it makes it easier for inter-file operations The mapping of the viewing buffer is accomplished by two components.

Role of a viewing component.

This formulates the ideal view often expressed as a device independent representation. This view might be in simple windows format or in a complex fully formatted version consisting of tables, pictures etc.

Role of display component.

This takes the idealized view from the viewing component and maps it to the physical output device.

Essentials of a text editor.


The editor must make use of various screenupdating algorithms to produce an efficient update. It must be also provide a machine independent output for increased efficiency. This can be achieved using terminal-control database. For efficient loading of the file the concept of virtual memory is used by the OS. Another method is the editor paging routine. This loads only certain logical portions of the file according to the use. The portions are also known as pages.

Essentials of a text editor.


Internally the document is represented using editor data structure. This allows the operations like addition, deletion of characters etc. There are three types of editor. -Time-sharing. -Stand-alone. -Distributed.

Potrebbero piacerti anche