Monday, 21 April 2014

EDITORS

EDITORS
...................................................................................................................................................................


       STUDY OF EDITORS AND TYPES OF EDITORS

Editor is a system program that interfaces a program with the entity that generates a data (originator). It also interfaces the results of the program with the entity that consumes them (consumer).There are a few steps in program development:
1)      program design, coding and documentation
2)      preparation of programs in machine readable form
3)      program translation, linking and coding
4)      program testing an d debugging
5)      performance enhancement of the program
6)      reforming the data or the result of  the program


ü Design and Coding:
There are two methods for design and coding:


ü Program   Generator:       
   It generates a program which performs a set of functions described in its specifications. The user has to only specify the functions to be performed and not how to perform them.

ü Program   Environment:
  It supports programming by including awareness of the programming language syntax and semantics in the language editor
 Program entry and editing:
The soft tools used are text editors. Editor function in two modes
1. Command Mode
It accepts the user commands specifying the editing function to be performed.
2. Data Mode
The user keys in the text to be added to the files.

ü Testing and Debugging:
Various task to be performed here are selection of test data for the programs, analysis of test results to detect errors if any and debugging. Software tools used to implement these steps are:
1.Test data generators
They help the user to select test data for the program. Test data is a set of input values that satisfy the conditions required for correct flow of data.
2.Automated test drivers
Here the program correctness is verified by subjecting is to a standard set of tests after every modification. This is called regression testing.
3.Debug Monitors
             It is a  software   which provides debugging support for a program. It  executes the program been debugged under its control. It also enables the monitor to perform dynamically specified debugging actions. They perform the following facilities for dynamic debugging:
a)Setting break points in a program.
b)      Initiate a debug conversation when the control reaches the break point.
c)Display the value of variables.
d)     Assign new values to variables.
e)Testing user defined assertions involving program variables.



Enhancement of program performance:
Program efficiency depends on efficiency of the algorithm and efficiency of the coding. Editor comes in different forms:
1)      Line editor
2)      Stream editor
3)      Screen editor
4)      Word processors
5)      Structure editor
6)      Graphical editors



Ø LINE EDITOR
The scope of edit operations on line editor is limited to line of text.
The line is designated:
a) Positionally
b) By specifying a serial number in text
Contextually
a) By specifying a unique character string in it.
The primary advantage of line editors is there simplicity.



Ø STREAM EDITOR
A stream editor views the entire text as a stream of character this permits edit operations to cross line boundaries. Stream editors typically supports character oriented , line oriented and context oriented modes. The current pointer can be manipulated using all these modes.


Ø SCREEN EDITORS
Line or stream editors do not display the text in manner it would appear if printed. Screen editor uses the “What-you-see-is-what-you-get principle. The editor displays a screen full of text at a time the user can move the cursor over the screen, position it at a point where we want to perform. Some editing proceeds with the editing directly. Thus it is possible to see the effect of an edit operation on screen.


Ø WORD PROCESSOR
Word processors are document editors with additional features to produce well formatted hard copy output. Essential features of word processor are command for moving, merging of texts and searching and replacing of words. Many word processors supports spell check options with the adventure of personal computers. Word processors have seen wide spread use among authors, office personal and computer professional.


Ø STRUCTURE EDITOR
A structure editor incorporate an awareness of the structure of a document .This is useful in browsing through a document


CASE STUDY OF MS-WORD, DOS EDITOR , VI –EDITOR


Ø DOS EDITOR

Introduction

1.How to start the Dos editor.
2.How to create a file in the editor.
3.What is a batch file.
4.How to create a batch file.
5.How to execute a batch file.

What is DOS Editor?

The DOS Editor is used to display , create , print , and modify files.
The DOS Editor looks a little like a word process  

EDIT

How do you access the DOS Editor?

Type EDIT at the command prompt and press the ENTER key.
To name a file before starting type EDIT and the filename. Press the ENTER key.

Why do you want to use DOS Editor?

You use the DOS Editor to create Batch Files.

What are Batch Files?

A batch file contains a series of DOS commands.
Batch files have a  .bat extension.

What do you do with a batch file?

Batch file are like icons on a toolbar. They simplify  your life.
Imagine if you had a room full of computers. You wanted ti perform the same function on each of the computers. You have a few options.
 Sit at each computer and perform the function.    
 Build a batch file. Execute the batch file. Have time to relax before your next project.

How do you run or execute a batch file?
  
Type the batch file name.
  There is no need to type the .bat extension.

  How do you  stop or pause a batch file?

  Interrupt batch  file: CTRL+S
  Cancel  batch fil

What are some special batch file commands and what is the purpose of each?
ECHO OFF

