C++ packages

C++ Software Packages

Here is a couple of software packages I've written in C++ and make avaliable to others in case they would like to use it, or similar. Please note that they are all licenced under the GNU LGPL

Some of these packages was featured in Brave GNU World issue # 47.

Unfortunately, there's no mailing list or similar set up for these packages, nor is there any CVS access. I could opt to have Savannah or SourceForge host the projects, but as I do not have readily available access to these sites from my primary development machine, I chose this rather archaic form. Sorry about that.

&bull Readline-- C++ wrapper classes around GNU readline
&bull Yacc/Lex-- C++ interface to Yacc/Lex generated parser/scanners
&bull Yacc/Lex/Readline-- example using the above
&bull Libtool-- C++ wrappers around Libtool's libltdl library
&bull Option-- C++ classes to process command line options
&bull FILE-- C++ classes to wrap C FILE in a std::streambuf layer
&bull Thread-- C++ wrappers around threads
&bull cache C++ templated container to cache memory
&bull GSL-- C++ wrappers around GNU Scientific Library
&bull MyCC ISO C parser and AST generator written in C++, and extendable via the Visitor design pattern

All packages uses Autotools (Automake, Autoconf, and possibly Libtool), so all you need to do to build them, is to do the regular

  ./configure 
  make 
  make install 
	  

cycle. The documentation is automatically generated using Doxygen.

Reporting bugs: When reporting bugs on any of these packages, please follow normal GNU bug-reporting procedures:

  1. Include the version number of the software package, possibly with an approximate date of download. You can get the version number by running
      ./<package>-config --version
    	      
  2. Information on the operating system and chip architecture.
  3. Options based to the ./configure script.
  4. A complete list of modifications made to the package, if any. A patch against the downloaded version is preferable.
  5. Complete contents of files needed to reproduce the bug.

Note, that items 1-3 is taken care of by attaching the config.log of your build. In fact, I prefer that you send that file, rather than giving me the information separately, as that file contains more or less all the information I could ask for.

As for item 4, that is only relevant if you modified any of the packages in any way. To make a patch, rename the directory of the modified sources, unpack the upstream tar-ball next to that directory, and run diff:

 
  mv <name>-<version> <name>-<version>-new
  gzip -dc <name>-<version>.tar.gz |  tar -xf -
  diff -u -r <name>-<version> \
             <name>-<version>-new \
             > <name>-<version>.patch
	  

Item 5 means that you may have to preprocess some source files, if you're using non-standard headers or similar.

Any bug report that does not follow these guidelines will be considered, but it'll speed up the process if you follow these guidelines. Thank you for your help.

For developers only: The packages uses fairly recent versions of the Autotools, so if you need to change something in the build system, you need that too. This does not effect for people who only wants to install the packages.

All of the packages supports building Debian packages directly. Just unpack the tar-ball, cd to the directory and type debuild. I'll add RPM support sometime in the future too.

News

