An empty endtag belongs to the most recently open element. Information about the last opened element is obtained by last_open_info().
Every ID-attribute must at least be referenced by one IDREF-attribute and must be unique. Also every IDREF-attribute must refer to a declared ID-attribute. All the values of ID-attributes are stored in one group. Also all the value of the IDREF-attributes are stored (uniquely) in another group (one ID can be referenced more than once). group_add_list() stores all the IDREFS of one IDREFS-attribute in list and returns the number of IDREFS stored.
also_in_idref() checks whether the given name is in the idref-list, if so the name is deleted and TRUE is returned, otherwise FALSE is returned.
To parse a document correctly information must be maintained about the open elements, the possible inclusions, the exclusions and the shortreference maps used. In pars_start() the opened element is pushed on the stack and the inclusions and exclusions activated by this element are also pushed on a stack. The associated map, if there is any, becomes the current map. The starttag is also generated.
In pars_end() the reverse is done, the now closed element is popped of the stack of open elements, the inclusions and exclusions associated with this element are popped of the stack. And the previous map (the one active before this map) becomes active again. The endtag is generated.
If an elements content is declared EMPTY, the pushing of the element on the open elements stack is not necessary because the element has no endtag. It consist solely of a starttag. pars_empty() only generates the starttag with the attributes and returns.
If an element has a CONREF-attribute the element has empty contents, if the attribute is given, and the content according to the element's declaration otherwise. Skipping the content of such an element is achieved by inputing a new defined token TOK_CONREF in the inputstream. .sp 0 The rule in LLgen for the element is: .sp .ce 1 A : [STARTTAG_A {pars_conref(STARTTAG_A); } [A | TOK_CONREF] ; .sp
pars_document() is called at the end of the document to check the id-values and the idref-values.