The language we have selected has a syntax similar to C. It has been derived from the “higher order calculator”, especially HOC6 given by Kernighan and Pike in their pioneering book “Unix Programming Environment”.
HOC, “high-order calculator”, is a simple interpreted language for floating-point calculations. Its most common use is as a powerful and convenient calculator, interactively evaluating expressions such as 1 + 2 * sin(0.7). It also lets you assign values to variables, define your own functions, and use loops, conditionals and similar facilities you would expect in a programming language.
The HOC language was introduced and developed in the book The Unix Programming Environment, by Brian Kernighan and Rob Pike (Addison-Wesley, 1984). Countless people are indebted to this book, and its authors, for introducing them to Unix and its fantastic program development tools such as the shell, C and Yacc. Some of these people were strongly impressed by Kernighan and Pike's feat of building an interpreter so clearly, elegantly and easily, something which, before the advent of Yacc, was to be attempted only by experts.
In 1995, Kernighan and Pike released their version of HOC, under a BSD-like free software licence (http://netlib.bell-labs.comb/bwk/hoc.sh). This meant that modified versions of HOC could legally be released, and indeed several such modified versions were released. There are several other derivations from HOC6, for example:
Extended high-order calculator The HOC version 7. Last updated: Nov 4 06:13:29 2004. See http://www.math.utah.edu/pub/hoc/
HOC ver. 9.2 by Nadav Y. Har’El, Last updated version 9.2, September 10, 2008. See http://nadav.harel.org.il/homepage/hoc/.
The driving idea behind minic is to provide a teaching–learning vehicle to students and teachers. The complete source code is being made available through the publishers on the website.
While HOC6 is designed as an interactive calculator, with its emphasis on numerical calculations and demonstration of program development facilities in Unix-like systems, our aim is to illustrate as much a compiler technology for a non-trivial programming language setting as possible within the space limitations of a text-book. Although we have adopted most of the grammar of the original Kernighan and Pike HOC6, there are significant differences also.
The main areas where minic differs from HOC6 are:
18.118.32.222