1 | ABNF
|
---|
2 | ====
|
---|
3 |
|
---|
4 | The build process now uses BAP, Bill Fenner's ABNF parser.
|
---|
5 |
|
---|
6 | To build BAP:
|
---|
7 |
|
---|
8 | cd ~/abnfparser/bap
|
---|
9 | ./configure
|
---|
10 | make
|
---|
11 |
|
---|
12 | If linking fails, try to change
|
---|
13 |
|
---|
14 | bap: ${OBJS}
|
---|
15 | ${CC} -o $@ ${DEBUG} ${OBJS} -ll
|
---|
16 |
|
---|
17 | to
|
---|
18 |
|
---|
19 | bap: ${OBJS}
|
---|
20 | ${CC} -o $@ ${DEBUG} ${OBJS} -lfl
|
---|
21 |
|
---|
22 |
|
---|
23 | The actual build process does the following steps:
|
---|
24 |
|
---|
25 | 1) Extract ABNF
|
---|
26 |
|
---|
27 | Extracts the individual ABNF fragments (labeled with type="abnf2616") into
|
---|
28 | *.abnf (using XSLT).
|
---|
29 |
|
---|
30 | 2) Parse ABNF and do 1st formatting step
|
---|
31 |
|
---|
32 | Parse the ABNF using BAP, sort it, and re-parse the result using BAP,
|
---|
33 | serializing the result with folded lines for RFC production to *.parsed-abnf.
|
---|
34 |
|
---|
35 | 3) Generate Collected ABNF appendix, and check whether the src is up2date
|
---|
36 |
|
---|
37 | Reads both *.xml and *parsed-abnf using XSLT, generating *.abnf-appendix,
|
---|
38 | ready for inclusion into the source. While doing so, checks that the current
|
---|
39 | source has an up to date appendix already.
|
---|
40 |
|
---|
41 | This step will produce a WARNING message when the newly generated appendix
|
---|
42 | needs to be refreshed in the source. If it does, run refresh-inclusions.sh on
|
---|
43 | the source file, or just all:
|
---|
44 |
|
---|
45 | ./refresh-inclusions.sh p*.xml
|
---|
46 |
|
---|
47 | 4) Why not automate it?
|
---|
48 |
|
---|
49 | That would lead to circular dependencies in the Makefile. Help appreciated :-)
|
---|
50 |
|
---|
51 | 5) Combined ABNF
|
---|
52 |
|
---|
53 | common-abnf.sh combines the multiple parts into a single ABNF, by removing
|
---|
54 | duplicates (only when the rule is indeed the same) and by removing references
|
---|
55 | to other parts. There's also some special-casing going on that we'll need to
|
---|
56 | get rid of at some point of time.
|
---|
57 |
|
---|