ABNF
====

The build process now uses BAP, Bill Fenner's ABNF parser.

To build BAP:

cd ~/abnfparser/bap
./configure
make

If linking fails, try to change 

  bap:    ${OBJS}
          ${CC} -o $@ ${DEBUG} ${OBJS} -ll
        
to

  bap:    ${OBJS}
          ${CC} -o $@ ${DEBUG} ${OBJS} -lfl
          

The actual build process does the following steps:

1) Extract ABNF

Extracts the individual ABNF fragments (labeled with type="abnf2616") into
*.abnf (using XSLT).

2) Parse ABNF and do 1st formatting step

Parse the ABNF using BAP, sort it, and re-parse the result using BAP,
serializing the result with folded lines for RFC production to *.parsed-abnf.

3) Generate Collected ABNF appendix, and check whether the src is up2date

Reads both *.xml and *parsed-abnf using XSLT, generating *.abnf-appendix,
ready for inclusion into the source. While doing so, checks that the current
source has an up to date appendix already.

This step will produce a WARNING message when the newly generated appendix
needs to be refreshed in the source. If it does, run refresh-inclusions.sh on
the source file, or just all:

./refresh-inclusions.sh p*.xml

4) Why not automate it?

That would lead to circular dependencies in the Makefile. Help appreciated :-)

5) Combined ABNF

common-abnf.sh combines the multiple parts into a single ABNF, by removing
duplicates (only when the rule is indeed the same) and by removing references
to other parts. There's also some special-casing going on that we'll need to
get rid of at some point of time.

