Next: , Previous: , Up: Hacking   [Contents][Index]


4.2 Project structure

Interesting source files are mostly concentrated in lib subdirectory of distribution. Basic arrangement is rather standard for GNU projects, thus scanner is in scanner.l file, parser in parser.y, error handling routines are in error.c and error.h files, replacements for standard memory allocation routines are in xmalloc.c and xmalloc.h, additional mathematical functions are in xmath.c and xmath.c. Project specific files are: node.h and node.c files for tree representing mathematical function data structures and procedures, symbol_table.c and symbol_table.h for symbol table data structures and procedures and finally evaluator.c and matheval.h for evaluator object data structures and procedures (evaluator object data structure is moved to .c file because matheval.h is public header file and this data structure should be opaque). Fortran interface is implemented in f77_interface.c file.

File libmatheval.texi under doc subdirectory of distribution contains Texinfo source of project documentation (i.e. what you are reading now).

Subdirectory tests contains library test suite. Kind of mixed design is employed here - GNU autotest is used for test framework in order to achieve more portability, while number of small Guile scripts are performing tests. File matheval.c in tests subdirectory contains program extending Guile interpreter with GNU libmatheval procedures. Files with .at extension in same subdirectory in turn consist of fragments of Guile code that this extended Guile interpreter executes in order to conduct tests. File matheval.sh is shell wrapper for program contained in matheval.c file; this wrapper is used by autotest during testing instead of original program. Most interesting aspect of code from tests subdirectory is certainly Guile interface for library that is implemented in matheval.c file; anyone intending to write more tests must before approaching this task become familiar with this interface.


Next: Intended improvements, Previous: Design notes, Up: Hacking   [Contents][Index]