Vous êtes sur la page 1sur 5

Editors & Debugging system

Chapter-4: Editors & Debugging system


Editor: Editor is a computer program that allows us to enter characters, text, picture elements and also allows us to edit the entered text. By using editors high-level language programs such as c, c++ and Pascal can be written. So editors are called as programming development tool. Examples: Notepad, vi editor, Microsoft word. Classifications of editors: 1) Line editors Line editors: The primary elements being edited are characters. It allows users to edit/alter a single line at a time. Maximum of 24 lines, each of 80 characters may be edited. Editing operations are limited.example: UNIX editor ed, DOS editor edlin. Text editors: It also may be called as screen editors. The primary element being edited is character of strings. It allows the user to browse through the entire file/screen. Multiple screens are allowed. User has control over the entire file; current line number and number of lines displayed may be shown at the top. It presents us with a screen of text and we can move around there making changes as we want. Examples: EDIT of msdos, vi of UNIX, notepad etc. Graphics editors: The primary elements being edited are picture (point, line, circle & box). User working area has to be defined by the user, using coordinates and user is allowed to edit/modify pictures in that area only. Example: corel draw, ms paint etc., The 5 major functions of an editor are, 1. 2. 3. 4. 5. Traveling Editing Viewing Displaying Filtering 2) Text editors & 3) Graphics editors

Traveling: Selection of the part of the document to be viewed and edited involves first traveling through the document to locate the area of interest. The search is accomplished with operations such as next screenful, bottom and find the pattern.traveling specifies where the area of interest. Editing: Editing involves the following operations. Insert, Delete, Replace, Move, Copy Viewing: It is the process of seeing the desired part of the document. Filtering: Filtering controls the selection of what has to be viewed and manipulated in the document. Filtering extracts the relevant subset of the target document at the point of interest.

Editors & Debugging system

Formatting: It determines how the result of the filtering will be seen as a visible representation on a display screen or other device. Displaying: It is the process of bringing the desired part of the document using display device. USER INTERFACE: The user of an editor is presented with a conceptual model of the editing system. Besides the conceptual model, the user interface is concerned with the input devices, the output devices and the interaction language of the system. Conceptual system: In essence, it provides an easily understood abstraction of the target document and its elements, with a set of guidelines describing the effects of operations on these elements. Input devices as an interface to the editor: Input devices are used to enter elements of the text being edited, to enter commands, and to designate editable elements. These devices as used with editors, can be divided into three categories. They are as follows Text devices Button devices Locator devices Text devices: It is also known as string devices. They are typically typewriter like keyboards on which a user presses and releases keys, sending a unique code for each key. Button or Choice devices: They generate an interrupt that is usually causing invocation of an associated application-program action. Such devices typically include set of special function keys on an alphanumeric keyboard or on the display itself. Alternatively, buttons can be simulated in software by displaying text strings or symbols on the screen. The user chooses a string or symbol instead of pressing a button. Locator devices: They are two-dimensional analog to digital converter that positions a cursor symbol on the screen by observing the users movement of the device. Examples: mouse and the data tablet. The data tablet is locator device that is a flat, rectangular, electromagnetically sensitive panel; a ballpoint pen like the stylus is moved over the surface. The tablet returns to a system program the coordinates of the position on the data tablet at which the stylus is currently located. The program can then map these data-tablet coordinates to screen coordinates and move the cursor to the corresponding screen position. Voice input devices: They translate spoken words to their textual equivalents. They may be text input devices of the future.example: Voice recognizers.

Editors & Debugging system

Output devices: The output device lets the user view the elements being edited and the results of the editing operations. The first output devices were teletype writers and other character-printing terminals that generated output on paper. Next, glass teletypes based on the cathode ray tube. Interaction language of the system: Typing oriented method: In this method the user communicates with the editor by typing text strings for command names. These strings are sent to the editor and are usually echoed to the output device. It requires the user of the editor to remember the exact form of all commands. It is overcome by function key oriented method. In this method, each command has associated with a marked key on the users keyboard. For example, the insert character command might have connected with a key marked IC. Menu oriented user interface: A menu is a multiple-choice set of text strings or icons, which are graphic symbols that represent objects or operations. The user can perform actions by selecting items from the menu. Four tasks to be accomplished by a text editor for an interactive user-computer dialogue: 1. 2. 3. 4. Select the part of the target document to be viewed and manipulated. Determine how to format this view on-line and how to display it. Specify and execute operations that modify the target document. Update the view suitably.