This turns off all DOS commands after the ECHO OFF command.
If a DOS command has related questions you will  see the questions. The  only thing you do not see are the DOS commands.
@ ECHO OFF
This turn off all DOS commands including the ECHO OFF  command .

Now , do you understand the difference between ECHO OFF  and @ECHO OFF?

ECHO OFF  - You see ECHO OFF 
 @ECHO OFF  - You don’t see ECHO OFF 

ECHO.
  
This create a blank line.

ECHO

This display a message on a monitor.

PAUSE

This pause your computer until you press any key.




Ø VI EDITOR


INTRODUCTION

The VI editor is a screen based editor used by many Unix users . The VI editor has a powerful feature to aid programmer, but many beginning users avoid using VI because the different features overwhelm them. This tutorial is written to help beginning users get accustomed to using the VI editor , but also contains section relevant to regular users  of VI as well. Examples are provided , and the best way to learn is to try these examples as well………. There’s no better way than to experience things yourself.

  Starting the VI Editor

                  The VI editor lets a user create new files or edit existing files . The command to start the VI editor is vi, followed by the file name. For example to edit a file called temporary, you would type vi temporary and then return . You can start VI without a filename , but when you want to save your work , you will have to save your work , you will have to tell VI which filename to save it into later

The Two Modes of VI   

The first thing most users learn about the VI editor is that it has two modes : command and insert . The  command mode allows the entry of commands to manipulate text . these commands are usually one or  two characters long, and can be entered with few keystrokes. The insert mode puts anything typed on the  keyboard into the current  file. into insert mode . The most commonly used commands to get into insert mode are a and i . These  VI starts out in command mode. There are several  commands that put the VI editor  two commands are described below . Once you are in insert  mode , you get out of it by hitting the escape key . If your terminal does   not have an escape key , ^ [ should work(control-)]. You can hit escape two times in a row and VI  would definitely be in command mode . Hitting escape while you are already in  command mode doesn’t take the  editor out of command mode . It may beep to tell  you that you are already in that mode.

...............................................................................................................

..................................................................

Study OF VI Editor

 ..................................................................
.............................................................................................................................

Editor

               
                An editor allows the users to see a portion of a file on the screen and to modify characters and lines by simply typing at the cursor position.

Vi editor


¨       Vi stands for visual
¨       It is a full screen editor and allows the user to view and edit the entire document at the same time.
¨       Vi is case sensitive.
¨       It has powerful undo features.

Modes of Vi editor


             Vi editor works in 3 modes

Command mode

         In this mode all the keys pressed by the user are interpreted to be editor commands. No text is displayed on the screen even if corresponding keys is pressed on the keyboard.

Insert mode

        This mode permits to insert a new text, editing and replacement of existing text. When Vi editor is in insert mode the letters typed at the keyboard are echoed on the screen.

Escape mode

        Commands typed at the command line.

Starting with Vi editor

                                                                                                                                                                                                                                                                                                                         
                Syntax: vi filename


Moving the cursor

                The cursor movement commands are:

Command
Action
H or backspace
Left one character
l or spacebar
Right one character
K or -
Up one line
J or +
Down one line
I
Moves forward a word
#b
Moves back a word
#e
Moves to the last character in the word
F[character]
Moves right to the specified character in a line
T[character]
Moves right and places it one character before the specified character
0 or ^
Moves to the beginning of the file
#$
Moves to the end of the file
L
Moves to the last line of the file
G
Moves to the specified line number

Editing the file


¨       Open the file using $ vi filename
¨       To add text at the end of the file, position the cursor at the last character of the file.
¨       Switch from command mode to text input mode by pressing ‘a’.
¨       Here ‘a’ stands for append.
¨       Inserting text in the middle of the file is possible by pressing ‘i’. The editor accepts and inserts the typed character until Esc key is pressed.

Command
Purpose
I
Inserts text to the left of the cursor
I
Inserts text at the beginning of the line
A
Append text to the right of the cursor
A
Appends text at the end of the line
O
Appends a new line below
O
Appends a line above

Deleting Text

For deleting a character, move the cursor to the character , press ‘x’. The
character will disappear.
Command
Purpose
X
Deletes one character
Nx
Deletes n number of characters
#x
Deletes on character at the cursor position
#X
Deletes on the character before the cursor position
 D$ or d
    
Deletes a line from the cursor position to the end of the line
D0
Deletes from the cursor position to the starting of the line
#dd
Deletes the current line where the cursor is positioned
#dw
Deletes the word from the cursor position to the end of the word

 

The undo features

                u-undo the recent changes
                U- undo all changes in the current line

Saving text

                :w – save the file and remains in edit mode
                :wq – save the file and quits from edit mode
                :q – quit without changes from edit mode

Quitting vi

                Press zz or ‘:wq’ in command mode.

No comments:

Post a Comment

Thanks.............