int grp_capacity(node, level)

- count number of tokens P_Node node; int *level;

void capacity_points()

- count the capacity points

After the document type definition is read in, the capacity points for the entire document are counted. There are 15 defined capacities (see Standard, fig. 5, page 49). grp_capacity() returns the number of tokens in the content model. The maximum nesting level of the content model is stored in level.




For element a: grp_capacity = 7, level = 6
For element b: grp_capacity = 1, level = 0

All the capacities are counted and checked whether the value is smaller then the maximum value. For an example see section 9.8 blz 33 of the Standard. In chapter 13.2 all the possible quantities are named and the default maximum values are given. In basic SGML the default value may not be changed. In annex E of the Standard an example of counting capacitypoints is given, however it contains a few errors. The idrefcap and idcap is 0, but there are id and idref-attributes in the document type declaration. Also the ETAGO, STAGO and TAGC is counted for the entity-text in STARTTAG and ENDTAG entities. According to the Standard this is not part of it.

A file ``cap_point.i'' is generated with the entcap, entchcap, mapcap and totalcap values. This is done because in the document entities and maps can also be declared. Those entities must be counted also for the capacitypoints and still may exceed the maximum value.

capacity.c capacity.h