Structure of an Editor: The command language processor accepts input from the users input devices and analyzes the tokens and the syntactic structure of the commands. In this sense, the command language processor functions much like the lexical and syntactic phases of a compiler. The command language processor invokes semantic routines directly. The semantic routines are traveling, editing, viewing and display functions. Editing a document: Editing operations are always specified explicitly by the user. In editing a document, the start of the area to be edited is determined by the current editing pointer, which is maintained by the editing component. This component is the collection of modules dealing with editing tasks. The current editing pointer can be set explicitly by the user with traveling commands such as next paragraph and next screen or implicitly by the system as a side effect of the previous editing operation such as delete paragraph. When the user issues an editing command, the editing component invokes the editing filter. This component filters the document to generate a new editing buffer based on the current editing pointer as well as on the editing filter parameters. These parameters are specified by both the user and the system and they provide information such as the range of text that can be affected by an operation. The semantic routines of the editing component then operate on the editing buffer which is essentially a filtered subset of the document data structure. Viewing component:

Editors & Debugging system

Viewing operations are specified explicitly by the user or implicitly by the editing operations. In viewing a document, the start of the area to be viewed is determined by the current viewing pointer. This pointer is maintained by the viewing component of the editor, which is a collection of modules responsible for determining the next view. The current viewing pointer can be set or reset explicitly by the user with a traveling command or implicitly by the system as a result of the previous editing operation. When the display needs to be updated, the viewing component invokes the viewing filter. This component filters the document to generate a new viewing buffer based on the current viewing pointer as well as on the viewing filter parameters. These parameters are specified by the user and the system. They provide information such as the no. Of characters needed to fill the display and how to select them from the document. The viewing buffer is passed to the display by mapping the buffer and it provides a display by mapping the buffer to a rectangular subset of the screen. This screen is usually called as a window. Traveling component: The traveling component of the editor actually performs the setting of the current editing and viewing pointers. Also, the traveling component determines the point at which the viewing and editing filtering begins. Display component: The display operations are specified implicitly by the editing, viewing and traveling operations. Editor paging routines: Loading an entire document into main memory may be practically not possible. In some systems, the problem of loading an entire document into the main memory is overcome by the editor paging routines. In this method the entire file is mapped into virtual memory then the editor paging routines read one or more logical portions of a document into memory as needed. DEBUGGING SYSTEM: An interactive debugging system provides programmers with facilities that aid in the testing and debugging of programs. Debugging is a tool that removes the bugs from the program. Debugging allows the user to run the program in steps i.e., statement-by-statement we can execute the program. This facility allows us to trace the program to find where exactly the error is. For example, in turbo c we can debug the program using the debug menu from the menu bar. The process of finding and removing errors in the program is called debugging. The debugging is generally done in two ways 1) single step control 2) breakpoint method. Debugging functions and capabilities: The important functions & capabilities of an interactive debugging system are as follows. 1. The debugging allows the programmer to put breakpoints in the program. So the breakpoints cause execution to be suspended when a specified point in the program is reached. After execution is suspended, other debugging commands can be used to analyze the progress of the programs and to diagnose errors detected. Execution of the program can then be resumed.

Editors & Debugging system

2. A debugging system should also provide functions such as tracing and traceback.tracing can be used to track the flow of execution logic and data modifications. The control flow can be traced at different levels of detail: procedure, branch, individual instruction and so on.traceback can show the path by which the current statement was reached. It can also show which statements have modified a given variable or parameter. 3. It is also important for a debugging system to have good program-display capabilities. It must be possible to display the program being debugged, complete with statement numbers. 4. A debugging system should consider the language in which the program being debugged is written. Since most user environments and many applications systems involve the use of several different programming languages, the debugging tool is applicable to such multilingual situations. 5. A debugger commands initiate actions and collect data about a programs execution should be common across languages. 6. The debugger also must have a consistent interface to the language translator i.e., compiler in order to gather the information about the language of the program being debugged. Relationship with other parts of the system: An interactive debugger must be related to other parts of the system in many different ways. One very important requirement for an interactive debugger is that it always be available. This means that it must appear to be a part of the run time environment and an integral part of the system. Thus the debugger must communicate and cooperate with other operating system components such as interactive subsystems. Debugging system must allow the users to be able to debug their programs at the production environment. The debugger must coordinate its activities with those of existing and future language compilers and interpreters. User-interface criteria: The facilities of the debugging system should be organized into a few basic categories of function. This is simple organization should closely reflect common user tasks. The user interface criteria of a debugging system as follows. 1. The debugging system should provide the full screen displays and windowing systems as an interface to its users. The primary advantage offered by such an interface is that a great deal of information can be displayed and changed easily and quickly. 2. The tasks to be performed by the user must be reflected in the organization of menus. 3. The debugging system should also provide the commands language facilities. The commands should be simple rather than compound. 4. Any good interactive debugging system should have an on-line HELP facility. one powerful use of HELP with menus is to provide explanatory text for all options present on the screen.

Vous aimerez peut-être aussi