Home > Documentation > JJDoc
JJDoc takes a JavaCC / JJTree parser specification and produces documentation for the BNF grammar.
Command line options
JJDoc can operate in several modes, determined by command line options.
| Option | Default | Description |
|---|---|---|
BNF |
false |
Setting BNF to true causes JJDoc to generate a pure BNF document, with the extension .bnf. |
CSS |
<css file> |
This option allows you to specify a CSS file name. If you supply a file name in this option it will appear in a LINK element in the HEAD section of the file. This option only applies to HTML output. |
JCC |
false |
Setting JCC to true causes JJDoc to generate a plain text format description of the BNF in the JavaCC syntax format, with the extension .bnf. |
ONE_TABLE |
true |
The default value of ONE_TABLE is used to generate a single HTML table for the BNF. Setting it to false will produce one table for every production in the grammar. |
OUTPUT_DIRECTORY |
<input dir> |
The default behavior is to put the JJDoc output into a file in the same directory as the grammar file, with the same file name but with the extension set accordingly to the format options. You can supply a different directory path with this option. |
OUTPUT_FILE |
<input file_no_ext>.<fmt_ext> |
The default behavior is to put the JJDoc output into a file in the same directory as the grammar file, with the same file name but with the extension set accordingly to the format options. You can supply a different full file path with this option. |
TEXT |
false |
Setting TEXT to true causes JJDoc to generate a plain text format description of the BNF, with the extension .txt. Some formatting is done via tab characters, but the intention is to leave it as plain as possible. |
XTEXT |
false |
Setting XTEXT to true causes JJDoc to generate a plain text format description of the BNF in the Eclipse XText format, with the extension .xtext. |
If none of the 4 options BNF, JCC, TEXT and XTEXT are set to true, JJDoc generates a BNF description embedded in an HTML 3.2 page, with the extension .html.
Comments in the JavaCC source that immediately precede a production are passed through to the generated documentation.
Example
Example outputs from JJDoc for the JavaCC grammar are given as text and HTML.
JavaCC Command Line … JavaCC Grammar … JavaCC BNF … JavaCC API … JJTree … JJDoc