You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

jjdoc.html 3.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>JJDoc Task</title>
  20. </head>
  21. <body>
  22. <h2 id="jjtree">JJDoc</h2>
  23. <p><em>Since Apache Ant 1.6</em></p>
  24. <h3>Description</h3>
  25. <p>Invokes the <a href="http://javacc.dev.java.net/">JJDoc</a> preprocessor
  26. for the JavaCC compiler compiler. It takes a JavaCC parser specification
  27. and produces documentation for the BNF grammar.
  28. It can operate in three modes, determined by command line options.
  29. <p>To use the jjdoc task, set the <i>target</i> attribute to the name
  30. of the JavaCC grammar file to process. You also need to specify the directory
  31. containing the JavaCC installation using the <i>javacchome</i> attribute,
  32. so that Ant can find the JavaCC classes. Optionally, you can also set the
  33. <i>outputfile</i> to write the generated BNF documentation file to a specific (directory and) file.
  34. Otherwise jjdoc writes the generated BNF documentation file as the JavaCC
  35. grammar file with a suffix .txt or .html.</p>
  36. <p>This task only invokes JJDoc if the grammar file is newer than the
  37. generated BNF documentation file.</p>
  38. <h3>Parameters</h3>
  39. <table>
  40. <tr>
  41. <td valign="top"><b>Attribute</b></td>
  42. <td valign="top"><b>Description</b></td>
  43. <td align="center" valign="top"><b>Required</b></td>
  44. </tr>
  45. <tr>
  46. <td valign="top">target</td>
  47. <td valign="top">The javacc grammar file to process.</td>
  48. <td align="center" valign="top">Yes</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">javacchome</td>
  52. <td valign="top">The directory containing the JavaCC distribution.</td>
  53. <td align="center" valign="top">Yes</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">outputfile</td>
  57. <td valign="top">The file to write the generated BNF documentation file to. If not set,
  58. the file is written with the same name as the JavaCC grammar file but with a the suffix .html or .txt</td>
  59. <td align="center" valign="top">No</td>
  60. </tr>
  61. <tr>
  62. <td valign="top">text</td>
  63. <td valign="top">Sets the TEXT BNF documentation option. This is a boolean option.</td>
  64. <td align="center" valign="top">No</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">onetable</td>
  68. <td valign="top">Sets the ONE_TABLE BNF documentation option. This is a boolean option.</td>
  69. <td align="center" valign="top">No</td>
  70. </tr>
  71. <tr>
  72. <td valign="top">maxmemory</td>
  73. <td valign="top">Max amount of memory to allocate to the forked
  74. VM. <em>since Ant 1.8.3</em></td>
  75. <td align="center" valign="top">No</td>
  76. </tr>
  77. </table>
  78. <h3>Example</h3>
  79. <pre>&lt;jjdoc
  80. target="src/Parser.jj"
  81. outputfile="doc/ParserBNF.html"
  82. javacchome="c:/program files/JavaCC"/&gt;</pre>
  83. This invokes JJDoc on grammar file src/Parser.jj, writing the generated
  84. BNF documentation file, ParserBNF.html, file to doc.
  85. </body>
  86. </html>