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.3 KiB

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