PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/javacc-5.0/www/doc/jjtreereleasenotes.html

https://gitlab.com/essere.lab.public/qualitas.class-corpus
HTML | 472 lines | 293 code | 148 blank | 31 comment | 0 complexity | 657d36cba260ee18d2ff030b2d9179f3 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <!--
  4. Copyright (c) 2006, Sun Microsystems, Inc.
  5. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without
  7. modification, are permitted provided that the following conditions are met:
  8. * Redistributions of source code must retain the above copyright notice,
  9. this list of conditions and the following disclaimer.
  10. * Redistributions in binary form must reproduce the above copyright
  11. notice, this list of conditions and the following disclaimer in the
  12. documentation and/or other materials provided with the distribution.
  13. * Neither the name of the Sun Microsystems, Inc. nor the names of its
  14. contributors may be used to endorse or promote products derived from
  15. this software without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  20. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  23. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  24. CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  25. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  26. THE POSSIBILITY OF SUCH DAMAGE.
  27. -->
  28. <head>
  29. <title>JavaCC: JJTree Release Notes</title>
  30. <!-- Changed by: Michael Van De Vanter, 14-Jan-2003 -->
  31. </head>
  32. <body bgcolor="#FFFFFF" >
  33. <h1>JavaCC [tm]: JJTree Release Notes</h1>
  34. <pre>
  35. ======================================
  36. Changes in 4.2
  37. ======================================
  38. Release 4.2 is a maintenance release, incorporating a number of bug
  39. fixes and enhancements. For a complete list, please see the
  40. issue tracker:
  41. https://javacc.dev.java.net/issues/buglist.cgi?component=javacc&field0-0-0=target_milestone&type0-0-0=equals&value0-0-0=4.2
  42. ======================================
  43. Changes in 4.1
  44. ======================================
  45. Release 4.1 is a maintenance release, incorporating a number of bug
  46. fixes and enhancements. For a complete list, please see the
  47. issue tracker:
  48. https://javacc.dev.java.net/issues/buglist.cgi?component=javacc&field0-0-0=target_milestone&type0-0-0=equals&value0-0-0=4.1
  49. ======================================
  50. Changes in 4.0
  51. ======================================
  52. New option NODE_EXTENDS to specify a classname that
  53. SimpleNode extends so that boiler plate code can be put
  54. in that class. See the examples/Interpreter for an example
  55. usage.
  56. ======================================
  57. Changes from JJTree 0.3pre5 to 0.3pre6
  58. ======================================
  59. ----------------------------------------------------------------
  60. Fixed bug where Writers were not being closed correctly.
  61. ----------------------------------------------------------------
  62. ======================================
  63. Changes from JJTree 0.3pre4 to 0.3pre5
  64. ======================================
  65. ----------------------------------------------------------------
  66. Fixed a bug where a node annotation #P() caused a null pointer error.
  67. ----------------------------------------------------------------
  68. Only generate the jjtCreate() methods if the NODE_FACTORY option is
  69. set.
  70. ----------------------------------------------------------------
  71. Fixed a bug where the name of the JJTree state file was being used in
  72. the declaration of the field.
  73. ----------------------------------------------------------------
  74. ======================================
  75. Changes from JJTree 0.3pre3 to 0.3pre4
  76. ======================================
  77. ----------------------------------------------------------------
  78. Made the constructors of nodes public. Also made the node identifier
  79. constants and the associated strings public.
  80. ----------------------------------------------------------------
  81. Fixed a misleading error message that was produced when the output
  82. file couldn't be generated for some reason.
  83. ----------------------------------------------------------------
  84. Brought the HTML documentation up to date.
  85. ----------------------------------------------------------------
  86. Fixed a bug where the file containing the JJTree state class was
  87. ignoring the OUTPUT_DIRECTORY option.
  88. ----------------------------------------------------------------
  89. Fixed a bug where a construction like this:
  90. a=foo() #Foo
  91. was being incorrectly handled and generating bad Java code.
  92. ----------------------------------------------------------------
  93. Changed the visitor support from a void function to one which takes a
  94. parameter and returns a result. This is a non-compatible change, so
  95. you will have to update your code if it uses the visitor support.
  96. [Also, if the string option VISITOR_EXCEPTION is set, its value is
  97. also used in the signatures of the various methods in the pattern.
  98. Please note: this exception support is very provisional and will be
  99. replaced in a following version by a more general solution. It's only
  100. here because I needed it for one of my own projects and thought it
  101. might be useful to someone else too. Don't use it unless you're
  102. prepared to change your code again later. Rob.]
  103. ----------------------------------------------------------------
  104. ======================================
  105. Changes from JJTree 0.3pre2 to 0.3pre3
  106. ======================================
  107. ----------------------------------------------------------------
  108. JJTree now uses the same grammar as JavaCC. This means that Java code
  109. in parser actions is parsed.
  110. ----------------------------------------------------------------
  111. Added support for the Visitor design pattern. If the VISITOR option
  112. is true, JJTree adds an accept method to the node classes that it
  113. generates, and also generates a visitor interface. This interface is
  114. regenerated every time that JJTree is run, so that new nodes will
  115. cause compilation errors in concrete visitors that have not been
  116. updated for them.
  117. ----------------------------------------------------------------
  118. Added a couple of examples to illustrate the Visitor support.
  119. JJTreeExamples/eg4.jjt is yet another version of the expression tree
  120. builder which uses a visitor to dump the expression tree; and
  121. VTransformer is a variation of the Java source code transformer.
  122. VTransformer is also possibly directly useful as a tool that inserts
  123. visitor accept methods into class files that were generated with
  124. earlier versions of JJTree.
  125. ----------------------------------------------------------------
  126. Added the BUILD_NODE_FILES option, with a default value of true. If
  127. set to false, it prevents JJTree from generating SimpleNode.java and
  128. nodes that are usually built in MULTI mode. Node.java is still
  129. generated, as are the various tree constants, etc.
  130. ----------------------------------------------------------------
  131. Code that is inserted into the grammar is now enclosed in the standard
  132. @bgen/@egen pair.
  133. ----------------------------------------------------------------
  134. The JJTree state object is now generated into its own file if it
  135. doesn't already exist. This is to make it easier to modify.
  136. ----------------------------------------------------------------
  137. Fixed a couple of bugs in the HTML example grammar where the closing
  138. tags didn't match the opening tags.
  139. ----------------------------------------------------------------
  140. Fixed a bug where JJTree was trying to clear the node scope while
  141. handling an exception, even when the node had been closed successfully.
  142. ----------------------------------------------------------------
  143. NODE_FACTORY no longer implies NODE_USES_PARSER.
  144. If you have been using NODE_FACTORY, then now you'll also need
  145. NODE_USES_PARSER. Unless, of course, you were never using the parser
  146. in your node factories.
  147. ----------------------------------------------------------------
  148. Removed not very useful debugging stuff from the JJTree state object.
  149. It was causing problems with parsers running in security environments
  150. where access to arbitrary properties is disallowed.
  151. ----------------------------------------------------------------
  152. ======================================
  153. Changes from JJTree 0.3pre1 to 0.3pre2
  154. ======================================
  155. ----------------------------------------------------------------
  156. The state that JJTree inserts into the parser class is now guarded by
  157. the formal comments.
  158. ----------------------------------------------------------------
  159. The JJTree syntax has been changed so that the node descriptor now
  160. comes after the throws clause, rather than before it.
  161. ----------------------------------------------------------------
  162. Fixed a bug where string-valued options did not have their quotes
  163. stripped.
  164. ----------------------------------------------------------------
  165. Fixed a bug where nodes were being closed early for actions within
  166. ZeroOrMore etc., expansion units.
  167. ----------------------------------------------------------------
  168. The special identifier `jjtThis' was not being translated in parameter
  169. lists or in the BNF declaration section. Fixed it.
  170. ----------------------------------------------------------------
  171. Added the OUTPUT_DIRECTORY option. The default value is "".
  172. ----------------------------------------------------------------
  173. Reinstated node factory methods. They are enabled by setting the
  174. NODE_FACTORY option to true. Unlike the original node factory methods
  175. they take two arguments: the node identifier constant and a reference
  176. to the parser. The reference is null for static parsers.
  177. ----------------------------------------------------------------
  178. Added the NODE_USES_PARSER option with a default value of false. When
  179. set to true, JJTree will call the node constructor with a reference to
  180. the parser object as an extra parameter. This reference is null for
  181. static parsers.
  182. ----------------------------------------------------------------
  183. ====================================
  184. Changes from JJTree 0.2.6 to 0.3pre1
  185. ====================================
  186. ----------------------------------------------------------------
  187. JJTree 0.3pre1 has been bootstrapped with JJTree 0.2.6.
  188. Some aspects of JJTree 0.3pre1 are not backwards-compatible with
  189. 0.2.6. Some users will need to modify their parsers in
  190. straightforward ways in order to work with the new version. See the
  191. file JJTREE-FIX to find out if you need to change anything, and for
  192. detailed instructions on what to change.
  193. ----------------------------------------------------------------
  194. JJTree works with the JavaCC exception handling code. Any unhandled
  195. exceptions within a node scope are caught, the node stack is cleaned
  196. up a bit, and then the exception is rethrown.
  197. ----------------------------------------------------------------
  198. Indefinite and Greater-Than nodes have been generalized into
  199. conditional nodes.
  200. Definite nodes now take any integer expression to indicate now many
  201. children they take. Conditional nodes take any boolean expression to
  202. indicate whether the node is closed and pushed on to the node stack.
  203. ----------------------------------------------------------------
  204. The life cycle of a node is now defined.
  205. ----------------------------------------------------------------
  206. User-defined parser methods can be called when a node scope is entered
  207. and exited.
  208. ----------------------------------------------------------------
  209. The NODE_STACK_SIZE and CHECK_DEFINITE_NODE options are now ignored.
  210. The NODE_SCOPE_HOOK option has been added. This boolean option
  211. determines whether calls to certain user-defined parser methods are
  212. generated at the beginning and end of each node scope. The default
  213. value for this option is false.
  214. ----------------------------------------------------------------
  215. The special identifier jjtThis can now be used in the declarations
  216. section of a production, as well as on the left hand side of call to a
  217. nonterminal.
  218. ----------------------------------------------------------------
  219. A new method arity() has been added to the JJTree state. It returns
  220. the number of nodes that have been pushed so far in the current node
  221. scope.
  222. ----------------------------------------------------------------
  223. The Node interface has changed. The method jjtAddChild() now takes an
  224. argument to indicate the index of the child it is adding.
  225. ----------------------------------------------------------------
  226. The node factory methods are no longer used. You can remove all your
  227. jjtCreate() methods.
  228. The node constructor now takes an int parameter instead of a String.
  229. You will have to modify your node implementations to use the new
  230. signature. The protected field `identifier' no longer exists: you can
  231. use the jjtNodeName[] array to map from the new parameter to the old
  232. String.
  233. ----------------------------------------------------------------
  234. The implementation of SimpleNode has changed significantly. It now
  235. uses an array to hold any child nodes instead of a Vector. It no
  236. longer implements a node factory, its constructor takes an int instead
  237. of a String, and it uses the jjtNodeName[] mechanism for dumping. The
  238. setInfo() and getInfo() methods have been removed.
  239. ----------------------------------------------------------------
  240. The implementation of the state that JJTree keeps in the parser has
  241. changed. It is now considerably more lightweight: the auxiliary
  242. classes JJTreeNodeStack and JJTreeNodeStackEnum have been abolished.
  243. ----------------------------------------------------------------
  244. The JJTree state method currentNode() has been removed. Any calls to
  245. the method in an action within a node scope are automatically replaced
  246. by references to the special identifier jjtThis.
  247. ----------------------------------------------------------------
  248. ==================================
  249. Changes from JJTree 0.2.5 to 0.2.6
  250. ==================================
  251. ----------------------------------------------------------------
  252. Made appropriate internal modifications for the JavaCC 0.7 parse error
  253. exceptions.
  254. ----------------------------------------------------------------
  255. ==================================
  256. Changes from JJTree 0.2.4 to 0.2.5
  257. ==================================
  258. ----------------------------------------------------------------
  259. Fixed a bug where the current node was not being updated in the right
  260. place for final user actions.
  261. ----------------------------------------------------------------
  262. ==================================
  263. Changes from JJTree 0.2.3 to 0.2.4
  264. ==================================
  265. ----------------------------------------------------------------
  266. Fixed a bug where bad code was generated for void nodes in MULTI mode.
  267. ----------------------------------------------------------------
  268. Fixed a bug where a node decoration directly on an action generated
  269. bad code. For example,
  270. {} #MyNode
  271. ----------------------------------------------------------------
  272. ==================================
  273. Changes from JJTree 0.2.2 to 0.2.3
  274. ==================================
  275. ----------------------------------------------------------------
  276. Added toString() and toString(String) methods to SimpleNode and
  277. modified the dumping code to use them. Now you can easily customize
  278. how a node appears in the tree dump, without having to reproduce the
  279. tree walking machinery. See SimpleNode.java for details.
  280. ----------------------------------------------------------------
  281. Clarified the concept of node scope. currentNode() now refers to the
  282. node currently being built for the current scope. It used to be
  283. incorrectly implemented as referring to the most recently created
  284. node, and was synonymous with peekNode().
  285. This change may break some existing programs. Those programs should
  286. be changed to use peekNode() where they currently use currentNode().
  287. Added jjtThis to every user action. It refers to the same node that
  288. currentNode() does, but is already cast to the appropriate node type.
  289. The final user action in a node scope is different from all the
  290. others. When it is executed the node has been fully created, had its
  291. children added, and has been pushed on the node stack. By contrast,
  292. other user actions within the scope are called when the children are
  293. still on the stack, and the current node is not.
  294. Added the nodeCreated() method so that final actions within greater
  295. than nodes can tell whether the node was created or not.
  296. ----------------------------------------------------------------
  297. Fixed several stupid bugs in the Macintosh main class.
  298. ----------------------------------------------------------------
  299. Fixed names of internally used JJTree classes so that they use the JJT
  300. prefix and the name of the parser. This is to avoid naming conflicts
  301. where there is more than one JJTree parser in the same package.
  302. ----------------------------------------------------------------
  303. ================================
  304. Changes from JJTree 0.2 to 0.2.2
  305. ================================
  306. The main change between Beanstalk 0.2 and JJTree 0.2.2 is the removal
  307. of the factory classes. Their function is now performed by a static
  308. method in the node classes themselves.
  309. The state maintained in the parser class has been changed from bs to
  310. jjtree. The prefix on the Node class methods has been changed from bs
  311. to jjt.
  312. A new node method jjtGetNumChildren() returns the number of children
  313. the node has. You can use this in conjunction with jjtGetChild() to
  314. iterate over the children.
  315. Two new options have been added: OUTPUT_FILE and NODE_DEFAULT_VOID.
  316. ----------------------------------------------------------------
  317. </pre>
  318. </body>
  319. </html>