Parser framework

Introduction

This smale framework implements the main funtionality to write simple and fast a parser. The main class Parser implements the main methods to implement a simple parser like reading a simple byte, push a read byte back etc. The class also supports different stop bytes or stop strings and a 'look a head' mechanism. Internal the parser use a ParseIterator. The classes ReverseIterator and ForewardIterator are implemented.

The subclasses ByteParser, StringParser and LineParser extends the class with additional methods. As example the method readText of the class StringParser reads some characters until a stop byte is found etc.
The class ParameterParser is a simple command line parameter parser. which easy can be used.

The following class diagram shows a simple overview of this package:



Example of the ParameterParser

    public static void main( String[] args )
    {
        ParameterParser parser = new ParameterParser( args );
        String filename;
        
        if( parser.exist("-version") )
        {
        ...
        }
        else if( parser.exist("-filename") )
        {
            // get the filename
            filename = parser.get( "-filename" );
        }
    }

Parse jptools logs

The class LogParser implements a flexible parser which parse log files which are created with the jptools logger.

The following class diagram shows the class dependencies:



Parse web logs

The class WebLogParser implements a parser which parse log files from a web server. The class StatisticData holds the parsed web log statistic.

The following class diagram shows the class dependencies: