This directory contains the sources files of
the hqbgl library for Bigloo. 

Bigloo is a Scheme system written by Manuel Serrano
(Manuel.Serrano@unice.fr) and may be obtained at:
http://kaolin.unice.fr/bigloo/.

General description
===================

The hqbgl library provides 
a Bigloo module named "html-query-parser". This
module is intended to be used in a CGI
program written in Bigloo in order to analyze
the strings returned from a HTML form to
the program. It exports the following items :

- A Bigloo regular grammar named "hqbgl:the-grammar".
  This grammar parses the character string returned
  from the HTML form and creates an a-list of pairs
  (<field name> . <field value>).

- A Scheme procedure "hqbgl:fields" receives as an
  argument the string returned from the HTML form
  and returns the a-list resulting from parsing
  by the parser.

- A Scheme procedure "hqbgl:this-field" receives two
  arguments : a field name and the a-list produced
  by the procedure "hqbgl:fields". "hqbgl:this-field" 
  returns the value of the field associated with the
  name given as argument, if any, elsewhere #f.

Installation
============

This tar-ball should give a set of files under the
directory HtmlQuery:

HtmlQuery/
HtmlQuery/HtmlQueryGrammar/
HtmlQuery/HtmlQueryGrammar/Src/
HtmlQuery/HtmlQueryGrammar/Src/essai.scm
HtmlQuery/HtmlQueryGrammar/Src/html-query-grammar.scm
HtmlQuery/HtmlQueryGrammar/Src/make-html-parser-lib.scm
HtmlQuery/HtmlQueryGrammar/Makefile
HtmlQuery/HtmlQueryGrammar/access-file.scm
HtmlQuery/Makefile
HtmlQuery/HtmlQueryExample/
HtmlQuery/HtmlQueryExample/Src/
HtmlQuery/HtmlQueryExample/Src/Makefile
HtmlQuery/HtmlQueryExample/Src/pascal.scm
HtmlQuery/HtmlQueryExample/Html/
HtmlQuery/HtmlQueryExample/Html/pascal-post.html
HtmlQuery/HtmlQueryExample/Makefile


The root Makefile HtmlQuery/Makefile, invoked by:

make lib

should build the library under HtmlQuery/HtmlQueryGrammar/Lib/

Caution: the Makefiles are not exactly the ones
which would be automatically generated by the
Bigloo programming environment Bee.


The root Makefile invoked by:

make libinstall 

should copy the library in your home directory under ~/Scheme/Lib.
If these directories don't exist, they will be created by
mkdir -p. If these locations don't fit with your needs, you
should modify the Makefile HtmlQuery/HtmlQueryGrammar/Makefile,
(see the INST_LIB_DIR variable and the "install" line).

Caveats
=======

The library has been written under Linux with Bigloo 2.0e and
should work smoothly with the same kind of system. 

With Digital Unix (now Compaq Tru64 Unix) I've experienced
error messages I didn't resolve, but the library was
nevertheless built and correct. To build the example programs
I had to switch manually to the HtmlQueryExample directory
and "make all", and finally it worked fine.

I didn't experiment other systems.

--
Example files
=============

The subdirectory HtmlQueryExample contains a little but comprehensive
example using the library. The form gives access to a CGI program
which, given a number n entered in the form, computes the Pascal's 
triangle for n. HtmlQueryExample/Src/pascal.scm is the CGI program
source. HtmlQueryExample/Html/pascal-post.html is the HTML form. 
HtmlQueryExample/Src/Makefile builds the CGI program using the library.

Invoking HtmlQueryExample/Src/Makefile with "make install" (or the 
Makefile in the root directory with "make exinstall") will copy 
the binary CGI program and the HTML form in directories devoted
to CGI executables and to HTML pages so that they may be accessed 
by a Web server. These lines of the Makefile will usually need
some modifications to be adapted to local conventions (and some
privileges to be executed).

--

This library is written by Laurent Bloch (bloch@pasteur.fr).

   Copyright (c) 1999 Institut Pasteur and Laurent Bloch


