The Grammar Window
This window displays the often-fascinating, always-lengthy output of AXE's grammar generator, and
allows you to annotate the document based on the grammar.
This window is used to display the grammars that are generated from the grammar settings dialog.
AXE can construct a grammar from any raw data. This is discussed in mildly more detail here.
Summary Info:
The top part of the grammar dialog contains some general information about the grammar:
- Rules is the number of rules in the generated grammar.
- Randomness is the number of symbols appearing in the grammar divided by the number of symbols in the data. The more regular the input data, the lower this number is. A value of nearly 1 indicates that almost no compression could be performed on the data
and that it therefore contains very little repetition and is very random.
- Longest Rule is the name of the rule that, when expanded, would cover the largest number of input symbols, in other words the longest repeating sequence in the data.
- Most frequent Rule is the name of the rule referred to most often in the grammar, in other words the most frequently repeating sequence in the data.
- Most useful rule is the name of the rule which occupies the largest portion of the input, in other words the rule whose (length * frequency) is greatest.
Text Output
Press the 'grammar' button to view the generated grammar as a text description. This may not be particularly useful for large grammars. The grammar can be cut and pasted out of the window for analysis elsewhere. The format of each line is
<rulename> : <symbol>* [ // <comments>]
Comments will be generated if 'Include Extra Rule Info' was checked in the Grammar Settings Dialog. Symbols are either a literal (character or hex number) or the name of a rule.
Tree
Press the 'tree' button to view the grammar as a tree. This tree contains a full expansion of the grammar in which each node corresponds to an offset in the document. The 'leaves' of the tree are symbols occurring in the document. The 'branches' are rules. In either case,
you can right click on a node to bring up a context menu:
- Goto sets the view to the offset corresponding to a given tree node
-
- Bookmark creates a new bookmark at that offset
In this way you may be able to get a feel for the structure of the document.
Unlike earlier versions of AXE, in AXE 3.2 matches cannot overlap with each other.