Tue May 9 10:43:33 2006
New version of GSL--.
Thu Apr 27 01:18:39 2006
New version of GSL--.
Fri Jul 29 18:18:23 2005
New version of Readline--. the library now consists entirely of class templates (no compiled code). This is a new version all together, and therefor not nessecarily compatible with previous versions. Note, that this is in development.
Fri Jul 8 12:39:12 2005
New version of Yacc/Lex--
Wed Jun 1 13:26:00 2005
New version of GSL--, which fixes some severe bugs in complex. The BLAS tests imlpemented has been fixed.
Wed Apr 13 07:55:22 2005
New version of FILE--, which fixes some bugs.
Tue Nov 9 12:48:37 2004
New version of GSL--, which fixes some severe bugs in the vector operators. Note, that the BLAS tests haven't been implemented yet.
Tue Nov 9 12:48:37 2004
New version of Thread--. The new version implements everything inline (in headers), so that it's easier to integrate into thrid party projects.
Mon May 24 16:12:43 2004
Prerelease of GSL-- version 0.5 which implements the BLAS module. Note, however, that this module has not been tested yet (hence the prerelease tag). Comments are welcome.
Wed Apr 14 21:27:53 2004
New version of GSL-- which has the implementation of the random number generator, quasi random number generator, and random number distributions. Also implemented gsl-randist in terms of GSL-- rather than using the C GSL library.
Tue Jan 13 19:19:57 2004
New minor version of Option--. This fixes the problem that option_base::print wasn't virtual.
Tue Dec 30 20:30:35 2003
New minor version of Readline--. This fixes some problems when compiling with newer compilers.
Sat Dec 27 00:46:42 2003
New minor version of Option--. This fixes a few problems in the error handling routines.
Thu Dec 18 19:14:52 2003
New version of Option--. In this version, everything is implemented in-line to make it easier to integrate with client code. Note, that this is incompatible earlier versions of the library.
New project MyCC which is a ISO C parser implemented in C++, using Yacc/Lex--. It generates an Abstract Syntax Tree which can be traversed using the Visitor design pattern. As it stands, it does nothing useful, but to print out the AST. Clients are invited to define more useful visitors.
Wed Jun 25 17:15:59 2003
New version of Yacc/Lex--, Libtool--, and FILE--.
FILE-- and Libtool-- now compiles with Microsoft Visual C++ 6.0 (and maybe also Microsoft Visual C++ .NET).
Yacc/Lex--, Libtool--, and FILE--, and option-- compiles with CygWin. That essentially leaves only GSL-- and Readline-- to be tested on CygWin.
Mon Jun 16 22:03:09 2003
New project FILE-- to wrap C FILE in a std::streambuf layer.
Fixes to Option--
Fixes to GSL--
New minor version of Yacc/Lex--
Mon May 5 16:20:14 2003
New minor version of Option-- that traces where on the command line an option was given.
New minor version of Thread-- which supports (more or less) CygWin
Wed Mar 12 19:03:20 2003
Bug fix to Readline--. Some mistakes on my part caused the package to be un-build-able. Note the two new configure options --enable-termcap and --enable-curses. If you're readline library requires linking against -ltermcap or -l(n)curses, please use these options.
GSL-- update. A few more modules have been implemented - in particular the matrix<typename Type> class is now there. Please note, that the library is far from complete - list of TODO's can be found in the documentation (which is new too).
Wed Feb 5 14:02:48 2003
Updates to Yacc/Lex-- and Yacc/Lex/Readline--. The Libtool-- interface is now complete.
Fri Jan 31 18:23:27 2003
Added new package Libtool--.
Wed Jan 29 16:58:11 2003
Updates to Yacc/Lex--. for thread-safety, and similar. Updated Yacc/Lex/Readline--, accordingly.
Mon Jan 6 15:20:02 2003
Updates to Yacc/Lex--. Note that the interface has changed slightly. Please refer to the NEWS file in the source distribution.
Updates to Thread--. Please note, that the interface is changed somewhat. Please read the NEWS file in the source distribution. It now supports building Debian packages directly.
Updates to Yacc/Lex/Readline--, to reflect recent changes in Yacc/Lex-- and Readline--.
Mon Dec 30 14:46:58 2002
Added new package Option--
Updates to Readline-- and Yacc/Lex--
Fri Dec 20 16:09:43 2002
Added new package std::cache
Readline--

Readline-- 2.0.9

C++ wrappers around GNU readline.

The C library readline is a library for making interactive command line applications, like shells, interpretors, and so on. However, the API of readline is very C-centric, so Readline-- provides C++ wrappers to make the C++ programmer more comfortable.

Top of page

Yacc/Lex--

Yacc/Lex-- 2.7

C++ wrappers around GNU Bison and Flex, and to some extend, classical Yacc and Lex as well as Berkeley Yacc (a.k.a. byacc).

Yacc and Lex are the traditional UNIXTM tools for creating syntactic parser and lexical analysers respectively. They output C functions that often defines a state machine. These C functions a cumbersome to the C++ programmer, so Yacc/Lex-- provides a set of header files to nicely wrap up the Yacc/Lex generated functions.

You can use Yacc/Lex-- with both Yacc and Lex, or with only Yacc or Lex.

