The command interpreter is a library (written in C) which allows the creation of programs that can accept commands given interactively by the user or programs that are sequences of commands.
interpcom is not a programming language, like Perl or Python. It just gives the possibility to embed a command interpreter in an application.
The main features of the command interpreter are :
- the possibility to add new commands in a very easy way. It contains 81 built-in commands.
- the use of an expression evaluator, written by Mark Morley, which can be used to parse numeric arguments, or make direct computations, and define variables. It is possible to add easily new expression evaluators. One using complex numbers is implemented in the library.
- the possibility to write, load and execute programs, which are sequences of commands, using loops and jumps.
- the definition of objects which are arrays of several types of numbers, having names. So it is possible to refer to objects in arguments of commands for instance, by giving their name. It is also possible to define structures, whose members are objects, other structures or variables of the expression evaluator.
- there is an implementation of complex numbers in two ways. The library contains also some functions that simplify the use of arrays of numbers.
- it is possible to run several programs simultaneously, and these programs can communicate with each other (threads).
It is also possible to glue several applications of the command interpreter.
An application of the command interpreter needs an initialization file which contains a configuration of the interpreter. This file can be used in two ways : it can be read in the beginning of the execution, or it can be included in the executable.
This manual is organized as follows :
In chapter 2 we show how to compile and install the library.
In chapter 3 the structure of an initialization file for the interpreter is given. It is divided in sections which will determine the behavior of the interpreter.
In chapter 4 we explain how to write and use programs, command files and threads.
In chapter 5 we show how commands can be written and implemented.
The chapter 6 treats of objects and structures, how they can be defined and used.
The chapter 7 is a description of the expression evaluator.
The chapter 8 is a description of question files, a way to give parameters to the interpreter.
In chapter 10 we show how to create and use threads.
The chapter 11 gives the list of all the commands that are implemented in the library.
In chapter 12 we describe some functions of the library that might be useful in applications of the command interpreter.
The chapter 13 describes the implementations of complex numbers and gives the list of the functions of the library that use these numbers.
The chapter 14 is a short tutorial.
The main change in version 2.0.0 is the apparition of threads. Several functions of the library need now a supplementary argument, a structure describing the current thread.
version 2.0.1 : correction of somes bugs.
version 2.0.2 : a new kind of variable appears : quick access variables. They can be used to accelerate programs that use mainly the expression evaluator. The detection of bad initialization files is improved (more error messages). A new way to define thread-specific parameters is also introduced.
version 2.0.3 : some memory bugs have been corrected.
version 2.0.4 : a few bugs have been fixed, and a new command to kill threads has been added. Most changes occur in the application funct.
version 2.1 : the application funct disapears (it is now distributed in a separate package). The way to manage initialization files has been modified. It is now possible to add new expression evaluators.
version 2.2 : somes bugs are corrected and the integration of new expression evaluators in the interpreter has been improved. The implementation of numeric functions in expression evaluators has been modified. Interpcom can now be compiled cleanly in C++.
version 2.3 : it is possible tu use the command line editing libraries GNU readline or libtecla.
version 2.4 : some bugs have been corrected and it is possible to use ANSI colors for the prompt and the error messages of the interpreter. The internationalization of the messages has been improved.
version 3.0 : minor bugs corrected, objects and structures can depend on other : new commands depend, undepend, update.
version 3.1 : some bugs corrected, it is now possible tu use help files (new commands help), and to see the value returned by commands (command trace). The expression evaluator has been improved, and it is now possible to define numerical functions by formulas. The user can define new sections of the initialization file.