Chapter 4cs:hygiene-report

Get a hygiene report for a grammar. The hygiene report will contain information about unproductive rules and undefined, unused, or unproductive symbols.

$inputitem()The ixml grammar
cs:hygiene-report($input, $options)item()
$inputitem()The ixml grammar
$optionsmap(xs:string, item())Grammar options

See Chapter 5, Parser options for a description of the available options.

Like cs:make-parser, this function will accept an XML node, an xs:anyURI, or a string.

It returns a report.

Consider the following grammar:

S: A ; B .
A: 'a', X .
B: 'b', Y .
X: 'x' .
Z: 'z' .

It contains unused and undefined nonterminals.

The XML report is in the namespace. This is an example report for this grammar:

<report xmlns=""
      <rule>B ⇒ 'b', Y</rule>
      <rule>S ⇒ B</rule>

In JSON, the report would be:

  "report": {
    "unproductive": [
      "B ⇒ 'b', Y",
      "S ⇒ B"
    "unreachable": [
    "clean": false,
    "undefined": [