CFP last date
20 March 2024
Reseach Article

A Pedagogically Significant Approach to Inputting Mathematical Expressions at Runtime in C

Published on August 2011 by V. N. Krishnachandran, Jisha Jose Panackal, Salkala K.S.
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.

@article{
author = { V. N. Krishnachandran, Jisha Jose Panackal, Salkala K.S. },
title = { A Pedagogically Significant Approach to Inputting Mathematical Expressions at Runtime in C },
journal = { International Conference on Information Systems and Technology },
issue_date = { August 2011 },
volume = { ICIST },
number = { 1 },
month = { August },
year = { 2011 },
issn = 0975-8887,
pages = { 34-38 },
numpages = 5,
url = { /proceedings/icist/number1/3256-icist011/ },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Proceeding Article
%1 International Conference on Information Systems and Technology
%A V. N. Krishnachandran
%A Jisha Jose Panackal
%A Salkala K.S.
%T A Pedagogically Significant Approach to Inputting Mathematical Expressions at Runtime in C
%J International Conference on Information Systems and Technology
%@ 0975-8887
%V ICIST
%N 1
%P 34-38
%D 2011
%I International Journal of Computer Applications
Abstract

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.

References
  1. Sriram Srinivasan, Advanced Perl programming, OReilly Media, Inc., 1997.
  2. Website dedicated to BBC BASIC: http://www.bbcbasic.co.uk/bbcbasic.html
  3. Steven Holzner, Perl Black Book (2nd Ed.) Dreamtech Press, 2004 (p.224).
  4. George Shepherd, ”Add Scripting to Your Apps with Mi-crosoft ScriptControl”, MSDN Magazine, June 2000. Available: http://msdn.microsoft.com/ en-us/ magazine/ cc302278.aspx
  5. Evangelos Petroutsos, Richard Mansfield, Visual Basic .NET Power Tools, John Wiley and Sons, 2003 (p.463 464).
  6. Python v.2.7.1 documentation: The Python Standard Library:2. Built-in Functions”. Available: http://docs.python.org/library/functions.html#eval
  7. TbcParser Math Expression Parser 1.01 . http://www.vclcomponents.com/ Delphi/Components Collection/ TbcParser Math Expression Parser-info.html
  8. Marcin Cuprjak, ”‘Evaluating Mathematical Expressions byCompiling C# Code at Runtime”, April 2003.Available:http://www.codeproject.com /KB/recipes/matheval.aspx
  9. A Function to Evaluate Arithmetic Expressions. Available:http://www.parsifalsoft.com/examples/ evalexpression/ index.htm
  10. John McCarthy, Stanford University,”History of Lisp.” Febru-ary 1979. Available: http://www-formal.stanford.edu/jmc/history/lisp/node3.html
Index Terms

Computer Science
Information Sciences

Keywords

mathematical expressions runtime evaluation C eval inputting mathematics arser