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.

jjtree.html 4.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <meta http-equiv="Content-Language" content="en-us">
  6. <title>JJTree Task</title>
  7. </head>
  8. <body>
  9. <h2>
  10. <a NAME="jjtree"></a>JJTree</h2>
  11. <h3>
  12. Description</h3>
  13. Invokes the <a href="http://www.webgain.com/products/java_cc/">JJTree</a> preprocessor
  14. for the JavaCC compiler compiler. It inserts parse tree building actions
  15. at various places in the JavaCC source that it generates. The output of
  16. JJTree is run through JavaCC to create the parser.
  17. <p>To use the jjtree task, set the <i>target</i> attribute to the name
  18. of the jjtree grammar file to process. You also need to specify the directory
  19. containing the JavaCC installation using the <i>javacchome</i> attribute,
  20. so that ant can find the JavaCC classes. Optionally, you can also set the
  21. <i>outputdirectory</i>
  22. to write the generated file to a specific directory. Otherwise jjtree writes
  23. the generated JavaCC grammar file to the directory containing the JJTree
  24. grammar file.</p>
  25. <p>This task only invokes JJTree if the grammar file is newer than the
  26. generated JavaCC file.</p>
  27. <h3>Parameters</h3>
  28. <table BORDER CELLSPACING=0 CELLPADDING=2 >
  29. <tr>
  30. <td VALIGN=TOP><b>Attribute</b></td>
  31. <td VALIGN=TOP><b>Description</b></td>
  32. <td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
  33. </tr>
  34. <tr>
  35. <td VALIGN=TOP>target</td>
  36. <td VALIGN=TOP>The jjtree grammar file to process.</td>
  37. <td ALIGN=CENTER VALIGN=TOP>Yes</td>
  38. </tr>
  39. <tr>
  40. <td VALIGN=TOP>javacchome</td>
  41. <td VALIGN=TOP>The directory containing the JavaCC distribution.</td>
  42. <td ALIGN=CENTER VALIGN=TOP>Yes</td>
  43. </tr>
  44. <tr>
  45. <td VALIGN=TOP>outputdirectory</td>
  46. <td VALIGN=TOP>The directory to write the generated file to. If not set,
  47. the files are written to the directory containing the grammar file.&nbsp;</td>
  48. <td ALIGN=CENTER VALIGN=TOP>No</td>
  49. </tr>
  50. <tr>
  51. <td VALIGN=TOP>buildnodefiles</td>
  52. <td VALIGN=TOP>Sets the BUILD_NODE_FILES grammar option. This is a boolean
  53. option.</td>
  54. <td ALIGN=CENTER VALIGN=TOP>No</td>
  55. </tr>
  56. <tr>
  57. <td VALIGN=TOP>multi</td>
  58. <td VALIGN=TOP>Sets the MULTI grammar option. This is a boolean option.</td>
  59. <td ALIGN=CENTER VALIGN=TOP>No</td>
  60. </tr>
  61. <tr>
  62. <td VALIGN=TOP>nodedefaultvoid</td>
  63. <td VALIGN=TOP>Sets the NODE_DEFAULT_VOID grammar option. This is a boolean
  64. option.</td>
  65. <td ALIGN=CENTER VALIGN=TOP>No</td>
  66. </tr>
  67. <tr>
  68. <td VALIGN=TOP>nodefactory</td>
  69. <td VALIGN=TOP>Sets the NODE_FACTORY grammar option. This is boolean option.</td>
  70. <td ALIGN=CENTER VALIGN=TOP>No</td>
  71. </tr>
  72. <tr>
  73. <td VALIGN=TOP>nodescopehook</td>
  74. <td VALIGN=TOP>Sets the NODE_SCOPE_HOOK grammar option. This is a boolean
  75. option.</td>
  76. <td ALIGN=CENTER VALIGN=TOP>No</td>
  77. </tr>
  78. <tr>
  79. <td VALIGN=TOP>nodeusesparser</td>
  80. <td VALIGN=TOP>Sets the NODE_USES_PARSER grammar option. This is a boolean
  81. option.</td>
  82. <td ALIGN=CENTER VALIGN=TOP>No</td>
  83. </tr>
  84. <tr>
  85. <td VALIGN=TOP>static</td>
  86. <td VALIGN=TOP>Sets the STATIC grammar option. This is a boolean option.</td>
  87. <td ALIGN=CENTER VALIGN=TOP>No</td>
  88. </tr>
  89. <tr>
  90. <td VALIGN=TOP>visitor</td>
  91. <td VALIGN=TOP>Sets the VISITOR grammar option. This is a boolean option.</td>
  92. <td ALIGN=CENTER VALIGN=TOP>No</td>
  93. </tr>
  94. <tr>
  95. <td VALIGN=TOP>nodepackage</td>
  96. <td VALIGN=TOP>Sets the NODE_PACKAGE grammar option. This is a string option.</td>
  97. <td ALIGN=CENTER VALIGN=TOP>No</td>
  98. </tr>
  99. <tr>
  100. <td VALIGN=TOP>visitorexception</td>
  101. <td VALIGN=TOP>Sets the VISITOR_EXCEPTION grammar option. This is a string
  102. option.</td>
  103. <td ALIGN=CENTER VALIGN=TOP>No</td>
  104. </tr>
  105. <tr>
  106. <td VALIGN=TOP>nodeprefix</td>
  107. <td VALIGN=TOP>Sets the NODE_PREFIX grammar option. This is a string option.</td>
  108. <td ALIGN=CENTER VALIGN=TOP>No</td>
  109. </tr>
  110. </table>
  111. <h3>
  112. Example</h3>
  113. <blockquote>
  114. <pre>&lt;jjtree&nbsp;
  115. &nbsp;&nbsp;&nbsp; target="src/Parser.jjt"&nbsp;
  116. &nbsp;&nbsp;&nbsp; outputdirectory="build/src"
  117. &nbsp;&nbsp;&nbsp; javacchome="c:/program files/JavaCC"&nbsp;
  118. &nbsp;&nbsp;&nbsp; nodeusesparser="true"
  119. /></pre>
  120. </blockquote>
  121. This invokes JJTree on grammar file src/Parser.jjt, writing the generated
  122. grammar file, Parser.jj, file to build/src. The grammar option NODE_USES_PARSER
  123. is set to true when invoking JJTree.
  124. <br>
  125. <hr>
  126. <p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
  127. Reserved.</p>
  128. </body>
  129. </html>