For an example usage, see the MyCC project on this page.

Here's an overview of the C++ grammar as presented in the ISO/IEC C++ Standard, Annex A. Note, that it contains a lot of shift/reduce and and reduce/reduce conflicts. Oh, and it's not Yacc-able, I'm afraid.

Top of page

Yacc/Lex/Readline--

Yacc/Lex/Readline/Option-- 0.5

This example shows how to combine Yacc/Lex-- and Readline-- into a CLI based toy calculator with advanced features like user functions, commandline editing and history.

Note: It uses Yacc/Lex--, Readline--, and Option-- so you need to install those packages first.

Using the Libtool-- this example could be expanded to provide dynamic loading of functions. However, that's left as an exercise to the interested reader :-)

Top of page

Option--

Option-- 2.2

Class library to help parse command line options.

Using templates, this library provides support for all sorts of command line arguments. The library supports the grand UNIXTM tradition of the long (--<option>=<arg>) and short (-<c> <arg>) format for command line options. Options can have multiple values, and their position on the command line is tracked. Any un-handled options are passed on to the user.

Top of page

Option--

FILE-- 0.5

Class library to wrap C FILE in a std::streambuf layer.

A lot of C libraries assumes that file I/O operations go via a pointer to a C FILE object. However, the ISO/IEC C++ Standard does not deal with FILE save for a few remarks, so these headers wraps the C type FILE in a streambuf layer.

streambuf can sound frightening to you, but once you get the hang of it, it is quite a neat thing. I'd venture to say, that after you've seen what you can do with streambuf, you'd agree with me that it's the coolest thing in C++, 2nd only to Andrei Alexandrescu's tricks in Modern C++ Design .

Top of page

Thread--

Thread-- 0.13

C++ wrappers around threads.

The class library is implemented entirely inline (in headers), so that it's easier to integrate into other projects.

This class library takes a an approach based on traits - that is, the actual interface to the underlying thread library (POSIX threads, C Threads, and some day Win32 threads) is done via traits of the client classes. This makes the seperation of interface and implementation much nicer, without the overhead of virtual member functions, large numbers of #if's and so on. It also makes it much easier for client code to plugin their own backend. Also, there's no reason why on any platform, one may have multiple implmentations - for example realtime and normal threads on Solaris, POSIX and native threads on Win32, GNU PTH and POSIX threads on Un*x, C and POSIX(?) threads on GNU Mach, and so on.

This approach is very different from some of the other C++ thread libraries avaliable out there - for example: The Boost thread classes uses loads of #if's, GNU Common C++ threads rely on inheritance, ThreadJack has interfaces in terms of functions, and ZThread uses adapter classes and #if's. You will not get me to say which is best, my solution or the above - I leave that for you to decide - the links are there, try them if you like.

Top of page

Libtool--

Libtool-- 1.5

Class library to load dynamically loadable (or shared) libraries, via Libtool's libltdl library.

Extending an application dynamically (that is, at run-time) is quite a useful feature (think of `plugins' to your favourite web-browser), and requires loading compiled code. The GNU C library libltdl provides this feature for all platforms in a unified way. However, it is still a C library, and not very C++'ish. Hence, this library wraps libltdl in a small set of classes.

Take a look at the factory example which I think is kinda cool.

Top of page

std::cache

std::cache 1.0

Template container that caches memory to reduce the number of new and deletes.

Top of page

MyCC-

MyCC 0.2

ISO C parser and Abstract Syntax Tree (AST) generator. This uses Yacc/Lex--. It creates a representation of the AST which is visitable by the Visitor design pattern. One visitor is shown: a visitor to print the AST. Clients are invited to define new visitors to do more complex things, like resolving references in the AST, creating binary code ,and so on.

Top of page

GSL--

GSL-- 0.12

C++ wrappers around GNU Scientific Library (GSL). Note that the library is not complete (see the TODO list). However, it shows one way to go when implementing GSL wrappers in C++. It makes heavy use of templates and template specialisation.

Top of page

Home   Christian Holm Christensen Valid CSS! Valid HTML 4.01!