C/C++

This is my favorite programming language. I'll put some of my projects here when I have some spare time. Most sources are for the linux/unix platform. But I'll also include some Visual C++ sources (again when I have the time).

  1. My first bison++/flex++ project: A little xml parser similar to the domdocument of Qt from trolltech. The reasons for writing this include:
    • Getting experience with bison++/flex++
    • Learning more about xml.
    • XML libraries like libxml and expat for the C++ platform, are too large for my simple needs or not free of licenses.

    This little xml parser does most things qdomdocument of qt can do, just in a little different way. You can give the parser an istream and it generates a n-tree which can be traversed containing a set of different nodes. So you might say it's a simplified DOM (Document Object Model) implementation. As a little extra it turned out to be 4 times as fast as the Qt DOM implementation .

    Here are the sources (download and install bison++ if you don't have it yet):

  2. Next up is a modification of http://baseml.nerdhero.org. Here we plugged the xml parser into an existing project which used the Qt library domdocument classes. By doing this we could remove all qt code from the project and the resulting baseml-noqt is 400% faster than the original. This contains everything you need just do a ./configure, make and make install

  3. Ever wondered how to write an interpreter? Well I started a little project on sourceforge which tries to provide the most simple solution for this goal. No need for lex/yacc, just a few simple classes to give a fully functional interpreter. The syntax is a bit like pascal and it supports functions (recursive etc..), for loops, while, if else etc... I started a new page for it here where I might put up the syntax/semantics if I ever find the time which seems to be going much faster for me these days