International Conference on Information Systems and Technology |
Foundation of Computer Science USA |
ICIST - Number 1 |
August 2011 |
Authors: V. N. Krishnachandran, Jisha Jose Panackal, Salkala K.S. |
b2abf0c1-1f03-4a88-9af8-2f7558b8e769 |
V. N. Krishnachandran, Jisha Jose Panackal, Salkala K.S. . A Pedagogically Significant Approach to Inputting Mathematical Expressions at Runtime in C. International Conference on Information Systems and Technology. ICIST, 1 (August 2011), 34-38.
The problem of inputting a mathematical expression at runtime in C is generally considered very difficult. The general approach to solve the problem is to include specialized parser packages as header files. It appears that such packages are available only for advanced versions of C like C++ or C#. In this paper we consider a very elementary solution to the problem which does not make use of external packages and uses only the basic concepts of the C programming environment. It also does not require the in-line implementation of the extremely difficult task of parsing a mathematical expression. This approach is accessible to beginning programmers also. In broad outline, the approach adopted is that while a programme is being executed, it generates another programme, compiles and executes the new programme, and finally returns to the original programme. Even though the method may not be satisfactory in terms of speed or efficiency, it is pedagogically significant as it can be employed as a tool for throwing more light on the basic concepts of compilation and execution of a programme.