Friday, March 23, 2007

Smart Novel Editor - A feasible tool for embedded program development

Traditional compilers for programming languages start the compilation process with preprocessing step followed by lexical analysis, syntax analysis, intermediate code generation, code generation and code optimization tasks. This is a translation process, which takes the source code and produces the machine code. The steps in the beginning of compilation process are language oriented and the later steps are machine oriented. The former stages of compilation generate the warnings and errors related to types and usage of variables.

Data flow graph can help the programmer to understand the data usage in the program. It clearly shows the data flow through various statements and the data dependencies of the code fragments. It helps in reducing the logical errors. But this needs to be done as a separate step manually, before coding starts. Also programmer can know about the logical errors while testing the program.

Difficulties faced by the programmer today

One of the problems faced by the programmer, while coding the program is he will not know about how the variable was updated earlier. Programmer guesses the data values for the variables based on his previous logic and builds the program logic further. But he cannot imagine the current data values for the variables. He expects some value and builds the logic. He commits mistake when he uses the variables without having full knowledge of how those variables were updated previously.

What are the abilities of the currently available editors?

There are many development environments where the editor brings the tool tips and pop-up windows about the function signatures, class members. These direct the programmer in choosing the right class members, right variables and help him to build the statement syntactically correct. But they do not reveal anything about how the variables were changed previously. The information to help the programmer to build the logic correctly while typing the program will be advantageous. It reduces the program development life cycle time by reducing the logical errors on the first front.

What additional feature of editor may help the programmer?

If the editor pops up the list for recent previous statements, which update the variables in hand, programmer understands the variables clearly. This will be the proper information for the programmer to build the logic correctly. The editor helps the programmer to use the variables in appropriate way while typing the program.

Also this editor helps the programmer to produce the ‘First Time Right’ Code. Developing ‘first time right’ code means while typing the program itself the programmer corrects the logical errors.

Features of the novel editor

This editor supports the ‘DataUpdate’ feature. This intelligent feature is supported in the editor as user option. If this option is turned off the editor behaves as the normal editor in the development environment. The intelligence is provided to the editor by the backend DLL. The DLL is a programming language dependent. It behaves like a preprocessor and compiler for the language being used. But it will not produce the machine code. The DLL is programming language syntax aware. The two components are editor and the backend DLL. Editor is responsible for the display and the formatting functionalities and serves as the GUI.

The DLL performs the following functions online as the programmer types the program.

a) Preprocessing
b) Lexical Analysis
c) Syntax Analysis
d) Providing the previous update details for any variable

The backend DLL keeps the database of statements and variables. It shows how the particular variable was updated earlier. As the programmer types the statements and uses the variable it will provide the list of statements updating that variable. This aids the programmer to take valid decisions while framing the logic.

Whenever the programmer types the variable name a menu pops up below the variable position. It shows the recent statements modifying that variable. If there are many paths to the statement being typed, then it will show all the alternative list of statements.

Where it will be more useful?

For embedded processors most of the software development happens with the help of cross compilers. For any embedded software development environment where C syntax like language is used we can use this kind of intelligent editor. Here reducing the logical errors while the code is under development can shorten the software development life cycle. Otherwise the errors will be known when the code is tested on the simulator.

No comments:

Save Water and Save Life

Save Water and Save Life