next up previous contents index
Next: 2 Installation Up: $FILE Previous: Contents   Contents   Index

Subsections


1 Introduction


1.1 Description of the command interpreter

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. It has been first inspired by the command interpreter of the program Macaulay, but I think that now only the names of some variables can bring together these two interpreters.

interpcom is not a programming language, like Perl or Python. It just gives the possibility to embed a command interpreter in an application without increasing too much its size (the whole library takes about 250k).


The main features of the command interpreter are :


- the possibility to add new commands in a very easy way. It contains 69 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 now 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 9 we show how to create and use threads.

The chapter 10 gives the list of all the commands that are implemented in the library.

In chapter 11 we describe some functions of the library that might be useful in applications of the command interpreter.

The chapter 12 describes the implementations of complex numbers and gives the list of the functions of the library that use these numbers.

The chapter 13 is a short tutorial. The reader can learn how to use the command interpreter by examining the three applications given in the directory appli.

1.2 Changes

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.

In version 2.0.1 somes bugs are corrected.

In 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.

In version 2.0.3 some memory bugs have been corrected.

In 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.

In 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.

In 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++.

In version 2.3 it is possible tu use the command line editing libraries GNU readline or libtecla.

In 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.


next up previous contents index
Next: 2 Installation Up: $FILE Previous: Contents   Contents   Index
jmdr 2001-12-07