Debian Codegraph @

history.html

raw symbols SCIP
1 <html>
2 <head>
3 <title>xtc Release History and Notes</title>
4 <link rel="stylesheet" href="http://cs.nyu.edu/rgrimm/bedrock.css"
5 type="text/css">
6 <body>
7
8 <h1 class="title">xtc Release History and Notes</h1>
9
10 <dl>
11
12 <!-- ======================================================================= -->
13
14 <dt>1.15.0 (6/14/10)</dt>
15
16 <dd>Major feature release. This release
17 introduces <strong>Jinn</strong>, a dynamic bug detector for the Java
18 Native Interface (JNI). It currently supports HotSpot and J9 running
19 on the x86 version of Linux. Support for other OS and processor
20 combinations is under development. The source directory
21 is <code>src/xtc/lang/blink/agent</code> and the make target
22 is <code>agent</code>. Please direct any feedback
23 to <a href="mailto:[email protected]?subject=Jinn">Byeong Lee</a>.
24
25 <p />This release also removes the unnecessary <code>analyzers</code>
26 target from the make file in <code>src/xtc/lang/blink</code>. Thanks
27 to Tony Sloane for pointing out this bug.
28
29 </dd>
30
31 <!-- ======================================================================= -->
32
33 <dt>1.14.4 (9/29/09)</dt>
34
35 <dd>Minor bug fix release:
36
37 <ul>
38
39 <li>Added <code>rats.manifest</code> to the source distribution.
40 Thanks to Tony Sloane for pointing out this omission.</li>
41
42 <li>Cleaned up <code>xtc.tree.Visitor</code>
43 and <code>xtc.lang.C</code> to avoid raw type warnings.</li>
44
45 <li>Changed parser generator to correctly handle top-level repetitions
46 and options in productions that are marked as resetting or stateful.
47 Thanks to Christoff B&uuml;rger for helping to identify this
48 issue.</li>
49
50 <li>Changed parser regression test to eliminate non-ASCII character,
51 which may lead to test failures depending on a system's default
52 encoding. Thanks to Christopher Mangus for helping to identify this
53 issue.</li>
54
55 <li>Cleaned up <code>limits.c</code> to support 64-bit architectures
56 and eliminate compiler warnings.</li>
57
58 <li>Changed C grammar to avoid stack overflow errors for large
59 compound statements.</li>
60
61 <li>Changed the Java and Typical type checkers for C to support
62 different structure layout for packed bitfields in gcc 4.2 and later.
63 Thanks to Christopher Mangus, Martin Hirzel, and Anh Le for helping to
64 resolve this issue.</li>
65
66 <li>Changed the C type checkers to support gcc's builtin functions for
67 bounds checking memory operations.</li>
68
69 <li>Changed Jeannie build scripts to disable Apple's "blocks"
70 extension to C, C++, and Objective-C on Mac OS X. Thanks to Martin
71 Hirzel for realizing this change.</li>
72
73 <li>Changed Jeannie build scripts to also
74 use <code>include/win32</code> as an include file path for Cygwin,
75 which is necessary for Sun's JDK 1.6. Thanks to Martin Hirzel for
76 resolving this issue.</li>
77
78 <li>Changed Jeannie regression tests to support 64-bit pointers.
79 Thanks to Martin Hirzel for orchestrating this change.</li>
80
81 <li>Updated <code>xtc.lang.c.ml.Machdep</code> to reflect changed
82 constants in <code>xtc.Limits</code>. Thanks to Mike Chrzanowski for
83 identifying this bug.</li>
84
85 </ul>
86
87 Due to many of the above changes, xtc now passes all regression tests
88 on Apple's Mac OS X Snow Leopard (10.6), whose C compiler and Java
89 virtual machine default to 64-bit.
90
91 </dd>
92
93 <!-- ======================================================================= -->
94
95 <dt>1.14.3 (4/6/09)</dt>
96
97 <dd>Minor feature and bug fix release.
98
99 <p /><strong><em>Rats!</em></strong> has been updated as follows:<ul>
100
101 <li>Text-only productions may now contain syntactic predicates in
102 addition to semantic predicates.</li>
103
104 <li>The source locations for errors caused by any character constants
105 or visibility attributes are now correctly reported. Thanks to Chris
106 Capel for raising this issue.</li>
107
108 <li>The code generator now emits <code>break</code> statements for
109 character switches in optional expressions. Thanks to Chris Capel and
110 the C# compiler for identifying this bug.</li>
111
112 </ul>
113
114 <p />The Jeannie grammar has been updated to eliminate a bug that
115 caused null pointer exceptions. Thanks to Matt Renzelmann for
116 identifying this bug.
117
118 <p />The Blink debugger has been updated to perform dynamic
119 consistency checks on the arguments to JNI functions. For example, it
120 detects when <code>NULL</code> is passed to <code>NewStringUTF</code>
121 and reports this invalid argument.
122
123 </dd>
124
125 <!-- ======================================================================= -->
126
127 <dt>1.14.2 (10/18/08)</dt>
128
129 <dd>Minor feature and bug fix release.
130
131 <p /><strong><em>Rats!</em></strong> has been updated as follows:<ul>
132
133 <li>A code generator bug for repetitions nested in options nested
134 in repetitions has been fixed.</li>
135
136 <li>Based on feedback by Marek Gilbert and Sukyoung Ryu, error
137 messages for string literals, string matches, and optional/repeated
138 elements have been improved. Additionally, the new per-production
139 <code>explicit</code> attribute instructs <em>Rats!</em> to generate
140 error messages relative to the marked production's name (and thus
141 ignore any already generated parse errors).</li>
142
143 <li>Generic productions that are directly left-recursive and
144 explicitly assign <code>yyValue</code> in recursive alternatives are
145 now rejected, since <em>Rats!</em> cannot deduce their semantic value.
146 Thanks to Chris Capel for raising this issue.</li>
147
148 <li>Productions containing expressions lifted from public productions
149 do not inherit public visibility anymore. Thanks to Chris Capel for
150 raising this issue.</li>
151
152 <li><em>Rats!</em> now has its own JAR file, <code>rats.jar</code>.
153 Thanks to Adrian Quark for raising this issue.</li>
154
155 <li>The regression tests now check for errors and warnings as well as
156 correct inputs and outputs.</li>
157
158 </ul>
159
160 <p /><strong>C support</strong> has been improved as follows:<ul>
161
162 <li>The C grammar has been changed to avoid stack overflow errors on
163 some Java virtual machines when parsing very long character or string
164 literals. Thanks to Eric Hielscher for raising this issue.</li>
165
166 <li>The C type checker has been updated to type check programs read in
167 with the <code>parsetree</code> option, which preserves all
168 formatting. Thanks to Eric Hielscher for raising this issue.</li>
169
170 <li>The C grammar and type checker now support
171 the <code>__thread</code> specifier provided by gcc for the ELF object
172 format. Thanks to Matt Renzelmann for raising this issue and aiding
173 in its resolution.</li>
174
175 <li>The new <code>printFeatures</code> option
176 for <code>xtc.lang.C</code> prints major GCC extensions used by the
177 code being processed.</li>
178
179 </ul>
180
181 Please remember to run <code>make&nbsp;configure</code> to recreate
182 the appropriate <code>xtc.Limits</code> for your hardware, OS, and
183 compiler. Thanks to BK Lee's tireless help, configuration now also
184 works with Microsoft's Visual C.
185
186 <p />The <strong>Blink</strong> inter-language debugger has been
187 improved as follows:<ul>
188
189 <li>Blink now natively supports Microsoft Windows using Microsoft CDB
190 as a component debugger. It features breakpoints, call stack tracing,
191 and single stepping across Java and native code. However,
192 mixed-language Jeannie expressions are not (yet) working, since
193 Microsoft CDB does not support complete C/C++ expression evaluation
194 and convenience variables.</li>
195
196 <li>Blink is now more robust by wrapping calls from Java to C through
197 JVMTI, the JVM Tool Interface, which is available in JVMs such as
198 Sun's HotSpot and IBM's J9. Previously, Blink relied on native
199 breakpoints inside the JVM to interpose on the transition from Java to
200 native code. This approach can lead to surprising behavior during
201 inter-language single stepping and has thus been replaced.</li>
202
203 </ul>
204
205 </dd>
206
207 <!-- ======================================================================= -->
208
209 <dt>1.14.1 (7/31/08)</dt>
210
211 <dd>Bug fix release.
212
213 <p /><strong><em>Rats!</em></strong> has been updated as follows:<ul>
214
215 <li>User-specified bindings in the base cases of directly
216 left-recursive productions are now preserved (instead of being
217 renamed). Thanks to Chris Capel for identifying this bug.</li>
218
219 <li>Left-recursive productions are now recognized in time linear to a
220 grammar's number of productions. Thanks to Chris Capel for raising
221 the issue of parser generator performance.</li>
222
223 <li>If an alternative contains only a predicate, it will not result in
224 an unreachable alternative error anymore. Similarly, if an option
225 contains only a predicate, it will not result in a matching empty
226 input warning anymore. Thanks to Chris Capel for identifying these
227 bugs.</li>
228
229 <li>If an alternative starting with character and/or string literals
230 is a prefix of a subsequent alternative, the latter alternative will
231 now be reported as unreachable (instead of <em>Rats!</em> generating
232 unreachable Java code). Thanks to Janus Dam Nielsen for identifying
233 this issue.</li>
234
235 <li>Voided null literals are now rejected with an error message (as
236 they serve no purpose). Thanks to Eric Hielscher for raising this
237 issue.</li>
238
239 <li>Java primitive types and keywords are now reported as invalid
240 types for productions.</li>
241
242 <li>Optional or repeated actions now result in a single error message
243 instead of two messages.</li>
244
245 </ul>
246
247 </dd>
248
249 <!-- ======================================================================= -->
250
251 <dt>1.14.0 (7/26/08)</dt>
252
253 <dd>Major feature release. This release
254 introduces <strong>Blink</strong>, a portable mixed-mode Java/native
255 debugger. It currently supports Sun's Java virtual machine running on
256 the x86 versions of Linux and Cygwin, with support for other JVM, OS
257 and processor configurations under development. Please direct any
258 feedback to <a href="mailto:[email protected]?subject=Blink">BK
259 Lee</a>.
260
261 </dd>
262
263 <!-- ======================================================================= -->
264
265 <dt>1.13.3 (5/14/08)</dt>
266
267 <dd>Minor feature and bug fix release.
268
269 <p /><strong><em>Rats!</em></strong> has been updated as follows:<ul>
270
271 <li>Variant typing now supports constructors with the same simple name
272 appearing in different variants. The corresponding generic nodes must
273 be created in different modules. Furthermore, polymorphic variants
274 may not reference different monomorphic variants containing
275 constructors with the same simple name.</li>
276
277 <li>Variant typing now better handles generic productions that do not
278 pass the value through and whose generic nodes have already been
279 assigned to monomorphic variants. Additionally, a bug in processing
280 such productions has been fixed.</li>
281
282 <li>String literals in string match expressions are now properly
283 escaped. Thanks to Dejan Jovanovi&#263; for identifying this
284 bug.</li>
285
286 <li>The runtime JAR file now contains nested and anonymous classes as
287 well. Thanks to Chris Jones for identifying this bug.</li>
288
289 </ul>
290 Due to improvements in variant typing, <em>Rats!</em> now statically
291 types the Jeannie grammar, requiring no
292 additional <code>variant</code> annotations.
293
294 <p />The <strong>Typical compiler</strong> has been updated to
295 support <code>fun</code> expressions, and the translation
296 of <code>let</code> expressions has been optimized. Additionally,
297 bugs in the exhaustiveness checking for <code>match</code> expressions
298 and when explicitly matching <code>bottom</code> have been fixed.
299 Thanks to Christopher Conway for reporting these bugs.
300
301 <p />The Java, Typical, and O'Caml <strong>type checkers for
302 C</strong> have been updated to:<ul>
303
304 <li>check for zero width bit-fields with names,</li>
305
306 <li>check for discarded qualifiers,</li>
307
308 <li>treat string literals as <code>const&nbsp;char&nbsp;*</code>
309 instead of <code>char&nbsp;*</code>,</li>
310
311 <li>track the compile-time constant values of sizeof, alignof, and
312 offsetof expressions,</li>
313
314 <li>correctly track the compile-time constant values of enumerators
315 that are defined in terms of other enumerators within the same
316 enumeration,</li>
317
318 <li>warn on (in)equality comparisons between integers and pointers
319 (instead of reporting errors).</li>
320
321 </ul>
322 Thanks to Matt Renzelmann for identifying the last two issues.
323
324 <p />To track size, alignment, and offset values, the C type checkers
325 now include a re-engineered version of gcc's structure layout
326 algorithm. The local system's C configuration
327 in <code>xtc.Limits</code> has been improved in support.
328 Run <code>make&nbsp;configure</code> to recreate the appropriate
329 version for your hardware and operating system.
330
331 <p />The syntax for <strong>Jeannie</strong> top-level compilation
332 units has changed. The package and import declarations now come
333 before the initial <code>`.C&nbsp;{&hellip;}</code> block instead of
334 after it. That way, top-level C code can use simple instead of fully
335 qualified names when referring to Java entities.
336
337 <p />Internally, the Jeannie grammar and AST for array declarators has
338 been updated to create "variable length" nodes, just like the C
339 grammar and AST in release 1.13.0. Furthermore, the compiler has been
340 updated to address several bugs, mostly thanks to helpful reporting by
341 Matt Renzelmann.
342
343 <p />Support for <strong>Overlog</strong> has been extended with a
344 translator targeting Java. The corresponding runtime is being
345 developed by Nalini Belaramani at UT Austin; the necessary JAR file is
346 available <a href="http://cs.nyu.edu/rgrimm/xtc/overlog-runtime.jar">here</a>.
347 Additionally, the Overlog language has been extended with tuple and
348 function type declarations, the Overlog grammar has been cleaned up,
349 and a bug in the inference of function return types has been fixed.
350 The corresponding Java package has been renamed
351 to <code>xtc.lang.overlog</code> (from <code>xtc.lang.p2</code>).
352
353 </dd>
354
355 <!-- ======================================================================= -->
356
357 <dt>1.13.2 (12/1/07)</dt>
358
359 <dd>Minor feature and bug fix release.
360
361 <p />The <strong>Jeannie compiler</strong> now supports backticked
362 Java primitive types, e.g., <code>`boolean</code>
363 or <code>`int</code>, as C type specifiers. This change eliminates
364 the need for using the equivalent JNI types,
365 e.g., <code>jboolean</code> or <code>jint</code>, in C contexts. This
366 release also includes various bug fixes to the Jeannie compiler and
367 a <a href="http://cs.nyu.edu/rgrimm/xtc/jeannie.html">user guide</a>.
368
369 <p />The <strong>Typical compiler</strong> now supports
370 the <code>guard</code> construct for protecting
371 against <code>bottom</code> values in arbitrary expressions. It also
372 incorporates various bug fixes, including mapping <code>bottom</code>
373 to <code>bottom</code> in optimized pattern matches.
374
375 <p />This release includes <strong>three type checkers for C</strong>.
376 The first is the previously released version, which is written in Java
377 and used by the Jeannie compiler. The second is new to this release
378 and written in Typical. It is invoked through
379 the <code>-analyze</code> and <code>-typical</code> options to the C
380 driver <code>xtc.lang.C</code>. Just like the type checker written in
381 Java, the type checker written in Typical passes all of gcc 4.1.1's
382 regression tests. Both type checkers also process the entire Linux
383 2.6 kernel. To this end, the handwritten C type checker now:<ul>
384
385 <li>supports gcc's <code>__builtin_types_compatible_p()</code> (which
386 also required changing the C grammar),</li>
387
388 <li>properly creates a scope for gcc statement expressions,</li>
389
390 <li>actually recognizes unnamed struct or union fields appearing in
391 structs or unions,</li>
392
393 <li>correctly pointer decays all address of expressions,</li>
394
395 <li>correctly recognizes all type names in sizeof and alignof
396 expressions (which also required changing the C grammar),</li>
397
398 <li>computes the size and alignment of arbitrary types and expressions
399 (though the results do not yet agree with gcc for bitfields),</li>
400
401 <li>treats compound literals as compile-time constants,</li>
402
403 <li>treats static block-level variables as having a compile-time
404 constant memory location,</li>
405
406 <li>correctly tracks compile-time constant addresses across all
407 address of expressions,</li>
408
409 <li>treats offsetof expressions as having a compile-time constant
410 value,</li>
411
412 <li>suppresses duplicate errors when processing case labels.</li>
413
414 </ul>
415 The third type checker for C is new to this release as well and
416 written in O'Caml. It re-uses the parser and AST representation
417 of <a href="http://www.cs.berkeley.edu/~necula/cil/">CIL</a> and is
418 contained in the <code>src/xtc/lang/c/ml</code> directory. Like the
419 other two type checkers, the O'Caml version processes the entire Linux
420 2.6 kernel; though it does not recognize C99's variable length arrays.
421
422 <p />xtc now includes support for type inference and concurrency
423 analysis of <strong>Overlog</strong> programs; the corresponding code
424 lives in the <code>xtc.lang.p2</code> package.
425
426 <p /><strong><em>Rats!</em></strong> has been updated as follows:<ul>
427
428 <li>Variant typing now supports modularized AST definitions, i.e., it
429 now supports variants with the same simple name but in different
430 modules. It also performs stricter error checking.</li>
431
432 <li>Support for the <code>rawTypes</code> attribute has been fixed; it
433 does not result in a class cast exception anymore. However, support
434 for this attribute has been deprecated and will be removed in a future
435 release.</li>
436
437 </ul>
438
439 <p />All <strong>tools</strong> now support a <code>-no-exit</code>
440 option for not exiting a Java virtual machine. As a result, tools can
441 now be invoked by other Java code in the same JVM without terminating
442 the JVM after tool completion.
443
444 <p />The <strong>licensing</strong> of most classes
445 in <code>xtc.util</code> has been changed to the LGPL version 2.1. As
446 before, the complete list of LGPL-ed classes can be found
447 in <a href="overview.html">overview.html</a>.
448
449 </dd>
450
451 <!-- ======================================================================= -->
452
453 <dt>1.13.1 (10/16/07)</dt>
454
455 <dd>Bug fix and minor feature release.
456
457 <p />This release makes the following changes
458 to <strong><em>Rats!</em></strong>:<ul>
459
460 <li>Parsers generated with the <code>withLocation</code> option now
461 start counting columns at 1 (instead of 0) for consistency with most
462 modern development environments. The following code fixes Emacs'
463 column number mode:
464 <pre>
465 (add-hook 'post-command-hook (lambda ()
466 (let ((help-echo "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
467 (col (number-to-string (+ 1 (current-column)))))
468 (setq-default mode-line-position
469 `((-3 ,(propertize "%p" 'help-echo help-echo))
470 (size-indication-mode
471 (8 ,(propertize " of %I" 'help-echo help-echo)))
472 (line-number-mode
473 ((column-number-mode
474 (10 ,(propertize (concat " (%l," col ")") 'help-echo help-echo))
475 (6 ,(propertize " L%l" 'help-echo help-echo))))
476 ((column-number-mode
477 (5 ,(propertize (concat " C" col) 'help-echo help-echo))))))))
478 (force-mode-line-update)))
479 </pre>
480 Thanks to Martin Hirzel for updating Emacs' original hook. The start
481 column is now defined by <code>xtc.Constants.FIRST_COLUMN</code>;
482 the <code>xtc.tree.Printer</code> utility has been updated to use this
483 constant.</li>
484
485 <li>Parsers generated with the <code>withLocation</code> option now
486 correctly annotate nodes resulting from directly left-recursive
487 generic productions with their source locations (again). Release
488 1.12.0 introduced a regression, which annotated nodes with a source
489 location past the position of the recursive nonterminal. This release
490 restores an optimized version of the correct approach introduced in
491 release 1.8.0.</li>
492
493 <li>A parser's internal state for tracking source locations can now be
494 updated through
495 the <code>xtc.parser.ParserBase.setLocation(int,String,int,int)</code>
496 method. The C, C4, and Jeannie grammars utilize this method to update
497 the corresponding parsers' source location based on gcc line markers
498 in the preprocessed input. As a result, all error messages now report
499 the original file name and line number; though the column number may
500 be inaccurate due to macro expansion.</li>
501
502 <li>Parsers containing generic productions now include a
503 static <code>toText()</code> helper method that returns a string. For
504 regular parsers, the method is the identity function for strings. For
505 parsers generated with the <code>withParseTree</code> option, the
506 method takes an annotated token as its only argument and returns the
507 corresponding string. The C and Java grammars have been rewritten to
508 utilize this method instead of various kludges for converting
509 annotated tokens to strings.</li>
510
511 <li>Parsers generated with the <code>withParseTree</code> option now
512 correctly preserve formatting in list-valued productions.
513 Furthermore, they now correctly preserve formatting in some generic
514 productions that are not directly left-recursive and end with a
515 sequence consisting only of formatting; <em>Rats!</em> also does not
516 split such productions any more.</li>
517
518 <li>The new <code>noinline</code> attribute for productions prevents
519 inlining even if the production is marked as or recognized
520 as <code>transient</code>. Furthermore, the new <code>memoized</code>
521 attribute for productions prevents productions from being treated
522 as <code>transient</code>.</li>
523
524 <li>Variant typing now performs stricter error checking before
525 assigning a polymorphic variant to a production. It also generates
526 more consistent constructor names for polymorphic variants. Finally,
527 it now correctly assigns some generic nodes to variants that were
528 previously ignored.</li>
529
530 <li>The accuracy of production voiding, which voids productions whose
531 semantic values are never bound, has been improved.</li>
532
533 </ul>
534
535 <p />The <strong>Typical</strong> compiler now supports the
536 hierarchical syntax tree definitions generated by <em>Rats!</em>,
537 including polymorphic variants and the <code>'a&nbsp;var</code> type.
538 The type describing the syntax tree's root defaults
539 to <code>node</code> but can be overridden through
540 the <code>-node</code> command line flag. Additional changes to
541 Typical include:<ul>
542
543 <li>The Typical type checker itself is now built with all
544 optimizations enabled: pattern matches are optimized through switch
545 statements, let scopes are collapsed where possible, and the unused
546 type record is optimized away.</li>
547
548 <li>The implementation of the <code>reduce</code> construct now
549 correctly follows its semantics.</li>
550
551 <li>Similarly, the implementation of the <code>parent</code>
552 and <code>ancestor</code> built-ins now follows their semantics.</li>
553
554 </ul>
555
556 <p />The <strong>Jeannie compiler</strong> has been updated to reflect
557 the language described in the OOPSLA paper. In particular, it now
558 supports <code>with</code> statements for non-primitive arrays,
559 declarations in <code>with</code> statement initial clauses, and
560 compound initializers. Additional changes include:<ul>
561
562 <li>Keywords and built-ins new to Jeannie can now be written without
563 leading underscores. However, to avoid a name clash with the standard
564 C library, <code>abort</code> (or <code>_abort</code>) has been
565 renamed to <code>cancel</code> (or <code>_cancel</code>). The
566 new <code>-underscores</code> command line option overrides this new
567 default behavior, reverting to the underscored versions.</li>
568
569 <li>The compiler now emits line marker comments in generated Java code
570 of the form
571 <pre>
572 //#line &lt;line&gt; &lt;file&gt;
573 </pre>
574 and indents both generated C and Java code identically to the source.
575 The new <code>-pretty</code> command line option overrides this new
576 default behavior, reverting to the Java and C pretty printers.</li>
577
578 <li>The new <code>jeannie.sh</code> shell script
579 in <code>src/xtc/lang/jeannie</code> manages the entire build process
580 from Jeannie source code to Java and C binaries.</li>
581
582 </ul>
583
584 <p />The C regression tests have been updated to include all relevant
585 tests from GCC version 4.1.1. The <strong>C type checker</strong> has
586 been updated accordingly. In particular, it now explicitly checks
587 for:<ul>
588
589 <li>structs or unions not being redefined within themselves,</li>
590
591 <li>variables, fields, and parameters not being declared as void
592 (instead of reporting the types as incomplete),</li>
593
594 <li>void parameter type lists not having a storage class, qualifier,
595 or function specifier,</li>
596
597 <li>identifiers with internal linkage not being redeclared with
598 external linkage in a block-level declaration,</li>
599
600 <li>labels being declared but not defined and labels being defined but
601 not used,</li>
602
603 <li>the type of the target in gcc's computed goto statements being a
604 non-float scalar,</li>
605
606 <li>incomplete types when dereferencing pointers or performing pointer
607 arithmetic,</li>
608
609 <li>right-hand sides in assignments not being void,</li>
610
611 <li>pointer values not being assigned to floating point objects,</li>
612
613 <li>structs or unions in compound literals not being incomplete,</li>
614
615 <li>extra brace groups in compound initializers,</li>
616
617 <li>the return type of <code>main</code> not being an int.</li>
618
619 </ul>
620 Additionally, the processing of block-level extern declarations has
621 been much improved.
622
623 <p />The <code>limits.c</code> utility for determining a <strong>local
624 system's C configuration</strong> has been improved to more accurately
625 determine the local pointer difference, size, and wide character
626 types. The corresponding <code>xtc.Limits</code> class included in
627 the source distribution is valid for 32-bit x86-based Mac OS X
628 systems, but differs in endianness from PowerPC-based Mac OS X systems
629 and in the definitions for size and wide character types from Linux
630 and Windows systems. The new <code>configure</code> target for the
631 global Makefile rebuilds <code>xtc.Limits</code>
632 and <code>xtc.type.C</code> (whose constants depend
633 on <code>Limits</code>) for a local system.
634
635 <p />Thanks to Thomas Moschny, the implementation of for expressions
636 in the <strong>XForm</strong> AST query and transformation engine has
637 been fixed to properly iterate over nested sequences. Also thanks to
638 Thomas Moschny, a bug causing a null pointer exception has been fixed.
639
640 <p />All <strong>tools</strong> now support
641 a <code>-diagnostics</code> option to print tool internal state.
642 Given this option, the C driver now prints the local system's
643 configuration parameters (as determined by <code>limits.c</code>
644 &mdash; see above).
645
646 <p />Finally, the Java and C drivers now support
647 the <code>-locateAST</code> command line option to print each node's
648 source location when printing the AST with the <code>-printAST</code>
649 option.
650
651 </dd>
652
653 <!-- ======================================================================= -->
654
655 <dt>1.13.0 (8/31/07)</dt>
656
657 <dd>Major feature and bug fix release.
658
659 <p />Starting with this release, xtc
660 includes <strong>Typical</strong>, a domain-specific language and
661 compiler for implementing semantic analysis including type checking.
662 The Typical language builds on the functional core of ML and extends
663 it with novel declarative constructs specifically designed for
664 implementing type checkers. The package description
665 for <code>xtc.typical</code> provides an overview and introduction.
666 Examples included with xtc are a type checker for the simply typed
667 lambda calculus in <code>src/xtc/lang/TypedLambda.tpcl</code> and for
668 the Typical language itself in <code>src/xtc/lang/Typical.tpcl</code>.
669 A type checker for C written in Typical is under development. The
670 main developers for Typical are Laune Harris and Anh Le.
671
672 <p />Starting with this release, xtc also includes "a compiler
673 contributed to xtc" a.k.a. <strong>Jeannie</strong>, which integrates
674 Java with C. In Jeannie, Java and C code are nested within each other
675 at the level of individual statements and expressions and compile down
676 to JNI, the Java platform's standard foreign function interface. By
677 combining the two languages' syntax and semantics, Jeannie eliminates
678 verbose boiler-plate code, enables static error detection across the
679 language boundary, and simplifies dynamic resource management.
680 The <a
681 href="http://cs.nyu.edu/rgrimm/papers/oopsla07.pdf">OOPSLA&nbsp;'07</a>
682 paper by Martin Hirzel and Robert Grimm describes both language and
683 compiler in detail; the package description
684 for <code>xtc.lang.jeannie</code> provides instructions on how to
685 compile source code to binaries.
686
687 <p />Instead of using strings, <strong><em>Rats!</em></strong> now
688 relies on <code>xtc.type.Type</code> and its subclasses to internally
689 represent the types of semantic values. The first new feature to
690 leverage this improved internal representation is <strong>variant
691 typing for grammars</strong>. When the <code>-ast</code> command line
692 option is combined with the new <code>-variant</code>
693 option, <em>Rats!</em> automatically determines ML-style variant
694 types representing a grammar's generic AST. To facilitate type
695 inference, <em>Rats!</em> relies on the new <code>variant</code>
696 attribute for productions, which indicates that all generic nodes
697 returned by a production are members of the same variant type, named
698 after the production. The C, Java, Typical, and simply typed lambda
699 calculus grammars have been updated accordingly.
700
701 <p />The <strong>Java grammar and AST</strong> for <code>this</code>
702 expressions have been improved. Instead of accepting any primary and
703 postfix expression, the grammar now recognizes only a qualified
704 identifier with a trailing dot before the <code>this</code> keyword.
705 For well-formed inputs, this changes replaces zero or more nested
706 selection expression nodes as a this expression node's first child
707 with an optional qualified identifier.
708
709 <p />The <strong>C grammar and AST</strong> have also been improved.
710 The "<code>*</code>" string denoting variable-length arrays in array
711 declarator nodes and direct abstract declarator nodes has been
712 replaced with a dedicated "variable length" node. Next, the
713 identifier string in structure designators has been replaced by a
714 primary identifier node. Finally, goto statement nodes now have two
715 children. A "<code>*</code>" string as the first child now indicates
716 a computed goto statement. The second child always is a node, with a
717 primary identifier providing a regular goto statement's label.
718
719 </dd>
720
721 <!-- ======================================================================= -->
722
723 <dt>1.12.0 (7/18/07)</dt>
724
725 <dd>Major feature and bug fix release.
726
727 <p />As described below, <em>Rats!</em>' handling of list values in
728 generic productions has changed. If your grammar contains generic
729 productions and you do not want to update your AST processing code,
730 add the <code>flatten</code> option to your grammar.
731
732 <p />xtc now supports <strong>parse trees</strong> in addition to
733 abstract syntax trees, thus facilitating source code refactorings that
734 preserve formatting and layout. In particular:<ul>
735
736 <li>For grammars with the new <code>withParseTree</code>
737 attribute, <em>Rats!</em> rewrites generic, list-valued, text-only,
738 and void productions as well as productions that pass the value
739 through to generate parsers that preserve all formatting as
740 annotations. Annotations are instances of the new
741 class <code>xtc.tree.Formatting</code>, which replaces the generic
742 annotations introduced in version 1.9.0.</li>
743
744 <li>The embedded AST generally has the same structure as for parsers
745 generated without the <code>withParseTree</code> attribute. The
746 exception are strings, which are represented as instances
747 of <code>xtc.tree.Token</code>. Additionally, generic nodes include
748 additional children (consisting of <code>Formatting</code> annotating
749 a <code>null</code> value) if a voided expression or void nonterminal
750 appears between two list-valued expressions.</li>
751
752 <li>By default, visitors continue to ignore all annotations and
753 process only AST nodes, thus ensuring that the same visitors can
754 process both parse trees and abstract syntax trees.
755 The <code>Token.test</code> and <code>Token.cast</code> methods
756 can be used to test for and cast to strings, irrespective of whether
757 the tree is a parse tree or abstract syntax tree.</li>
758
759 <li>The new <code>xtc.tree.ParseTreePrinter</code> prints parse trees
760 including formatting, and the
761 new <code>xtc.tree.ParseTreeStripper</code> strips all formatting and
762 tokens, extracting the embedded AST (but preserving any other
763 annotations).</li>
764
765 <li>The C and Java drivers have been updated with
766 a <code>-parsetree</code> option to use parse trees instead of
767 abstract syntax trees. Furthermore, the <code>-strip</code> option
768 removes all formatting and tokens from a parse tree again.</li>
769
770 </ul>
771
772 <p />The interface to <strong>abstract syntax tree nodes</strong> has
773 been improved as following:<ul>
774
775 <li>Access to a node's source location has been factored into its own
776 interface <code>xtc.tree.Locatable</code>. The corresponding field
777 in <code>xtc.tree.Node</code> has been marked private. <em>Rats!</em>
778 now uses this interface for parsers with the <code>withLocation</code>
779 attribute, thus removing the dependency on xtc's node
780 representation.</li>
781
782 <li>All nodes now support a <code>write(Appendable)</code> method for
783 incrementally creating a human-readable
784 representation. <code>Node.toString()</code> now utilizes this
785 method. Similar functionality for classes in <code>xtc.type</code>
786 has been modified to utilize this generalized version.</li>
787
788 <li>Nodes' support for children that are lists, i.e., instances
789 of <code>xtc.util.Pair</code> has been improved. In particular, the
790 new <code>Node.getList</code> method returns a node's child as a list,
791 and the new <code>Node.isList</code> and <code>Node.toList</code>
792 methods test for and cast to lists of nodes, respectively.
793 Additionally, the
794 new <code>Visitor.iterate</code>, <code>Visitor.map</code>,
795 and <code>Visitor.mapInPlace</code> methods apply a visitor to all
796 nodes on a list.</li>
797
798 </ul>
799
800 <p />The representation of <strong>programming language types</strong>
801 in <code>xtc.type</code> has been cleaned up and expanded:<ul>
802
803 <li>Type annotations, i.e., a type's source location, language, scope,
804 constant value, memory shape, and attributes, can now be stored
805 in <em>each</em> type instead of only a dedicated wrapped type.
806 Correspondingly, the wrapped types for source locations, constant
807 values, and memory shapes have been removed;
808 though <code>AnnotatedT</code> is still available to annotate a type
809 without directly modifying it.</li>
810
811 <li>The wrapped types for variables, fields, and C's struct and union
812 members have been folded into a single wrapped
813 type <code>xtc.type.VariableT</code>.</li>
814
815 <li>The new <code>UnitT</code>, <code>VariantT</code>,
816 and <code>TupleT</code> classes model the corresponding types in
817 functional languages such as ML or Haskell. The latter two classes
818 replace the <code>ListT</code>, <code>OptionT</code>,
819 and <code>ProductT</code> classes introduced in version 1.10.0.</li>
820
821 <li>Types can now be parameterized through the <code>Parameter</code>
822 and <code>Wildcard</code> classes representing named parameters and
823 wildcards, respectively. The new wrapped
824 types <code>ParameterizedT</code> and <code>InstantiatedT</code>
825 capture a type's declared parameters and its instantiation with
826 concrete types, respectively.</li>
827
828 <li><code>Type.Tag</code> now defines a Java enumeration over all type
829 classes. Each instance's tag is accessible through the
830 <code>Type.tag()</code> and <code>Type.wtag()</code> methods (with
831 invocations of the former method being forwarded across wrapped
832 types). As a result, it is now possible to implement switch
833 statements for types.</li>
834
835 <li>The <code>Tag</code> interface for C's enum, struct, and union
836 types has been renamed to <code>Tagged</code> in order to avoid
837 confusion with the new <code>Type.Tag</code> enumeration.
838 The <code>Constant</code> interface for types' constant values has
839 been replaced with a concrete implementation.</li>
840
841 <li>All C-specific operations have been factored into a separate
842 class, <code>xtc.type.C</code>.</li>
843
844 <li>The new class <code>xtc.type.AST</code> contains common constants
845 and operations for typing abstract syntax trees.</li>
846
847 <li>The C and Java type checkers have been updated to utilize the
848 modified package. <em>Rats!</em> has also been updated to
849 utilize <code>xtc.type</code>, though the conversion is not yet
850 complete.</li>
851
852 </ul>
853
854 <p />The <strong>Java grammar and AST</strong> have been re-engineered
855 to (mostly) eliminate the need for a separate AST simplification
856 phase. Notably, the AST for postfix and primary expressions has been
857 significantly cleaned up. The Java type checker has been updated
858 accordingly.
859
860 <p >Additionally, xtc now includes a grammar for
861 <strong>Java&nbsp;5</strong>. The Java&nbsp;5 grammar is implemented
862 as a modification of the Java&nbsp;1.4 grammar, and ASTs for the two
863 versions are compatible, i.e., every valid Java&nbsp;1.4 AST also is a
864 valid Java&nbsp;5 AST. The Java pretty printer has been updaged to
865 support both versions. Furthermore, the <code>FactoryFactory</code>
866 concrete syntax tool has been updated to use the Java&nbsp;5 grammar.
867 Since ASTs for the two language versions are compatible, the concrete
868 syntax tool will create Java&nbsp;1.44 ASTs as long as the input only
869 uses Java&nbsp;1.4 features.
870
871
872 <p />The <strong>C type checker</strong> now verifies that external
873 declarations without initializers are complete only at the end of a
874 translation unit, thus correctly allowing for the definition of a
875 struct or union type <em>after</em> it has been used in an external
876 declaration. It also adds support for three more GCC extensions:<ol>
877
878 <li>Global register variables (but without checking the register
879 names),</li>
880
881 <li><code>extern</code> and <code>inline</code> functions, which
882 effectively are macros and may be defined in the same translation unit
883 before a regular function definition,</li>
884
885 <li>structures with trailing incomplete arrays as struct member types
886 and array element types.</li>
887
888 </ol>
889 As a result, the C type checker now passes all GCC regression tests
890 ported to xtc.
891
892 <p />In addition to supporting the generation of parse trees and using
893 the new <code>Locatable</code>
894 interface, <strong><em>Rats!</em></strong> has been improved as
895 follows:<ul>
896
897 <li><em>Rats!</em> now deduces the semantic value of productions of
898 type <code>Pair&lt;T&gt;</code>, automatically creating a list from
899 the values of each alternative's component expressions. If the last
900 component expression has a list value, that value becomes the tail of
901 the production's list value. If the only component expression has a
902 list value, that value becomes the production's value. For
903 example,
904 <pre>
905 Pair&lt;Node&gt; ExpressionList = Expression (void:",":Symbol Expression)* ;
906 </pre>
907 creates a list of nodes, automatically consing the first expression's
908 value onto the list of expression nodes. In contrast,
909 <pre>
910 Pair&lt;Node&gt; TwoExpressions = Expression Expression ;
911 </pre>
912 also creates a list of nodes, but by consing the two expressions'
913 nodes onto the empty list.</li>
914
915 <li><em>Rats!</em> now supports a <code>null</code> literal, which
916 simply provides a <code>null</code> value. Previously, the C
917 and Java grammars used a production
918 <pre>
919 Node Null = ;
920 </pre>
921 to generate null values; the null literal provides a more direct and
922 efficient alternative. The old <code>xtc.util.Null</code>
923 and <code>xtc.util.NullNode</code> modules have been removed.</li>
924
925 <li>When a component expression of a generic production has a list
926 value, <em>Rats!</em> now directly adds the list value as the generic
927 node's child. Previously, <em>Rats!</em> flattened the list by adding
928 the list's elements as children of the generic node. The old behavior
929 is still available through the grammar-wide <code>flatten</code>
930 attribute.</li>
931
932 <li>The implementation of the <code>-ast</code> command line option,
933 which instructs <em>Rats!</em> to print a formal definition of a
934 grammar's abstract syntax tree, has been rewritten (again) to produce
935 a more accurate definition. It now uses the <code>optional</code>
936 modifier to indicate that an AST node's child may be <code>null</code>
937 and the <code>variable</code> modifier to indicate that a child may
938 not even be present. This feature remains under active
939 development.</li>
940
941 <li>The new location optimization (<code>-Olocation</code>)
942 causes <em>Rats!</em> to (1) use simpler code for updating a node's
943 source location where possible and (2) omit updates altogether where
944 possible. This optimization is enabled by default.</li>
945
946 <li>The detection of malformed voided expressions, bindings, and
947 string matches has been improved. Notably, string matches on bindings
948 and other string matches are now flagged as grammar errors; though
949 bindings of string matches are still legal. This well-formedness
950 check prevents a <code>ClassCastException</code> during code
951 generation.</li>
952
953 <li>The detection of unreachable alternatives has been generalized,
954 thus improving error reporting for malformed grammars.</li>
955
956 <li>A bug in the code generation for options nested within repetitions
957 in transient productions has been fixed. With this bug, the option's
958 semantic value always was <code>null</code>, even if the option was
959 matched in the input; furthermore, the repetition was not matched
960 completely. Thanks to Eclipse for raising the "unused variable
961 binding" leading to the bug's discovery.</li>
962
963 </ul>
964
965 <p />The <code>AttributeList</code>
966 and <code>MalformedNodeException</code> classes
967 in <code>xtc.tree</code> have been removed. All code using the former
968 has been changed to use a <code>List&lt;Attribute&gt;</code>; there
969 was no code using the latter.
970
971 <p />Finally, this release incorporates several fixes to minor bugs
972 identified by Eclipse and
973 by <a href="http://findbugs.sourceforge.net/">FindBugs</a>.
974
975 </dd>
976
977 <!-- ======================================================================= -->
978
979 <dt>1.11.0 (5/14/07)</dt>
980
981 <dd>Major feature and bug fix release.
982
983 <p />The <strong>licensing</strong> of several classes has been
984 changed. The <code>Node</code>, <code>GNode</code>,
985 and <code>Annotation</code> classes in <code>xtc.tree</code> and
986 the <code>Action</code> and <code>State</code> classes
987 in <code>xtc.util</code> are now licensed under the LGPL version 2.1
988 instead of the GPL version 2. Consequently, parsers generated from
989 grammars with generic or stateful productions are not covered by the
990 GPL anymore.
991
992 <p />This release simplifies the <strong>interface between nodes and
993 visitors</strong>. Processing methods cannot be specified as part of
994 nodes anymore; i.e., <code>visitWith(Visitor)</code> methods are not
995 recognized by <code>dispatch()</code> anymore. Furthermore, if a
996 visit method has <code>void</code> as its return
997 type, <code>dispatch()</code> now returns <code>null</code>; i.e., it
998 does not return the specified node anymore. The first feature has
999 been removed because it has not been used in over 1 1/2 years; the
1000 second feature has been removed because it is inconsistent with Java
1001 reflection and programmer expectations about void methods (while also
1002 having some runtime overhead).
1003
1004 <p />Other changes to nodes and visitors include:<ul>
1005
1006 <li>If <code>dispatch()</code> cannot identify an appropriate visit
1007 method, it now invokes the new <code>unableToVisit(Node)</code>
1008 method. That method's default implementation simply raises a visitor
1009 exception, thus resulting in the already familiar behavior. However,
1010 visitors can override this method and thus implement their own error
1011 handling strategies. Note that <code>dispatch()</code> caches
1012 resolutions to <code>unableToVisit()</code>, just like it caches
1013 resolved visit methods.</li>
1014
1015 <li>Both <code>VisitorException</code>
1016 and <code>VisitingException</code> now inherit from a common
1017 superclass <code>TraversalException</code>. That class removes stack
1018 trace elements corresponding to <code>dispatch()</code> and Java
1019 reflection invocations from a strack trace, thus resulting in less
1020 clutter when printing the stack trace. Thanks to Martin Hirzel for
1021 raising this issue.</li>
1022
1023 <li>Nodes that support generic traversal now also support
1024 <code>indexOf()</code>,
1025 <code>lastIndexOf()</code>, and <code>contains()</code> operations
1026 consistent with the Java collections framework.</li>
1027
1028 </ul>
1029
1030 <p /><strong><em>Rats!</em></strong> has been improved as follows:<ul>
1031
1032 <li>With the above mentioned relicensing in place, the functionality
1033 of <code>FullParserBase</code> has been rolled
1034 into <code>ParserBase</code>, thus eliminating the need to
1035 differentiate a parser's base class according to license.</li>
1036
1037 <li>Generic productions may now contain so-called node markers, which
1038 specify the names of automatically created generic nodes, overriding
1039 the production's name. Node markers are written as
1040 "<code>@<i>Name</i></code>"; the last node marker in a sequence
1041 specifies the created generic node's name. Node markers are
1042 especially useful for expressing different left-associative operators
1043 that have the same precedence with a single directly left-recursive
1044 production. Where possible, explicit semantic actions in the C
1045 grammar have been replaced with node markers.</li>
1046
1047 <li>The new <code>profile</code> attribute instructs <em>Rats!</em>
1048 to include code for profiling the usage of the memoization table. For
1049 grammars with this attribute, <em>Rats!</em> includes a counter for
1050 every field (i.e., memoized production) in the memoization table. The
1051 parser then increments the appropriate counter on every table
1052 access. <em>Rats!</em> also includes
1053 a <code>profile(xtc.tree.Printer)</code> method, which prints
1054 the <em>maximum</em> value for all of a production's fields across all
1055 memoized productions. If that number consistenly is 1 over a sampling
1056 of representative inputs, the corresponding production should probably
1057 not be memoized (i.e., marked as transient). The C and Java drivers
1058 have been updated to support parsers generated with this
1059 attribute.</li>
1060
1061 <li>The new <code>factory</code> attribute instructs <em>Rats!</em>
1062 to use a class different from <code>xtc.tree.GNode</code> for creating
1063 generic nodes.</li>
1064
1065 <li>The implementation of the <code>verbose</code> attribute has been
1066 rewritten to produce considerably more informative traces of a
1067 parser's execution. In particular, the parser now traces when it (1)
1068 enters a production, (2) exits a production (with either a match or
1069 parse error), and (3) looks up a previously memoized result.</li>
1070
1071 <li>The new <code>nowarn</code> attribute instructs <em>Rats!</em> to
1072 suppress warnings for a production or the entire grammar.</li>
1073
1074 <li>The implementation of the <code>-ast</code> command line option,
1075 which instructs <em>Rats!</em> to print a formal definition of a
1076 grammar's abstract syntax tree, has been generalized (and simplified)
1077 to produce a more accurate definition.</li>
1078
1079 <li>The interface for turning parser results into either values (on
1080 success) or exceptions (on failure) has been simplified through the
1081 new <code>value(Result)</code>, <code>format(ParseError)</code>,
1082 and <code>signal(ParseError)</code> methods of the parser base
1083 class <code>xtc.parser.ParserBase</code>. The old error reporting
1084 code has been removed from <code>ParserBase</code> and
1085 <code>ParseException</code>; all tools have been updated accordingly.
1086 The easiest way to use a parser with the updated interface is:<pre>
1087 parser.value(parser.p<em>Nonterminal</em>(0))
1088 </pre>
1089 This expression tries to recognize nonterminal <em>Nonterminal</em>,
1090 starting at the beginning of the input, and either returns the
1091 corresponding semantic value or signals a parse exception.</li>
1092
1093 <li>The new <code>-valued</code> command line option instructs
1094 <em>Rats!</em> to reduce a grammar to only those expressions that
1095 directly contribute to the abstract syntax tree and to then print the
1096 reduced grammar. Like the <code>-ast</code> option, it helps
1097 developers understand a grammar's abstract syntax tree without them
1098 needing to understand the complete grammar.</li>
1099
1100 <li><em>Rats!</em> now checks that all alternatives in an ordered
1101 choice are reachable, i.e., are not preceded by an alternative that
1102 accepts the empty input. Otherwise, it reports an error. Thanks to
1103 Petar Maymounkov for reminding me of this issue.</li>
1104
1105 <li><em>Rats!</em> now checks that the semantic value of each base
1106 case in a directly left-recursive generic production is a node.
1107 If <em>Rats!</em> determines that the value definitely is not a node,
1108 it reports an error. If it determines that the value possibly may not
1109 be a node, it reports a warning.</li>
1110
1111 <li>The global state object for stateful grammars is now allocated per
1112 parser instance and not per parser class anymore. As a result,
1113 several instances of the same parser can be used concurrently.</li>
1114
1115 <li>When sole nonterminals are inlined, <i>Rats!</i> now preserves the
1116 source location of the original nonterminal, leading to more
1117 informative error locations. Thanks to Petar Maymounkov for raising
1118 this issue.</li>
1119
1120 <li>A bug in the code generation for directly left-recursive generic
1121 productions has been fixed; with this bug, <em>Rats!</em> generated
1122 malformed Java code for recursive alternatives that result in generic
1123 nodes with a single child.</li>
1124
1125 <li>A bug in the pretty printing of grammars, which printed the any
1126 character constant as a dot instead of an underscore, has been
1127 fixed.</li>
1128
1129 </ul>
1130
1131 <p />xtc now supports <strong>concrete syntax</strong> for creating
1132 Java and C abstract syntax trees. The
1133 new <code>xtc.lang.FactoryFactory</code> tool reads in a factory
1134 declaration, which includes one or more snippets of Java or C code,
1135 and creates the corresponding factory class. That class has one
1136 method per snippet, with each method creating the abstract syntax tree
1137 representing the code snippet. Code snippets may be declarations,
1138 statements, or expressions; they may also contain pattern variables,
1139 which are bound on method invocation.
1140
1141 <p />The <strong>Java grammar</strong> has been improved by
1142 introducing a distinct production for variable declarations and by not
1143 recognizing constructor, method, and field declarations inside method
1144 bodies anymore. At the same time, the AST fragment for variable
1145 declarations has the same structure as that for field declarations;
1146 i.e., both nodes have the same name ("FieldDeclaration") and one or
1147 more children indicating the modifiers.
1148
1149 <p />Additionally, the <strong>pretty printing of Java ASTs</strong>
1150 has been improved: synchronized statements now include parentheses
1151 around their expressions, compilation units and class bodies do not
1152 contain unnecessary blank lines any more, and the spacing of class
1153 declarations, catch clauses, and new expressions has been improved.
1154 Thanks to Martin Hirzel and Laune Harris for identifying several of
1155 these issues.
1156
1157 <p />Thanks to Martin Hirzel, xtc now includes a <strong>type checker
1158 for Java</strong> (version 1.4). Comparable to the C type checker,
1159 the Java type checker is invoked through the <code>-analyze</code>
1160 command line option to <code>xtc.lang.JavaDriver</code>.
1161 The <code>-printSymbolTable</code> option instructs the Java driver to
1162 print the symbol table after analysis. Note that the Java type
1163 checker requires a simplified AST, as indicated by
1164 the <code>-simplifyAST</code> option.
1165
1166 <p />Support for processing <strong>C programs</strong> has been
1167 improved as follows:<ul>
1168
1169 <li>As already indicated above, the C grammar has been modified to
1170 utilize node markers for recognizing function and array declarators as
1171 well as for recognizing postfix expressions.</li>
1172
1173 <li>Line marker, source identity, and pragma annotations in C program
1174 ASTs are now annotated with the correct source location
1175 information.</li>
1176
1177 <li>The pretty printer now supports lining up printed output with a
1178 node's original source location; it also supports GNU-like formatting
1179 of braces in addition to Java-like formatting.
1180 The <code>CDriver</code> exposes these features through
1181 the <code>-preserveLines</code> and <code>-formatGNU</code> command
1182 line options.</li>
1183
1184 <li>The C type checker (<code>xtc.lang.CAnalyzer</code>) now correctly
1185 type checks variable declarations with compound initializers, even if
1186 the <code>-markAST</code> command line option is specified. Under
1187 certain conditions, it previously aborted with an exception indicating
1188 that a node already has a type. Thanks to Martin Hirzel for
1189 identifying this issue.</li>
1190
1191 </ul>
1192
1193 <p /><strong>Tool support</strong> for I/O has been improved. In
1194 particular, <code>xtc.util.Runtime</code> now manages input/output
1195 directories and can open chracter streams.
1196 Furthermore, <code>xtc.util.Tool</code> now allows for the
1197 specification of character encodings on the command line. As a
1198 result, <em>Rats!</em> now supports user-specified character
1199 encodings. Thanks to Steven Foster for raising the issue of character
1200 encodings.
1201
1202 <p />This release fixes the following bugs in <strong>XForm</strong>,
1203 the AST query and transformation engine:<ul>
1204
1205 <li>When creating new AST nodes in nested expressions, XForm now
1206 correctly sets the newly created nodes' parents.</li>
1207
1208 <li>A duplicate call to <code>Iterator.next()</code> has been removed
1209 when processing ASTs.</li>
1210
1211 <li>A duplicate loop when processing <code>for</code> expressions has
1212 beeen removed.</li>
1213
1214 <li>Duplicate processing of inputs in the XForm driver has been
1215 removed.</li>
1216
1217 </ul>Thanks to Karen Osmond for identifying several of these issues,
1218 and thanks to Laune Harris for fixing them.
1219
1220 <p />Finally, this release makes the following <strong>miscellaneous
1221 changes</strong>:<ul>
1222
1223 <li><code>xtc.util.Pair</code> now has improved support for treating
1224 pairs as lists. In particular, the following methods have been
1225 added: <code>hashCode()</code> to determine a list's
1226 hashcode, <code>equals()</code> to test for list equality,
1227 <code>toString()</code> to determine a list's human-readable
1228 representation, <code>get()</code> and <code>set()</code> to access a
1229 list's elements, <code>contains()</code> and <code>consists()</code>
1230 to test for a list's elements, and <code>setLastTail()</code>
1231 and <code>append()</code> to append two lists (either destructively or
1232 not).</li>
1233
1234 <li><code>Pair</code> has also been changed to
1235 implement <code>Iterable&lt;T&gt;</code>, thus enabling the use of
1236 pairs in Java's enhanced for loop. Thanks to Petar Maymounkov for
1237 suggesting this change.</li>
1238
1239 <li>The new <code>printHeader()</code> method
1240 in <code>xtc.util.Tool</code> prints a header appropriate for
1241 machine-generated code. <em>Rats!</em> has been updated to use this
1242 method.</li>
1243
1244 <li>The new <code>xtc.type.SourcePrinter</code> prints types (that is,
1245 instances of <code>xtc.type.Type</code>) as C source
1246 declarations.</li>
1247
1248 <li>The <code>xtc.type.TypePrinter</code> now tracks already printed
1249 compound types and prints just a reference on subsequent encounters
1250 (instead of printing the complete type). This change avoids an
1251 infinite recursion when a complex type references itself, e.g., a C
1252 structure containing a pointer itself.</li>
1253
1254 <li><code>xtc.tree.Printer</code> now supports <code>close()</code>.
1255 Furthermore, a <code>NullPointerException</code> when
1256 invoking <code>reset()</code> on a <code>Printer</code> that does not
1257 buffer the output has been fixed. Thanks to Patrick Winters for
1258 identifying the latter issue.</li>
1259
1260 <li>A <code>NullPointerException</code> when
1261 invoking <code>dump()</code> on
1262 a <code>xtc.util.SymbolTable.Scope</code> containing
1263 a <code>null</code> value has been fixed. Thanks to Laune Harris for
1264 identifying this issue.</li>
1265
1266 <li>The unnecessarily complex <code>fmt()</code>
1267 and <code>msg()</code> methods of <code>xtc.util.Utilities</code> have
1268 been removed after refactoring the error reporting code
1269 in <code>xtc.parser.ParserBase</code>
1270 and <code>xtc.util.Runtime</code>.</li>
1271
1272 </ul>
1273
1274 </dd>
1275
1276 <!-- ======================================================================= -->
1277
1278 <dt>1.10.0 (12/24/06)</dt>
1279
1280 <dd>Major feature and bug fix release.
1281
1282 <p />All code is now compiled with <strong>Java 5</strong>:<ul>
1283
1284 <li>Most classes in the <code>xtc.util</code>, <code>xtc.tree</code>,
1285 <code>xtc.parser</code>, and <code>xtc.type</code> packages have been
1286 updated to utilize the new language features, notably generics. As
1287 part of the conversion process, many classes have been simplified,
1288 notably by replacing explicit iterations with for-each loops.</li>
1289
1290 <li>Most code in the <code>xtc.lang</code> and <code>xtc.xform</code>
1291 packages still needs to be updated and thus results in "unchecked
1292 operation" warnings.</li>
1293
1294 <li>The ANTLR- and JavaCC-generated Java parsers
1295 in <code>xtc.lang.antlr</code> and <code>xtc.lang.javacc</code> have
1296 been annotated with "<code>@SuppressWarnings("unchecked")</code>" to
1297 avoid unnecessary warnings; since they depend on external tools, they
1298 will not be updated to Java 5.</li>
1299
1300 <li>Tools such
1301 as <a href="http://retroweaver.sourceforge.net/">Retroweaver</a>
1302 or <a
1303 href="http://retrotranslator.sourceforge.net/">Retrotranslator</a> can
1304 be used to backport compiled binaries to version 1.4 virtual machines.
1305 Furthermore, parsers generated with the <code>rawTypes</code> grammar
1306 attribute will still compile with previous versions of the runtime
1307 classes (after removing one annotation, see below).</li>
1308
1309 <li>Documentation generation has been fixed to automatically link to
1310 Sun's web site for version 1.5 of the Java platform libraries.</li>
1311
1312 </ul>
1313
1314 <p />This release makes the following changes
1315 to <strong><em>Rats!</em></strong>:<ul>
1316
1317 <li>If a repetition, option, or nested choice that is not the last
1318 expression in a sequence contains only nonterminals referencing void
1319 productions, voided expressions, or predicates, <em>Rats!</em> now
1320 automatically voids the entire repetition, option, or nested choice.
1321 For example, if <code>nt</code> references a void production, then
1322 "<code>nt*</code>" is now treated as "<code>void:(nt*)</code>".</li>
1323
1324 <li>The declared type of a production's semantic value may now be a
1325 parameterized type such as "<code>Set&lt;Integer&gt;</code>" or
1326 "<code>Map&lt;String,&nbsp;Integer&gt;</code>". Note
1327 that <em>Rats!</em> does not recognize wildcards. It does, however,
1328 allow white space (but not comments) between typenames, type argument
1329 brackets, and commas.</li>
1330
1331 <li>The new <code>rawTypes</code> grammar attribute
1332 instructs <em>Rats!</em> not to use generics and to include a
1333 "<code>@SuppressWarnings("unchecked")</code>" annotation in the
1334 generated parser. Otherwise, <em>Rats!</em> now leverages xtc's new
1335 support for Java 1.5. Performance measurements of the Java parser
1336 show that (1) there is <em>no</em> difference in throughput or heap
1337 utilization between the version using generic types and the version
1338 using raw types and (2) both versions running on the Java 5 virtual
1339 machine are 4-6% slower than previous versions of xtc running on the
1340 Java 1.4 virtual machine for Mac OS X.</li>
1341
1342 <li>The untyped <code>set</code> grammar attribute has been replaced
1343 by the more specific <code>setOfString</code> grammar attribute.
1344 Other type-specific set attributes will be added as needed.</li>
1345
1346 <li>The new "<code>-ast</code>" command line option
1347 instructs <em>Rats!</em> to print a description of a grammar's
1348 abstract syntax tree as an ML-like type definition; it only considers
1349 generic productions.</li>
1350
1351 <li>Parsers now correctly import <code>xtc.tree.Node</code> even if
1352 the <code>dump</code> option is specified. Thanks to Sukyoung Ryu for
1353 identifying this bug.</li>
1354
1355 <li>Semantic predicates spanning several source lines in a grammar now
1356 result in correct code (instead of each line being terminated with
1357 "<code>)&nbsp;{</code>"). Thanks to Sukyoung Ryu for identifying this
1358 bug.</li>
1359
1360 <li>Ordered choices in syntactic predicates within generic productions
1361 are now correctly lifted into void productions instead of into
1362 productions returning <code>Object</code> as the semantic value.</li>
1363
1364 <li>A voided expression nested within another voided expression
1365 without parentheses, i.e. "<code>void:void:<em>expr</em></code>", is
1366 now parsed as a voided expression and not a voided binding to the
1367 (illegal) identifier "<code>void</code>". The redundant voiding
1368 operator is ignored.</li>
1369
1370 <li>Parser actions do not result in "last element in alternative
1371 without semantic value" errors anymore.</li>
1372
1373 <li>If an alternative's first expression is a followed-by syntactic
1374 predicate and that predicate is followed by a string literal, string
1375 match, or parser action, the parser generator now creates correct code
1376 instead of using the <code>yyBase</code> variable without declaring
1377 it. Thanks to Sukyoung Ryu for identifying this bug.</li>
1378
1379 <li>Parsers do not include casts to <code>Pair</code> anymore when
1380 creating generic nodes. These casts became unnecessary with the
1381 improved deduction of semantic values' types in release 1.9.0; this
1382 release (1.10.0) further refines type deduction, notably for the types
1383 of repeated expressions.</li>
1384
1385 <li>In addition to the conversion to Java 5, <em>Rats!</em>' code has
1386 been significantly cleaned up. Notably, the
1387 production's <code>element</code> field, which had
1388 type <code>Element</code>, has been replaced by the more specific
1389 <code>choice</code> field (of type <code>OrderedChoice</code>). Next,
1390 an ordered choice's alternatives are now sequences (and not arbitrary
1391 elements anymore). Finally, all properties used by the parser
1392 generator are now collected in the new <code>Properties</code>
1393 class.</li>
1394
1395 </ul>
1396
1397 <p />A bug in the implementation of <strong>generic nodes</strong> has
1398 been fixed: <code>GNode.ensureVariable()</code> does not reverse the
1399 children anymore if it is invoked on a generic node with a fixed
1400 number of children.
1401
1402 <p />Support for <strong>language tools</strong> has been improved by
1403 adding two new methods to <code>xtc.util.Tool</code>:
1404 The <code>process(String)</code> method recursively processes the file
1405 with the specified name and the <code>wrapUp()</code> method is called
1406 after all files have been processed. Thanks to Hunter Freyer for
1407 suggesting these improvements.
1408
1409 <p />The <strong>Java grammar</strong> has been changed to support an
1410 optional comma in array initializers and to allow single-line comments
1411 to be terminated by the end-of-file. Thanks to Martin Hirzel for
1412 identifying and fixing these issues.
1413
1414 <p />The Java simplifier now correctly processes <code>this()</code>
1415 and <code>super()</code> call expressions. Thanks to William Moy for
1416 identifying this bug.
1417
1418 <p />Finally, this release changes the <strong>C type checker</strong>
1419 to correctly use composite types for function definitions following
1420 one or more declarations.
1421
1422 </dd>
1423
1424 <!-- ======================================================================= -->
1425
1426 <dt>1.9.3 (9/20/06)</dt>
1427
1428 <dd>Minor bug fix release.
1429
1430 <p />This release fixes bugs when pretty printing switch, case, and
1431 default constructs for Java ASTs. Thanks to William Moy for pointing
1432 out this issue.
1433
1434 <p />Thanks to Martin Hirzel, this release also improves the
1435 documentation for the Java AST simplifier.
1436
1437 </dd>
1438
1439 <!-- ======================================================================= -->
1440
1441 <dt>1.9.2 (9/12/06)</dt>
1442
1443 <dd>Minor bug fix release.
1444
1445 <p />Thanks to Martin Hirzel, this release includes further fixes for
1446 simplifying and printing Java abstract syntax trees.
1447
1448 </dd>
1449
1450 <!-- ======================================================================= -->
1451
1452 <dt>1.9.1 (9/7/06)</dt>
1453
1454 <dd>Minor bug fix release.
1455
1456 <p />Thanks to Martin Hirzel, this release fixes a bug when processing
1457 assignments during simplification of abstract syntax trees for Java.
1458
1459 </dd>
1460
1461 <!-- ======================================================================= -->
1462
1463 <dt>1.9.0 (9/5/06)</dt>
1464
1465 <dd>Major feature and bug fix release.
1466
1467 <p />xtc now requires <strong>JDK 1.5</strong> to build and run.
1468 While xtc still is written in version 1.4 of the Java language, it now
1469 uses classes and interfaces from version 1.5 of the platform
1470 libraries. Notably, all uses of <code>StringBuffer</code> have been
1471 replaced with <code>StringBuilder</code>.
1472
1473 <p />The interface to <strong>abstract syntax tree nodes</strong> has
1474 been generalized by moving the methods for generic tree traversal and
1475 for adding/removing children from <code>xtc.tree.GNode</code> up
1476 to <code>xtc.tree.Node</code>. As part of that
1477 move, <code>hasChildren()</code> was renamed to <code>isEmpty()</code>
1478 and <code>children()</code> to <code>iterator()</code> to be more
1479 consistent with the Java platform libraries.
1480
1481 <p />To avoid forcing every subclass into implementing these methods,
1482 <code>Node</code> provides default implementations for all methods,
1483 which effectively signal unsupported operation exceptions. Code using
1484 nodes can determine whether a node actually supports generic tree
1485 traversal through the <code>hasTraversal()</code> method and
1486 adding/removing children through the <code>hasVariable()</code>
1487 method. To support generic tree traversal, a subclass only needs to
1488 implement the <code>size()</code>, <code>get(int)</code>, and
1489 <code>set(int,&nbsp;Object)</code> methods. To support
1490 adding/removing children, a subclass only needs to implement the
1491 <code>add(Object)</code>, <code>add(int,&nbsp;Object)</code>
1492 and <code>remove(int)</code> methods.
1493
1494 <p />Support for AST annotations has been improved,
1495 with <code>xtc.tree.Annotation</code> now supporting generic
1496 annotations through the <code>before1()</code>, <code>after1()</code>,
1497 <code>round1()</code>, and <code>variable()</code> factory methods.
1498 Furthermore, the new node type <code>xtc.tree.Token</code> supports
1499 the representation of source file symbols as nodes.
1500
1501 <p />In the presence of annotations and tokens, instance tests and
1502 casts on objects returned from an AST node may not work as expected.
1503 Code processing trees should use <code>getString()</code> to access
1504 string children and <code>getGeneric()</code> to access generic nodes.
1505 Furthermore, it should use <code>Token.test()</code>
1506 and <code>Token.cast()</code> to test for and cast to strings and
1507 <code>GNode.test()</code> and <code>GNode.cast()</code> to test for
1508 and cast to generic nodes.
1509
1510 <p />All code using generic nodes has been updated to reflect the new
1511 interface. Furthermore, <code>xtc.tree.Printer.format()</code> now
1512 accepts any node and uses generic traversal to print that node.
1513
1514 <p />xtc now includes working support for <strong>semantic
1515 analysis</strong> of C. <code>xtc.lang.CAnalyzer</code> provides a
1516 type checker for C99 and commonly used GCC extensions. While it
1517 successfully passes most of GCC's regression tests, its support for
1518 C99's variable length arrays is not yet complete. It also does not
1519 support GCC's <code>extern inline</code> functions and variables in
1520 specified registers. In support of <code>CAnalyzer</code>,
1521 the <code>xtc.type</code> package has been significantly improved,
1522 notably with a class hierarchy of references to model the memory
1523 layout of lvalues. Several bugs have also been fixed. Furthermore,
1524 the creation of fresh symbols in <code>xtc.util.SymbolTable</code> has
1525 been fixed so that symbols are, in fact, fresh.
1526
1527 <p />The new type checker is invoked through the <code>-analyze</code>
1528 command line option to <code>xtc.lang.CDriver</code>.
1529 The <code>-strict</code> option instructs the C driver to disable
1530 GCC's extensions. The <code>-markAST</code> option instructs the C
1531 driver to annotate AST nodes with their types. Finally,
1532 the <code>-printSymbolTable</code> instructs the C driver to print the
1533 symbol table after analysis.
1534
1535 <p />The <strong>C grammar</strong> has been extended with support for
1536 unnamed struct and union fields within structs and unions.
1537 Furthermore, an initialized declarator now starts with an optional
1538 attribute specifier list, shifting all previous component expressions.
1539 Next, the C grammar now recognizes
1540 GCC's <code>__builtin_offsetof()</code> function
1541 and <code>__complex__</code> as an alternative to
1542 C99's <code>_Complex</code>. Finally, the order of identifiers and
1543 constants in <code>PrimaryExpression</code> has been reversed, so that
1544 wide C character and string constant are now correctly recognized.
1545
1546 <p />This release makes the following changes
1547 to <strong><em>Rats!</em></strong>:<ul>
1548
1549 <li>In generic productions, alternatives with semantic actions that
1550 assign <code>yyValue</code> are now treated just like bindings
1551 to <code>yyValue</code>: the parser uses the explicitly specified
1552 value instead of creating a new generic node.</li>
1553
1554 <li>The parser generator now deduces that the semantic value of a
1555 sequence without any elements is <code>null</code>. Module
1556 <code>xtc.util.Null</code> has been updated accordingly, removing the
1557 explicit semantic action.</li>
1558
1559 <li>The parser generator now more precisely deduces the type of
1560 productions containing an automatically recognized <code>null</code>
1561 value. In particular, productions representing desugared options now
1562 have the type of the optional expression and not
1563 necessarily <code>Object</code> anymore.</li>
1564
1565 <li>The parser generator now checks that an expression appearing in a
1566 repetition does not match the empty input. Otherwise, <em>Rats!</em>
1567 reports an error. This checks prevents infinite recursions during
1568 parser execution. Thanks to Christine Flood for identifying this
1569 issue.</li>
1570
1571 <li>Similarly, the parser generator now checks that an expression
1572 appearing in an option does not match the empty input.
1573 Otherwise, <em>Rats!</em> reports a warning.</li>
1574
1575 <li>The parser generator now checks that every alternative in a
1576 production sets the semantic value, either because the grammar
1577 specifies the value or because <em>Rats!</em> has deduced the value.
1578 Otherwise, <em>Rats!</em> reports an error. This check preempts Java
1579 compiler errors reporting that "variable yyValue might not have been
1580 initialized".</li>
1581
1582 <li>Module resolution has been modified to preserve the source
1583 location of nonterminals. It does not replace each nonterminal with
1584 the nonterminal from the defining production anymore.</li>
1585
1586 <li>If a grammar has the <code>genericAsVoid</code> attribute,
1587 productions with type <code>Node</code> are now automatically voided
1588 as well.</li>
1589
1590 <li>For generic productions, <code>yyValue</code> is now declared as
1591 <code>Node</code> and not as <code>GNode</code>.</li>
1592
1593 <li>Code generation has been modified so that, if the semantic value
1594 of an optional expression in a generic production is a list (i.e.,
1595 <code>xtc.util.Pair</code>), parsers now add the list's values to the
1596 production's generic node only if the list is not <code>null</code>.
1597 As a result, parsers for grammars containing such expressions do not
1598 fail with a null pointer exception anymore. Thanks to Uwe Simm for
1599 identifying this issue.</li>
1600
1601 <li>The old transformer phase (see release notes for 1.8.2) and any
1602 supporting code have been removed from <em>Rats!</em>.</li>
1603
1604 </ul>
1605
1606 All grammars have been updated to use <code>Node</code> (instead
1607 of <code>GNode</code>) as the type of productions that pass generic
1608 node values through. That way, they can accommodate annotated nodes.
1609
1610 <p />The <strong>XForm</strong> AST query and transformation engine
1611 now supports add and remove operations. For example, "<code>add
1612 Child&lt;&gt; to //Parent</code>" adds a <code>Child</code> node to
1613 all <code>Parent</code> nodes in the AST, and "<code>remove
1614 //SomeName</code>" removes all <code>SomeName</code> nodes from the
1615 AST. Additionally, an out of range or otherwise malformed integer
1616 predicate no longer causes a runtime exception; rather, an empty
1617 sequence is returned.
1618
1619 </dd>
1620
1621 <!-- ======================================================================= -->
1622
1623 <dt>1.8.2 (8/8/06)</dt>
1624
1625 <dd>Minor feature and bug fix release.
1626
1627 <p />This release improves <strong><em>Rats!</em></strong> by
1628 featuring a completely rewritten <code>Transformer</code> phase. This
1629 phase deduces semantic values, lifts nested choices, repetitions, and
1630 options, and desugars repetitions and options. The rewritten code is
1631 more modular and (hopefully) more easily maintainable. It also is
1632 more accurate in deducing semantic values and more uniform in
1633 processing (deeply) nested choices, repetitions, and options. As a
1634 result, the rewritten code also fixes a regression identified by
1635 Thomas Moschny.
1636
1637 <p />A set of regression tests for <em>Rats!</em> has been added. The
1638 tests are invoked by typing <code>make&nbsp;check-rats</code> in the
1639 top-level directory of the distribution.
1640
1641 <p />The old version of the transformer phase is still available
1642 through the <code>-oldTransform</code> command line option
1643 to <em>Rats!</em>. However, it is deprecated and will be removed in
1644 the near future.
1645
1646 <p />Error checking of grammars has been improved. In particular:<ul>
1647
1648 <li><em>Rats!</em> now checks that the (unqualified) name of the
1649 top-level module is consistent with the (unqualified) name of its
1650 file.</li>
1651
1652 <li><em>Rats!</em> also checks that a production does not have both
1653 <code>inline</code> and <code>transient</code> attributes,
1654 since <code>inline</code> subsumes <code>transient</code>.</li>
1655
1656 <li>Finally, <em>Rats!</em> now checks that bindings are not bound
1657 again and that predicates are neither bound nor matched.</li>
1658
1659 </ul>
1660
1661 <p />The folding of equal sequences has been modified so that it does
1662 not result in a trailing choice of empty alternatives anymore.
1663
1664 <p />Code generation has been modified to avoid declaring and
1665 assigning the <code>yyPredIndex</code> variable if the variable's
1666 value is never used. Thanks to Thomas Moschny (and Eclipse) for
1667 pointing out this issue.
1668
1669 <p />This release improves the <strong>Java grammar</strong> by adding
1670 support for empty declarations (a semicolon by itself), assert
1671 statements, and class selection expressions. Thanks to Terence Parr
1672 for identifying these issues.
1673
1674 <p />This release also contains a snapshot of the on-going effort
1675 towards supporting <strong>semantic analysis</strong>. Notably,
1676 the <code>xtc.type</code> package has been significantly improved and
1677 <code>xtc.lang.CAnalyzer</code> has been updated accordingly.
1678 However, for now, typing of C programs still is buggy and incomplete.
1679
1680 <p />Finally, unnecessary import declarations have been removed
1681 throughout xtc, including from parsers generated by <em>Rats!</em>.
1682
1683 </dd>
1684
1685 <!-- ======================================================================= -->
1686
1687 <dt>1.8.1 (6/10/06)</dt>
1688
1689 <dd>Minor bug fix release.
1690
1691 <p />This release renames <code>xtc.parser.BaseParser</code> to
1692 <code>ParserBase</code> and <code>xtc.parser.PackratParser</code>
1693 to <code>FullParserBase</code>.
1694 Additionally, <code>FullParserBase</code> now inherits from
1695 <code>ParserBase</code> to avoid code duplication.
1696
1697 <p />Next, this release makes the following changes to <em>Rats!</em>'
1698 code generator:
1699 <ul>
1700
1701 <li>Parser classes now inherit from the
1702 renamed <code>ParserBase</code> and <code>FullParserBase</code>
1703 classes.</li>
1704
1705 <li>Self-assignments of index variables are now suppressed. Thanks to
1706 Thomas Moschny for reporting this issue.</li>
1707
1708 <li>Bindings for optional expressions are now declared with the types
1709 of the bound values, even if several optional expressions with
1710 different types appear in a sequence. <em>Rats!</em>' own grammar has
1711 been updated accordingly, removing now unnecessary explicit casts.
1712 Thanks to Thomas Moschny for reporting this issue.</li>
1713
1714 </ul>
1715
1716 <p />This release also fixes a bug
1717 in <code>xtc.lang.JavaAstSimplifier</code>
1718 and <code>xtc.lang.JavaPrinter</code> that caused a null pointer
1719 exception when pretty printing simplified method declarations. The
1720 fixed version of <code>JavaAstSimplifier</code> preserves the number
1721 of children in <code>MethodDeclaration</code> AST nodes.
1722
1723 </dd>
1724
1725 <!-- ======================================================================= -->
1726
1727 <dt>1.8.0 (6/6/06)</dt>
1728
1729 <dd>Major feature and bug fix release.
1730
1731 <p />This release considerably improves xtc's support for
1732 the <strong>semantic analysis</strong> of programs. In particular,
1733 the new <code>xtc.util.SymbolTable</code> class implements a scoped
1734 symbol table that easily integrates with AST traversal through xtc's
1735 visitors. The new <code>xtc.type</code> package provides
1736 representations for a program's types. It currently covers all of C's
1737 and Java's types (as of JDK 1.4). The
1738 new <code>xtc.lang.CAnalyzer</code> visitor leverages the new classes
1739 to fill in the symbol table for a program and to check semantic
1740 correctness along the way. However, <code>CAnalyzer</code> is still
1741 incomplete and buggy.
1742
1743 <p />The new interface <code>xtc.Limits</code> specifies
1744 the <strong>integer range limits</strong> for a local system's C
1745 compiler. The version distributed with xtc's release is consistent
1746 with GCC for Mac OS X on the PowerPC and for Mac OS X, Linux, and
1747 Windows on x86 processors. <code>limits.c</code> in the same package
1748 can be used to generate the correct limits for other operating systems
1749 and architectures.
1750
1751 <p />Next, the <strong>C grammar</strong> has been changed as
1752 following:<ul>
1753
1754 <li>Typedef's enum constants are now treated as regular identifiers
1755 and not as type aliases anymore.</li>
1756
1757 <li>Redefinitions of variables, functions, and typedef names within
1758 the same scope are now ignored by the C parser's internal state, as
1759 they are erroneous anyway.</li>
1760
1761 <li>Each component of an integer or floating point type specifier and
1762 each kind of storage class specifier now results in the creation of a
1763 separate AST node. The pretty printer has been changed accordingly.
1764 This change simplifies semantic analysis.</li>
1765
1766 <li>Array qualifiers are now represented by regular type
1767 specifiers/qualifiers instead of dedicated array qualifier nodes. The
1768 pretty printer has been changed accordingly.</li>
1769
1770 <li>The recognition of GCC attributes now is more accurate. The
1771 productions and AST nodes for initialized declarators and bit fields
1772 have been modified, and a new production and AST node for attributed
1773 abstract declarators have been added. The pretty printer has been
1774 changed accordingly.</li>
1775
1776 <li>Support for imaginary numbers has been removed, since they
1777 (thankfully) are not part of the C standard anymore.</li>
1778
1779 <li><code>xtc.lang.CParserState</code>, which is used to disambiguate
1780 typedef names from object, function, or <code>enum</code> constant
1781 names, has been changed to support subclassing and thus to simplify
1782 the implementation of extensions to the C language.</li>
1783
1784 </ul>
1785
1786 <p />Next, the <strong>Java grammar</strong> has been improved by
1787 using more descriptive names for a large number of productions, by
1788 optimizing several productions, and by eliminating the creation of
1789 unnecessary AST nodes. The Java printer has been updated accordingly.
1790
1791 <p />Both the recognizer-only and the AST-building Java parsers are
1792 now generated from the <em>same</em> grammar through the
1793 new <code>genericAsVoid</code> grammar attribute (see below). The
1794 top-level module for both versions is <code>xtc.lang.Java</code> and
1795 the corresponding parsers now are <code>xtc.lang.JavaRecognizer</code>
1796 (no AST) and <code>xtc.lang.JavaParser</code> (AST).
1797
1798 <p />To better evaluate and compare parser performance,
1799 the <strong>Java driver</strong> can now generate ASTs when using
1800 JavaCC- or ANTLR-generated parsers. The AST-building JavaCC grammar
1801 has been generated
1802 with <a href="http://compilers.cs.ucla.edu/jtb/">Java Tree Builder</a>
1803 (version 1.2.2) from the original JavaCC grammar (dated 5/5/02). The
1804 AST-building ANTLR grammar is distributed by the ANTLR project, with
1805 the recognizer-only version being manually derrived from the original.
1806 Both versions of the ANTLR grammar have been updated to version 1.21.
1807
1808 <p />The xtc distribution now contains support
1809 for <strong>SDF</strong> and <strong>Elkhound</strong> generated Java
1810 parsers (again to evaluate and compare parser performance):<dl>
1811
1812 <dt>SDF</dt>
1813
1814 <dd>The new top-level <code>glr</code> directory contains Java 1.5 and
1815 1.4 grammars for SDF. The 1.5 version is the grammar from the
1816 <a
1817 href="http://www.program-transformation.org/Stratego/JavaFront">java-front
1818 0.8</a> distribution (with a differently named top-level module) and
1819 the 1.4 version has been derrived from the former by removing support
1820 for generics, the enhanced for loop, typesafe enums, varargs, static
1821 imports, and metadata. The <code>glr/buildsdf.sh</code> script is
1822 used to generate the corresponding parse tables and
1823 the <code>data/sdf.sh</code> script is used to perform a performance
1824 evaluation. The <code>buildsdf.sh</code> script depends on the
1825 <code>pack-sdf</code> and <code>sdf2table</code> tools, while the
1826 <code>sdf.sh</code> script depends on the <code>sglr</code>
1827 and <code>sglri</code> tools.</dd>
1828
1829 <dt>Elkhound</dt>
1830
1831 <dd>The Elkhound-based Java parser, called Ella, is contained in the
1832 <code>glr/ella</code> directory. It includes the corresponding
1833 lexical, syntactic, and AST specifications as well as any supporting
1834 C++ code. Ella depends on
1835 the <code>smbase</code>, <code>ast</code>, <code>elkhound</code>, and
1836 <code>elsa</code> packages from Elkhound's source distribution. It
1837 can be built by copying the corresponding directories into
1838 the <code>glr</code> directory and then
1839 executing <code>./configure</code> and <code>make</code> in that
1840 directory. The <code>data/ella.sh</code> script is used to evaluate
1841 Ella's performance.</dd>
1842
1843 </dl>
1844
1845 <p />This release makes the following changes
1846 to <strong><em>Rats!</em></strong>:<ul>
1847
1848 <li>The grammar-wide <code>reserved</code> attribute has been replaced
1849 with the new <code>set</code> attribute, which results in the
1850 generation of a static final set with the attribute's value as its
1851 name. It also results in the inclusion of a convenience
1852 method <code>add(Set,Object[])</code> for filling this set. The
1853 XForm, C, and Java grammars have been modified accordingly.</li>
1854
1855 <li>The new grammar-wide <code>genericAsVoid</code> attribute can be
1856 used to generate a parser that only recognizes a language but does not
1857 build an AST from the same tree-building grammar. It is now used for
1858 generating the recognizer-only Java parser from
1859 the <code>xtc.lang.Java</code> module.</li>
1860
1861 <li>Nonterminals may contain the underscore character again, but only
1862 if it appears within a name but not at the beginning or end.</li>
1863
1864 <li>The cost (<code>-Ocost</code>), choices2
1865 (<code>-Ochoices2</code>), and prefixes (<code>-Oprefixes</code>)
1866 optimizations are now enabled by default. The choices2 optimization
1867 now only inlines productions that have been marked with the
1868 new <code>inline</code> attribute. Otherwise, this attribute is
1869 semantically equivalent to <code>transient</code>.</li>
1870
1871 <li>The new gnodes optimization (<code>-Ognodes</code>) leverages
1872 <code>xtc.tree.GNode</code>'s new factory methods to create leaner
1873 generic nodes. It is enabled by default.</li>
1874
1875 <li>The new <code>-lgpl</code> option generates parsers that are not
1876 restricted by the GPL. Parsers generated with this option use the
1877 new <code>xtc.parser.BaseParser</code> base class, which, unlike
1878 <code>xtc.parser.PackratParser</code>, does not reference any classes
1879 released under the GPL.</li>
1880
1881 <li>A performance bug in the select optimization
1882 (<code>-Oselect</code>) has been fixed. Thanks to Laune Harris for
1883 helping to identify and fix this issue.</li>
1884
1885 <li>A long-standing bug in the application of actions
1886 (<code>xtc.util.Action</code>) has been fixed. Actions are used to
1887 construct left-recursive data structures from right-recursive
1888 productions. But their application did not annotate nodes with
1889 source code locations; this has been fixed through the new
1890 <code>PackratParser.apply(Pair, Object, int)</code> method.
1891 Furthermore, the <code>Action</code> class has been turned into an
1892 interface.</li>
1893
1894 <li>A bug in the code generator has been fixed so that bindings with
1895 the same name occurring in subsequent repated or optional expressions
1896 do not result in compiler errors anymore.</li>
1897
1898 </ul>
1899 As a result of these changes, the throughput of the AST-building Java
1900 parser has improved by 31.5% and the throughput of the C parser has
1901 improved by 52%.
1902
1903 <p />Thanks to Laune Harris, this release makes the following major
1904 changes to <strong>XForm</strong>:<ul>
1905
1906 <li>XForm's expressivity has been significantly improved. Notably,
1907 XForm now supports node insertion ("<code>insert before</code>" and
1908 ("<code>insert after</code>") and set difference
1909 ("<code>differ</code>"). Next, arbitrary expressions including
1910 function calls can now appear in predicates. Finally, function
1911 arguments can now be sequences, strings, or integers instead of just
1912 integers.</li>
1913
1914 <li>The XForm function library has been extended, including support
1915 for sequence and string manipulation. Functions defined by XForm do
1916 not need to be explicitly imported anymore.</li>
1917
1918 <li>The XForm driver supports more flexible command line options,
1919 including for specifying the language parser and pretty printer as
1920 well as for measuring engine performance.</li>
1921
1922 <li>New example queries have been added to
1923 the <code>xform/samples</code> directory. In addition an example Java
1924 language extension has been added
1925 to <code>xform/samples/javaproperty</code>.</li>
1926
1927 </ul>
1928 Additionally, several minor XForm bugs have been fixed.
1929
1930 <p />Java's access control is now disabled for <strong>xtc's visitor
1931 dispatch</strong>. As a result, visitors can now be specified as
1932 anonymous inner classes. For example, <code>xtc.lang.CAnalyzer</code>
1933 uses this feature to analyze declaration specifiers and declarators.
1934
1935 <p /><strong>Generic nodes</strong> now need to be created through a
1936 set of factory methods; look for the <code>create()</code> methods
1937 in <code>xtc.tree.GNode</code>. Several of these methods directly
1938 accept a generic node's children and return generic nodes that are
1939 specialized for the specified number of children. As a result, such
1940 fixed size nodes do not support
1941 the <code>add()</code>, <code>addAll()</code>,
1942 and <code>remove()</code> methods defined
1943 by <code>xtc.tree.GNode</code>. They can be distinguished from
1944 variable sized nodes through <code>isVariable()</code> and converted
1945 to variable sized nodes through <code>ensureVariable(GNode)</code>.
1946 <em>Rats!</em>' new gnodes optimization (see below) utilizes these
1947 factory methods to reduce the memory and performance overhead of
1948 parsers with generic productions.
1949
1950 <p />This release introduces improved support for <strong>building
1951 language tools with xtc</strong>. In particular, the
1952 new <code>xtc.util.Runtime</code> class manages command line options,
1953 errors and warnings, and output to the standard console. The
1954 new <code>xtc.util.Tool</code> class provides a skeleton tool
1955 implementation, including support for several default command line
1956 options. <em>Rats!</em> and the C, Java, and XForm drivers have been
1957 rewritten to utilize both classes. Note that, as a result of this
1958 rewrite, some command line options for these tools have changed.
1959
1960 <p />This release also introduces our first <strong>unit
1961 tests</strong>. We rely
1962 on <a href="http://www.junit.org/index.htm">JUnit</a> as our unit
1963 testing framework and JUnit's binary release (<code>junit.jar</code>)
1964 must be in the classpath. Thanks to Anh Le, this release also
1965 introduces our first <strong>regression tests</strong>, based on GCC's
1966 regression tests. Just like GCC, we rely
1967 on <a href="http://expect.nist.gov/">expect</a>
1968 and <a href="http://www.gnu.org/software/dejagnu/">DejaGnu</a> to
1969 perform these tests. The
1970 <a href="development.html">description of our development setup</a>
1971 and the sample shell scripts (<code>setup.bat</code>
1972 and <code>setup.sh</code>) have been updated accordingly.
1973
1974 <p />xtc now builds with <strong>JDK 1.5</strong> by passing
1975 the <code>-source 1.4</code> flag to the <code>javac</code> compiler.
1976 All sources remain at Java version 1.4.
1977
1978 <p />xtc's <strong>licensing</strong> has been changed: Most of the
1979 code is now released under the GNU General Public License (GPL)
1980 version 2. The exceptions
1981 are <code>xtc.parser.BaseParser</code>, <code>xtc.parser.Column</code>,
1982 <code>xtc.parser.Result</code>, <code>xtc.parser.SemanticValue</code>,
1983 <code>xtc.parser.ParseError</code>, <code>xtc.tree.Location</code>,
1984 and <code>xtc.util.Pair</code>, which are released under the GNU
1985 Lesser General Public License (LGPL) version 2.1. The main licensing
1986 change is that the option of using later versions of the GPL and LGPL
1987 has been removed.
1988
1989 <p />Thanks to Marco Yuen and Marc Fiuczynski, this release
1990 incorporates <a href="http://c4.cs.princeton.edu/"><strong>C4, the
1991 CrossCutting C Compiler</strong></a>. C4 makes aspect-oriented
1992 software development techniques available to C programmers, with the
1993 goal of simplifying the development of software variants, notably for
1994 the Linux kernel.
1995
1996 </dd>
1997
1998 <!-- ======================================================================= -->
1999
2000 <dt>1.7.1 (8/17/05)</dt>
2001
2002 <dd>Minor feature and bug fix release. This release makes the
2003 following changes to <em>Rats!</em>:<ul>
2004
2005 <li>The new grammar-wide <code>reserved</code> attribute results in
2006 the generation of a static final set of reserved
2007 identifiers <code>RESERVED</code> and a convenience
2008 method <code>reserve(String[])</code> for filling this set. This
2009 attribute eliminates the need for explicitly defining this set in a
2010 body action (though the set still has to be filled in an action).</li>
2011
2012 <li>The new grammar-wide <code>flag</code> attribute results in the
2013 generation of a static final boolean with the attribute's value as its
2014 name. This attribute eliminates the need for explicitly defining such
2015 a flag in a body action.</li>
2016
2017 <li>To effectively support the new <code>flag</code> attribute, the
2018 processing of attributes has been updated. As a result, attributes
2019 such as <code>transient</code>, whose values used to be ignored, now
2020 must not have values. Internally, the
2021 class <code>xtc.tree.AttributeList</code> has been added and
2022 <code>xtc.tree.Attribute.equals()</code> has been changed to take an
2023 attribute's value into account.</li>
2024
2025 <li>A modifying module's attributes now override the modified module's
2026 attributes, with the exception of any
2027 <code>stateful</code>, <code>reserved</code>, or <code>flag</code>
2028 attributes, which are preserved. When pretty printing modules with
2029 the <code>-html</code> command line option, globally effective
2030 attributes are now highlighted (assuming
2031 the <a
2032 href="http://cs.nyu.edu/rgrimm/xtc/grammar.css"><code>grammar.css</code></a>
2033 stylesheet contained in the source distribution's root directory also
2034 is in the same directory as the HTML files).</li>
2035
2036 <li>A modifying module's header, body, and footer actions are now
2037 combined with the modified module's actions.</li>
2038
2039 <li>Modules may now contain no productions at all. This is useful for
2040 separating header, body, and footer actions as well as globally
2041 effective attributes
2042 (i.e., <code>stateful</code>, <code>reserved</code>,
2043 and <code>flag</code>).</li>
2044
2045 <li>Stateful or resetting productions may now appear in a module if
2046 any of the dependent modules has a grammar-wide <code>stateful</code>
2047 attribute and not just the module itself.</li>
2048
2049 <li>Public productions in dependent modules are not treated as
2050 top-level productions anymore.</li>
2051
2052 <li>Qualified nonterminals are now resolved correctly, even if the
2053 corresponding production is defined in module modified by a module
2054 that is imported by the referencing module. Furthermore, the speed of
2055 look-ups in presence of multiple definitions (across all grammar
2056 modules) has been improved.</li>
2057
2058 <li>Sequence names are now preserved when copying sequences.
2059 Furthermore, productions are now correctly removed
2060 by <code>Analyzer.remove(Module)</code>. Finally, ambiguous
2061 nonterminals are now always detected. As a result of these bug fixes,
2062 it is now possible to apply multiple independent modifications to the
2063 same base module. Thanks to Martin Hirzel for identifying the first
2064 bug (whose resolution triggered discovery of the other two).</li>
2065
2066 <li>Error locations are now formatted as
2067 <em>filename</em><code>:</code><em>linenumber</em><code>:</code><em>column-number</em>
2068 to better integrate with Emacs. Thanks to Martin Hirzel for
2069 suggesting this improvement.</li>
2070
2071 </ul>
2072
2073 <p />The C, Java, and XForm grammars have been modified to utilize the
2074 new attributes. Additionally, the C and Java grammars have been
2075 further modularized, up to the respective top-level module, which now
2076 simply modifies another, parameterized module.
2077
2078 <p />Additionally, this release makes the following changes to xtc's C
2079 support:
2080
2081 <ul>
2082
2083 <li><code>xtc.lang.CSymbolTable</code> has been renamed
2084 to <code>CParserState</code> to emphasize that it does not implement a
2085 full symbol table.</li>
2086
2087 <li><code>xtc.lang.CCounter</code> can now print its own statistics
2088 through the <code>print(xtc.tree.Printer)</code> method. It has also
2089 been updated to reflect recent changes in the C grammar. The C driver
2090 has been updated accordingly.</li>
2091
2092 </ul>
2093
2094 <p /><code>xtc.tree.GNode</code>'s interface has been improved. In
2095 particular, <code>numberOfChildren()</code> has been renamed
2096 to <code>size()</code>, <code>addAll(List)</code> has been changed
2097 to <code>addAll(Collection)</code>, and <code>add(int,Object)</code>,
2098 <code>addAll(int,Pair)</code>, and <code>addAll(int,Collection)</code>
2099 have been added.
2100
2101 <p />A bug in XForm, which causes the result of a query to contain
2102 internal item objects, has been fixed.
2103
2104 </dd>
2105
2106 <!-- ======================================================================= -->
2107
2108 <dt>1.7.0 (8/9/05)</dt>
2109
2110 <dd>Major feature release. In short, this release adds a module
2111 system to <em>Rats!</em>, adds support for building and printing an
2112 AST in the Java driver, fixes several bugs in the C parser and
2113 printer, and includes a significantly improved XForm, our AST query
2114 and transformation engine.
2115
2116 <p />In more detail, this release introduces a simple yet powerful
2117 <strong>module system</strong> for <em>Rats!</em>. The module system
2118 supports basic modules to factor grammars into re-usable units. It
2119 supports module modifications to concisely specify extensions.
2120 Finally, it supports module parameters to easily compose different
2121 extensions with each other. As a result, the format of grammar
2122 specifications has been changed and grammars not distributed with this
2123 release need to be modified. The module system is described in detail
2124 in the package documentation for <code>xtc.parser</code>.
2125
2126 <p />To get a peek at modules, execute the following command
2127 in <code>src/xtc/lang</code>:
2128 <pre>
2129 java xtc.parser.Rats -in ../.. -instantiated -html C.rats
2130 </pre>
2131 Then open the resulting <code>xtc.lang.C.html</code> file in your web
2132 browser and explore.
2133
2134 <p />This release makes the following, additional changes
2135 to <em>Rats!</em>:<ul>
2136
2137 <li>The search path for grammar modules can be explicitly specified
2138 from the command line by using one or more <code>-in</code> options.
2139 If no such options are present, the search path is the current
2140 directory.</li>
2141
2142 <li>To help understand and debug grammars, <em>Rats!</em> can now
2143 print all modules after loading (through the <code>-loaded</code>
2144 command line option), after instantiating
2145 (<code>-instantiated</code>), after applying modifications
2146 (<code>-applied</code>), and after all processing
2147 (<code>-processed</code>). If the <code>-html</code> command line
2148 option is present (as illustrated above), the last three printing
2149 options will generate hyperlinked HTML in <em>Rats!</em>' output
2150 directory (which can be set with <code>-out</code>). The
2151 corresponding stylesheet is <code>grammar.css</code>.</li>
2152
2153 <li>Grammar-wide attributes can be specified from the command line by
2154 using one or more <code>-option</code> command line options. Most
2155 attributes have also been renamed. Notably, <code>debug</code> is
2156 now <code>verbose</code>, <code>constantBinding</code> is now
2157 <code>constant</code>, <code>state</code> is now <code>stateful</code>,
2158 <code>reset</code> is now <code>resetting</code>, <code>ignoreCase</code>
2159 is now <code>ignoringCase</code>, and <code>location</code> is now
2160 <code>withLocation</code>. Furthermore, <code>mainMethod</code> is
2161 now <code>main</code> and <code>usePrinter</code> is
2162 now <code>printer</code>.</li>
2163
2164 <li>The character constant has been changed from '<code>.</code>' to
2165 '<code>_</code>'. Nonterminals may not contain underscores
2166 anymore.</li>
2167
2168 <li>A <code>NullPointerException</code> when processing undefined
2169 nonterminals in <code>xtc.parser.TextTester</code> has been
2170 eliminated.</li>
2171
2172 <li>A <code>NullPointerException</code> when processing optional
2173 sequences with no bindable value
2174 in <code>xtc.parser.MetaDataSetter</code> has been eliminated. Thanks
2175 to Stacey Kuznetsov for identifying this bug.</li>
2176
2177 <li>Voided repetitions and options do not result in unnecessary
2178 warnings (indicating a lack of a bindable element) anymore. Thanks to
2179 Stacey Kuznetsov for identifying this bug.</li>
2180
2181 <li>The processing of nested repetitions and options in generic
2182 productions has been improved so that repeated or optional elements
2183 are only bound if strictly necessary.</li>
2184
2185 <li>The voiding of unbound productions has been improved to recognize
2186 more opportunities.</li>
2187
2188 <li>The reporting of parse errors has been improved. The new methods
2189 <code>PackratParser.format(ParseError)</code>
2190 and <code>PackratParser.print(ParseError)</code> simplify the display
2191 of parse errors, while the new
2192 exception <code>xtc.parser.ParseException</code> simplifies the
2193 propagation of parse errors.</li>
2194
2195 </ul>
2196
2197 <p />The <strong>Java driver</strong> can now optionally build an
2198 abstract syntax tree and also pretty print that tree. Thanks to
2199 Stacey Kuznetsov for implementing the necessary changes.
2200
2201 <p />The <strong>C grammar and pretty printer</strong> have been
2202 improved as follows:<ul>
2203
2204 <li>GCC attributes can now appear at the end of parameter
2205 declarations. Thanks to Marco Yuen for identifying this bug and
2206 suggesting a fix.</li>
2207
2208 <li>Obsolete GCC field designations when initializing structures and
2209 unions are now parsed correctly and printed as standard C field
2210 designations. Thanks to Marco Yuen for identifying this
2211 short-coming.</li>
2212
2213 <li>Compiler directives such as line markers nested in structures and
2214 unions are now added as annotations to the correct nodes and printed
2215 correctly.</li>
2216
2217 <li>Field names in structures and unions do not shadow type aliases
2218 anymore. Thanks to Marco Yuen for identifying this bug.</li>
2219
2220 </ul>
2221
2222 <p />XForm, the <strong>query and transformation engine</strong>, has
2223 been improved as follows. Thanks to Joe Pamer for realizing these
2224 changes.<ul>
2225
2226 <li>XForm now supports the <code>or</code> and <code>and</code>
2227 logical operators.</li>
2228
2229 <li>ASTs can now be traversed inside-out (or bottom-up), instead of
2230 only outside-in (or top-down), by using the <code>inside_out</code>
2231 operator.</li>
2232
2233 <li>The structure of results as lists of lists (for example, when
2234 evaluating comma-separated expressions) is now preserved. If
2235 necessary, XForm iterates over individual elements as if such lists of
2236 lists were flat.</li>
2237
2238 <li>Replacement expressions now return the inserted items instead of
2239 the AST's root.</li>
2240
2241 <li>The engine implementation has been rewritten for efficiency, with
2242 considerable savings in heap utilization. In our experiments, the
2243 number of <code>xtc.xform.Item</code> objects allocated while
2244 performing a query has been reduced by a factor of 90.</li>
2245
2246 </ul>
2247
2248 </dd>
2249
2250 <!-- ======================================================================= -->
2251
2252 <dt>1.6.1 (6/11/05)</dt>
2253
2254 <dd>Minor bug fix release. This release eliminates
2255 <code>NullPointerException</code>'s
2256 in <code>xtc.lang.CPrinter.visitStructureDeclarationList()</code> and
2257 in <code>xtc.xform.Item.equals()</code>.
2258
2259 </dd>
2260
2261 <!-- ======================================================================= -->
2262
2263 <dt>1.6.0 (6/11/05)</dt>
2264
2265 <dd>Performance tuning release. This release focuses on improving
2266 performance and a corresponding code clean-up; as a
2267 result, <strong>this release may break existing code</strong>.
2268 Performance tests on an 2002 iMac (with a 800 MHz PowerPC G4 processor
2269 and 1 GB of RAM) show that Java driver throughput has improved by 49%,
2270 from 256 KB/s up to 382 KB/s, and heap utilization has improved by
2271 25%, from 58:1 (i.e., 58 bytes of heap per 1 byte in the input) down
2272 to 43:1. C driver performance for parsing and pretty printing the
2273 entire Linux 2.6.10 kernel (~1,000 files) has improved by 35%, from
2274 211 minutes down to 137 minutes. Improvements are similar for a
2275 faster machine: C driver performance for parsing and pretty printing
2276 the Linux kernel on a 2004 PowerMac (with two 2.5 GHz PowerPC G5
2277 processors and 1 GB of RAM) has improved by 34%, from 56 minutes down
2278 to 37 minutes. All our C driver experiments used a Java heap size of
2279 512 MB (both minimum and maximum size); performance improvements for
2280 configurations with smaller heaps are likely to be much more
2281 pronounced.
2282
2283 <p />In detail, this release makes the following performance-related
2284 improvements:<ul>
2285
2286 <li>Input files are not buffered in their entirety anymore. The
2287 corresponding <code>-buffer</code> and <code>-nobuffer</code> command
2288 line options for <em>Rats!</em> and the C and Java drivers have been
2289 removed. Parse error reporting now uses a new method
2290 (<code>xtc.parser.PackratParser.lineAt()</code>), as input lines are
2291 not directly available
2292 anymore. <code>xtc.util.Utilities.msg()</code>, which is used for
2293 error printing, has been changed accordingly.</li>
2294
2295 <li>All output is now buffered and not flushed on each newline
2296 anymore. <code>xtc.tree.Printer</code>'s constructors have been
2297 changed accordingly.</li>
2298
2299 <li>Productions that are only referenced once within a grammar are now
2300 automatically marked as transient. While such productions were not
2301 memoized before, repetitions appearing in such productions were
2302 desugared into the equivalent right-recursions. With this change,
2303 repetitions are not desugared any more. The command line option
2304 corresponding to this optimization is <code>-Onontransient</code> (for
2305 "optimize non-transient productions"). This optimization is enabled
2306 by default. Since this optimization creates new transient
2307 productions, the <code>-Oerrors2</code> optimization is now disabled
2308 by default.</li>
2309
2310 <li>The C and Java grammars have been modified to optimize the
2311 recognition of hierarchical syntax. Based on a simple, albeit manual
2312 analysis most productions are now marked as transient (unless they are
2313 only referenced once in a grammar and thus automatically recognized as
2314 transient; see above). The analysis compares the tokens appearing
2315 before all occurrences of a nonterminal. If they are all different,
2316 the corresponding production is marked as transient.</li>
2317
2318 <li>The C and Java grammars have also been modified to optimize the
2319 recognition of identifiers and keywords. Additionally, the Java
2320 grammar now relies on <code>Character.isJavaIdentifierStart()</code>
2321 and <code>Character.isJavaIdentifierPart()</code> instead of
2322 (incorrectly specified) explicit character classes.</li>
2323
2324 <li>Where possible, options are not desugared and lifted into their
2325 own productions anymore, but rather implemented directly. The
2326 corresponding command line option for <em>Rats!</em>
2327 is <code>-Ooptional</code>. This optimization is enabled by default.
2328 Note, however, that this optimization may result in a loss of accuracy
2329 for deducing the type of a binding. For example,
2330 if <code>foo:Foo?</code> and <code>bar:Bar?</code> both appear in the
2331 same production, with <code>Foo</code> having <code>String</code> as
2332 its type and <code>Bar</code> having <code>Pair</code>, then the
2333 declared type for both <code>foo</code> and <code>bar</code> is the
2334 common supertype <code>Object</code>.</li>
2335
2336 <li>Direct left-recursive productions are now transformed into
2337 equivalent (transient) iterations instead of (memoized)
2338 right-recursions. The corresponding command line option
2339 for <em>Rats!</em> is <code>-Oleft2</code>. This optimization is
2340 enabled by default. The previously supported transformation into
2341 right-recursions is still available through the <code>-Oleft1</code>
2342 command line option.</li>
2343
2344 <li>The parser code generated for string matches has been optimized.
2345 The corresponding command line option for <em>Rats!</em>
2346 is <code>-Omatches</code>. This optimization is enabled by
2347 default.</li>
2348
2349 <li>The parser code generated for selecting the more specific parse
2350 error has been optimized. The corresponding command line option
2351 for <em>Rats!</em> is <code>-Oselect</code>. This optimization is
2352 enabled by default.</li>
2353
2354 <li>The parser code for setting a node's location has been optimized
2355 to avoid unnecessary <code>instanceof</code> tests and casts. To this
2356 end, <em>Rats!</em> now interprets any import statements in a
2357 grammar's header and tries to analyze the corresponding
2358 classes.</li>
2359
2360 <li>The C and Java drivers now print overall performance statistics
2361 based on a least squares fit of individual data points. The
2362 statistics are the parser throughput in KB/s and the memory
2363 utilization in bytes per byte in the input.</li>
2364
2365 <li>The new grammar-wide <code>dumpTable</code> attribute results in
2366 the generation of a method, <code>dump(xtc.tree.Printer)</code>, to
2367 print the memoization table in a human-readable format. The dump can
2368 be used for analyzing allocation patterns. The C and Java drivers
2369 include a corresponding command line option (<code>-memo</code>),
2370 which casues the memoization table to be printed after a successful
2371 parse. Though, the C and Java grammars do <em>not</em> include the
2372 <code>dumpTable</code> attribute. The
2373 new <code>xtc.parser.TableAnalyzer</code> utility collects and prints
2374 (minimal for now) statistics for a previously dumped memoization
2375 table.</li>
2376
2377 </ul>
2378
2379 <p />Thanks to Adam Kravetz for helping to identify several
2380 opportunities for optimizations.
2381
2382 <p />This release also cleans up the interface between nodes and
2383 visitors. In particular, dispatch can now only be initiated by
2384 calling <code>Visitor.dispatch(Node)</code> (instead
2385 of <code>Node.accept(Visitor)</code>). Furthermore, processing
2386 methods specified as part of nodes are now
2387 named <code>Node.visitWith(Visitor)</code> (instead
2388 of <code>Node.process(Visitor)</code>). In contrast
2389 to <code>accept()</code>, <code>dispatch()</code>
2390 handles <code>null</code> nodes, doing nothing and
2391 returning <code>null</code>. Furthermore, if the
2392 selected <code>visit()</code> or <code>visitWith()</code> method
2393 has <code>void</code> as its return type, <code>dispatch()</code>
2394 returns the specified node (instead of <code>null</code>).
2395
2396 <p /><em>Rats!</em>' internal visitors have been updated to utilize
2397 <code>dispatch()</code>. Additionally, many visitors have been
2398 refactored to utilize a common
2399 superclass, <code>xtc.parser.GrammarVisitor</code>, which reduces code
2400 bloat across <em>Rats!</em>' internal visitors. All visitors
2401 in <code>xtc.lang</code> were already using <code>dispatch()</code>.
2402
2403 <p />Furthermore, this release makes the following changes
2404 to <em>Rats!</em>:<ul>
2405
2406 <li>A grammar's global state object now <strong>must</strong> be reset
2407 explicitly by marking the corresponding productions with
2408 the <code>reset</code> attribute. <em>Rats!</em>' own grammar and the
2409 C grammar have been modified accordingly.</li>
2410
2411 <li>Top-level nonterminals may now be declared as void. The Java
2412 grammar has been modified accordingly.</li>
2413
2414 <li><em>Rats!</em>-generated parsers now support incremental parsing
2415 through the <code>resetTo(int)</code> and <code>isEOF(int)</code>
2416 methods. Incremental parsing is useful for processing interactive or
2417 very large inputs. It is now used by
2418 the <code>xtc.lang.CDriver</code> by default (and disabled through
2419 the <code>-noincr</code> command line option).</li>
2420
2421 <li>Direct left-recursions in void and text-only productions are now
2422 automatically transformed into the corresponding right-recursions,
2423 comparable to the transformation of direct left-recursions in generic
2424 productions. The speed of recognizing transformable productions
2425 in <em>Rats!</em> has also been improved. The Java grammar's
2426 productions for recognizing expressions have been rewritten
2427 accordingly (i.e., left-associative operators are now expressed
2428 through left-recursive productions).</li>
2429
2430 <li>Support for generic text productions (i.e., productions with
2431 pseudo-type "<code>gstring</code>") has been <em>removed</em>. They
2432 provide little benefit with considerable complexity (and code
2433 duplication). The two generic text productions in the C grammar have
2434 been rewritten as regular generic productions.</li>
2435
2436 <li>The new <code>ignoreCase</code> attribute instructs <em>Rats!</em>
2437 to perform comparisons for string matches in a case-insensitive
2438 manner. It applies to either the entire grammar or individual
2439 productions and is useful for languages with case-insensitive
2440 keywords. Note that comparisons for string literals, character
2441 literals, and character classes continue to be case-sensitive, even in
2442 the presence of this attribute. Thanks to Ken Britton for suggesting
2443 this feature and providing me with a prototype
2444 implementation.</li>
2445
2446 <li><em>Rats!</em> now generates an error if <code>transient</code> is
2447 used as a production's type and a warning if any other per-production
2448 attribute is used as a production's type. In either case, the actual
2449 type is probably missing from the production.</li>
2450
2451 <li>The simplification of grammars has been improved, with the result
2452 that fewer repetitions and options need to be lifted into their own
2453 productions.</li>
2454
2455 <li>If the semantic value of a bound repetition in a transient
2456 production cannot be determined, <em>Rats!</em> now issues a warning
2457 and does not fail with a <code>NullPointerException</code> anymore.
2458 If the value of the repeated element is the value of a nonterminal,
2459 the corresponding production is not voided anymore, even if the
2460 repetition is automatically recognized as a production's semantic
2461 value.</li>
2462
2463 <li>Bound repetitions or options in text-only productions are now
2464 always lifted into their own productions, independent of whether they
2465 are desugared or not. As a result, they now produce the correct
2466 semantic value, namely the matched input as a string.</li>
2467
2468 <li>String matches against repetitions or options, which are not
2469 desugared (e.g., because the production is transient), are now
2470 processed correctly by lifting the repetitions or options into their
2471 own productions. As a result, they do not result in a
2472 <code>ClassCastException</code> anymore.</li>
2473
2474 <li>Reference counting now counts nonterminals appearing within
2475 once-or-more repetitions in non-transient productions twice, as the
2476 nonterminal will appear twice in the desugared version. Furthermore,
2477 the recursive nonterminal in directly left-recursive productions is
2478 not counted at all anymore, which is consistent with the transformed
2479 version. As a result of these changes, reference counting can now be
2480 performed before applying transformations, i.e. the <code>Transformer</code>,
2481 <code>DirectLeftRecurser</code>, and <code>Generifier</code>
2482 visitors.</li>
2483
2484 <li>The folding of duplicate productions now takes into account
2485 whether productions are recognized as text-only.</li>
2486
2487 <li>A production containing a lone nonterminal is now inlined only if
2488 it is transient. That way, a production containing a lone nonterminal
2489 can be used to force memoization of another, transient
2490 production.</li>
2491
2492 </ul>
2493
2494 <p />This release also adds support for local label declarations to
2495 the C grammar and pretty printer. Additionally, the C grammar, symbol
2496 table, and pretty printer have been modified, so that annotations
2497 encapsulating regular AST nodes now represent the compiler directives
2498 preceding that node's text in the input (instead of the other way
2499 around).
2500
2501 <p />The new <code>xtc.xform</code> package provides a facility for
2502 querying and transforming abstract syntax trees (ASTs). The query
2503 language is inspired
2504 by <a href="http://www.developer.com/xml/article.php/3344421">XPath
2505 2.0</a>, but has some significant differences, notably to
2506 destructively modify ASTs. Thanks to Joe Pamer for implementing the
2507 query and transformation engine.
2508
2509 </dd>
2510
2511 <!-- ======================================================================= -->
2512
2513 <dt>1.5.2 (3/7/05)</dt>
2514
2515 <dd>Minor feature and bug fix release. This release
2516 changes <em>Rats!</em> so that <em>all</em> repetitions appearing in
2517 transient productions are implemented through iterations and are not
2518 desugared into the corresponding recursive expressions (which can be
2519 used to avoid stack overflow errors for long sequences of
2520 expressions). This release also fixes a bug in <em>Rats!</em>, which
2521 caused repeated sequences to be lifted too aggressively.
2522
2523 <p />All tools now return appropriate exits codes, 0 on successful
2524 executions and 1 on error conditions.
2525
2526 <p />This release also improves the C grammar and pretty printer. In
2527 particular, it fixes bugs in:<ul>
2528 <li class="tight">the recognition of structure and union declarations
2529 (in particular, <code>typedef</code> declarations now only introduce
2530 the identifiers in the declarator list as type names and field names
2531 now properly override type names when preceded by a type
2532 specifier),</li>
2533 <li class="tight">the recognition of <code>goto</code>
2534 statements,</li>
2535 <li class="tight">the recognition of <code>long</code>
2536 and <code>long&nbsp;long</code> constant suffixes (such
2537 as <code>LL</code>),</li>
2538 <li class="tight">the pretty printing of unary expressions with
2539 the <code>+</code>, <code>-</code>, and <code>&amp;</code>
2540 operators,</li>
2541 <li class="tight">the pretty printing of postdecrement
2542 expressions,</li>
2543 <li class="tight">the pretty printing of compound literals.</li>
2544 </ul>
2545 For some nested expressions (such as arithmetic expressions appearing
2546 as operands for the bitwise or operator), the pretty printer now emits
2547 parentheses to avoid warnings when compiling the resulting code with
2548 GCC under the <code>-Wparentheses</code> command line option.
2549
2550 <p />Additionally, the C grammar and pretty printer now support the
2551 following (GCC) extensions:<ul>
2552 <li class="tight"><code>#ident</code> directives in preprocessed
2553 code,</li>
2554 <li class="tight">empty external definitions (i.e., a semicolon by
2555 itself),</li>
2556 <li class="tight">structures and unions with no members,</li>
2557 <li class="tight">extra semicolons in structure and union member
2558 declarations,</li>
2559 <li class="tight"><code>typeof</code> (and underscored variations) as
2560 a type specifier,</li>
2561 <li class="tight">underscored variations of the <code>signed</code>
2562 type specifier,</li>
2563 <li class="tight">ranges in <code>case</code> labels,</li>
2564 <li class="tight">labels without statements at the end of compound
2565 statements,</li>
2566 <li class="tight">assembly statements,</li>
2567 <li class="tight">statements and declarations in expressions,</li>
2568 <li class="tight">ranges in array designators,</li>
2569 <li class="tight"><code>__alignof__</code> as an expression,</li>
2570 <li class="tight">the <code>__builtin_va_arg()</code> function (which
2571 takes a type name as its second argument),</li>
2572 <li class="tight">labels as values,</li>
2573 <li class="tight">attributes (the full GCC mess),</li>
2574 <li class="tight">underscored variations of
2575 the <code>const</code>, <code>volatile</code>
2576 and <code>restrict</code> type qualifiers,</li>
2577 <li class="tight">the <code>__extension__</code> specifier.</li>
2578 </ul>
2579
2580 The C grammar now accepts source files with just white space and
2581 comments. Furthermore, <em>Rats!</em>-generated parsers, when created
2582 with an explicit file size argument to the constructor, now accept
2583 empty files (i.e., of length 0).
2584
2585 <p />The overall effect is that the C driver
2586 (<code>xtc.lang.CDriver</code>) now parses and pretty prints the
2587 entire Linux kernel (version 2.6.8). The resulting source code
2588 compiles with GCC under the <code>-Wall</code> command line option
2589 (and no warnings).
2590
2591 <p />Thanks to Marc Fiuczynski for identifying most of the bugs and
2592 missing language constructs and for testing the C driver against the
2593 Linux kernel.
2594
2595 <p />This release also changes the format of pretty printed ASTs to be
2596 more compact (and to be consistent with the AST query language
2597 currently being developed). Pairs (<code>xtc.util.Pair</code>) are
2598 now mutable, but should still be treated as immutable if they are
2599 memoized by a <em>Rats!</em>-generated parser.
2600
2601 </dd>
2602
2603 <!-- ======================================================================= -->
2604
2605 <dt>1.5.1 (12/16/04)</dt>
2606
2607 <dd>Bug fix release. It makes the following changes:<ul>
2608
2609 <li>The new <code>visible</code> attribute supports the generation of
2610 parsers that are package private (instead of public).</li>
2611
2612 <li>The interface to the global state
2613 object <code>xtc.util.State</code> has been changed to reflect that
2614 state modifications are modeled as lightweight transactions.</li>
2615
2616 <li>A memoization bug resulting in
2617 an <code>ArrayIndexOutOfBoundsException</code> has been fixed; thanks
2618 to Robin Lee Powell for identifying this bug.</li>
2619
2620 <li>A bug resulting in an <code>ArrayIndexOutOfBoundsException</code>
2621 when printing a default parse error (returned by a transient
2622 production under the errors2 optimization) has been fixed; thanks to
2623 Robin Lee Powell for identifying this bug.</li>
2624
2625 <li>The accuracy of error messages under the errors2 optimization has
2626 been improved (by avoiding to return default parse errors).</li>
2627
2628 <li>A new command line option (<code>-out</code>) to select the output
2629 directory for parsers generated by <em>Rats!</em> has been added.
2630 Also, <em>Rats!</em> now prints only errors to the error console.
2631 Both changes improve integration with Ant; thanks to Yonas Jongkind
2632 for suggesting them.</li>
2633
2634 </ul></dd>
2635
2636 <!-- ======================================================================= -->
2637
2638 <dt>1.5.0 (11/11/04)</dt>
2639
2640 <dd>Performance tuning and bug fix release. Parsers generated
2641 by <em>Rats!</em> now use arrays of read-in characters and memoized
2642 results instead of a linked list of parser objects. The current
2643 parser position now is an explicit index into these arrays instead of
2644 a reference to a parser object. Performance tests with the Java
2645 parser show that the parser consumes only half the memory and takes
2646 only 80% the time when recognizing Java source files when compared
2647 with previous versions.
2648
2649 <p /><strong>Note that this release changes the basic parser interface
2650 and is not backwards-compatible.</strong> In particular, parsing
2651 methods now take an explicit index argument
2652 (named <code>yyStart</code>), and the <code>character()</code> method
2653 returns an <code>int</code> instead of a <code>Result</code>.
2654 Furthermore, parsers perform best if they are created with the
2655 three-argument constructor, which includes the length of the input.
2656 For example, the following code snippet parses a file
2657 named <code>fileName</code> of size <code>fileSize</code> with
2658 reader <code>in</code> and top-level production <code>TopLevel</code>:
2659 <pre>
2660 Parser p = new Parser(in, fileName, fileSize);
2661 Result r = p.pTopLevel(0);
2662 </pre>
2663
2664 <p />This release also makes the following changes:<ul>
2665
2666 <li>Productions returning a <code>String</code> value and containing a
2667 parser action were incorrectly treated as text-only productions (bug
2668 fix).</li>
2669
2670 <li>The chunking optimization is now correctly performed when it is
2671 the only optimization (i.e., when using the "<code>-Ochunks</code>"
2672 command line flag; bug fix).</li>
2673
2674 </ul></dd>
2675
2676 <!-- ======================================================================= -->
2677
2678 <dt>1.4.2 (9/23/04)</dt>
2679
2680 <dd>Performance tuning and bug fix release:<ul>
2681
2682 <li>The inlining of transient productions into choices has been
2683 generalized; it now works for all types of productions, not just void
2684 and text-only productions. However, since JIT-based Java virtual
2685 machines do not seem to compile the resulting, possibly large methods
2686 aggressively enough, this optimization can reduce performance and is
2687 disabled by default. The corresponding command line option
2688 for <em>Rats!</em> is <code>-Ochoices2</code>. The original (though
2689 slightly improved) optimization for void and text-only productions is
2690 still available under the <code>-Ochoices1</code> command line option
2691 and enabled by default. Note that the <code>choices2</code>
2692 optimization includes the <code>choices1</code>
2693 optimization.</li>
2694
2695 <li>A new optimization avoids the creation of error objects when
2696 transient productions do not match the input. The corresponding
2697 command line option for <em>Rats!</em> is <code>-Oerrors2</code>.
2698 This optimization is complimentary to the previously available error
2699 object optimization, which is now controlled through
2700 the <code>-Oerrors1</code> command line option. Both optimizations
2701 are enabled by default.</li>
2702
2703 <li><code>xtc.tree.GNode</code> now uses less memory for generic nodes
2704 with zero or one children.</li>
2705
2706 <li>Nested choices appearing as the last element in another, repeated
2707 or optional choice are now correctly lifted (bug fix).</li>
2708
2709 <li>A new driver, <code>xtc.lang.CDriver</code>, for parsing and
2710 printing C has been added. It provides control over whether to print
2711 parsed files and also supports the collection of runtime performance
2712 statistics. Additionally, the invocation syntax for the main class,
2713 <code>xtc.Main</code>, has been changed, now using
2714 the <code>-util</code> comand line option to control tool
2715 selection.</li>
2716
2717 <li>The C grammar, <code>c.rats</code>, has been tuned so that
2718 alternatives that are more likely to appear in the input are parsed
2719 first. For example, declarations are now parsed before function
2720 definitions.</li>
2721
2722 </ul></dd>
2723
2724 <!-- ======================================================================= -->
2725
2726 <dt>1.4.1 (9/16/04)</dt>
2727
2728 <dd>Minor feature and bug fix release:<ul>
2729
2730 <li><em>Rats!</em> now allows semantic actions in text-only
2731 productions, though <code>yyValue</code> may still not be
2732 referenced.</li>
2733
2734 <li><em>Rats!</em> now recognizes the <code>-Oleft</code> command line
2735 option to control the automatic transformation of direct
2736 left-recursions into right-recursions. It also prints additional
2737 messages under the <code>-verbose</code> command line option.</li>
2738
2739 <li>Nested code blocks in semantic actions are now properly indented
2740 when pretty printing grammars or generated parsers.</li>
2741
2742 <li>An index-out-of-bounds condition for sequences containing a
2743 <code>!</code> syntactic predicate on a character constant or class,
2744 followed by the any character constant, followed by any element has
2745 been eliminated (bug fix).</li>
2746
2747 <li>Once-or-more repetitions containing a terminal are now correctly
2748 desugared into the equivalent right-recursive expressions (bug fix).</li>
2749
2750 <li>The code generator now creates correct code for repeated empty
2751 sequences or <code>&</code> syntactic predicates appearing in
2752 transient void or text-only productions (bug fix).</li>
2753
2754 <li>The C grammar now correctly handles enumeration constants,
2755 unsigned chars, chars, and string constants. It also recognizes
2756 several GCC extensions, notably attributes. Additionally, it
2757 recognizes pragmas and GCC line markers, which may be present in C
2758 preprocessor output.</li>
2759
2760 <li>The C pretty printer now correctly parenthesizes expressions,
2761 observing both precedence and associativity. The handling of spacing
2762 (notably, newlines and indentation) has also been improved.</li>
2763
2764 </ul></dd>
2765
2766 <!-- ======================================================================= -->
2767
2768 <dt>1.4.0 (9/7/04)</dt>
2769
2770 <dd>Feature release. This release focuses on <em>Rats!</em>'
2771 automatic generation of abstract syntax trees (through generic nodes).
2772 Notable improvements include:<p /><ul>
2773
2774 <li>Nested choices, repetitions, and optional expressions in a generic
2775 production are now treated just like they are in regular productions
2776 (instead of resulting in separate generic nodes). In other words, if
2777 the semantic value of such an expression cannot be automatically
2778 determined, it needs to be specified in explicit actions.
2779 Furthermore, the values resulting from a repeated expression are now
2780 directly added as individual children to a generic production's
2781 <code>xtc.tree.GNode</code>.</li>
2782
2783 <li>An option in a generic production's ordered choice can now pass
2784 the semantic value of a component expression through by explicitly
2785 binding to <code>yyValue</code> (instead of always resulting in a new
2786 generic node).</li>
2787
2788 <li>A component expression's value can now be omitted from a
2789 production's generic node, even if it is not a character terminal or
2790 void nonterminal, by prefacing it with <code>void:</code>. This new
2791 prefix operator has lower precedence than all other operators,
2792 including regular prefix operators, with the exception of the ordered
2793 choice operator <code>/</code>.</li>
2794
2795 <li>Direct left-recursions in a generic production are now
2796 automatically transformed into the corresponding right-recursions,
2797 with the resulting generic nodes preserving left-associativity.
2798 Non-generic productions can achieve similar results by using the newly
2799 added <code>xtc.util.Action</code> class.</li>
2800
2801 <li>Newly added generic text productions simplify the recognition of
2802 text within generic productions. A generic text production has
2803 <code>gstring</code> (for "generic string") as its type and a generic
2804 node as its semantic value, whose only child is the text matched in
2805 the input.</li>
2806
2807 </ul>
2808
2809 Additionally, the newly added <code>state</code> attribute and the
2810 corresponding <code>xtc.util.State</code> interface help with writing
2811 grammars that are context-sensitive and require global state. The
2812 <code>state</code> attribute, as well as the <code>debug</code>,
2813 <code>location</code>, and <code>constantBinding</code> attributes can
2814 now also be specified on a per-production basis, simply by including
2815 them before the production's type. Next, sequences can now be named;
2816 the name is specified as the first element in a sequence by including
2817 it between less-than <code>&lt;</code> and greater-than
2818 <code>&gt;</code> signs. Furthermore, the readability of printed
2819 grammars and generated code has been improved through new
2820 line-wrapping facilities in <code>xtc.tree.Printer</code>. Finally,
2821 identifiers may now contain underscores (<code>_</code>).
2822
2823 <p />Almost all of the newly added features are utilized by the new
2824 grammar for C and the corresponding pretty printer (in the
2825 <code>xtc.lang</code> package). Parser and pretty printer can be
2826 tested by executing "<code>java xtc.lang.CParser
2827 &lt;file&gt;</code>".
2828
2829 </dd>
2830
2831 <!-- ======================================================================= -->
2832
2833 <dt>1.3.0 (4/21/04)</dt>
2834
2835 <dd>Feature release. This release adds the ability to automatically
2836 generate abstract syntax trees (ASTs) in <em>Rats!</em>. A production
2837 that should result in a generic node (<code>xtc.tree.GNode</code>) as
2838 its semantic value has
2839 <code>generic</code> as its type. The corresponding generic node has
2840 the same name as the production, and the children of the generic node
2841 are the semantic values of all component expressions in the matched
2842 sequence, with the exception of character terminals and nonterminals
2843 referencing void productions.</dd>
2844
2845 <!-- ======================================================================= -->
2846
2847 <dt>1.2.2 (4/16/04)</dt>
2848
2849 <dd>Internal release. Fixed a bug in the desugaring of repeated
2850 sequences for <em>Rats!</em>; thanks to Robin Lee Powell for
2851 identifying this bug.</dd>
2852
2853 <!-- ======================================================================= -->
2854
2855 <dt>1.2.1 (4/13/04)</dt>
2856
2857 <dd>Bug fix release. Fixed a bug in <em>Rats!</em>, under which
2858 options were too aggressively simplified; thanks to Robin Lee Powell
2859 for pointing out the incorrect behavior resulting from this bug. Also
2860 fixed two bugs in the processing of nested choices. Finally, fixed a
2861 bug in the handling of bindings to nested choices.</dd>
2862
2863 <!-- ======================================================================= -->
2864
2865 <dt>1.2.0 (4/9/04)</dt>
2866
2867 <dd>Feature release. This release improves the reflection-based
2868 dynamic dispatch for nodes and visitors by also allowing functionality
2869 to be expressed as part of nodes: While <code>visit()</code> methods
2870 in visitors are selected based on the type of the node, the
2871 corresponding <code>process()</code> methods in nodes are selected
2872 based on the type of the visitor. The dynamic dispatch mechanism
2873 first tries to locate a <code>process()</code> method and, if none can
2874 be found, tries to locate the corresponding <code>visit()</code>
2875 method.
2876
2877 <p />This release also makes the following improvements
2878 to <em>Rats!</em>:<p /><ul>
2879
2880 <li>Added support for parser actions, which are written like regular
2881 actions prepended by a caret <code>^</code> and contain low-level code
2882 that parses languages not expressible by parsing expression grammars.
2883 This feature has been motivated by Sameer Ajmani and Bryan Ford.</li>
2884
2885 <li>Added an optimization that folds common prefixes in the general
2886 case. This optimization is disabled by default because it may
2887 increase heap utilization of generated parsers.</li>
2888
2889 <li>Added support for the <code>mainMethod</code> grammar attribute,
2890 which causes a main method to be generated that parses files specified
2891 on the command line.</li>
2892
2893 <li>Fixed a bug in the detection of left-recursive productions.
2894 Thanks to Robin Lee Powell for identifying the bug.</li>
2895
2896 </ul>
2897 This release also includes support for generic abstract syntax tree
2898 nodes, though they cannot yet be generated automatically.
2899
2900 </dd>
2901
2902 <!-- ======================================================================= -->
2903
2904 <dt>1.1.0 (2/3/04)</dt>
2905
2906 <dd>Minor feature and bug fix release. This release
2907 improves <em>Rats!</em> by fixing a bug in the processing of syntactic
2908 predicates and by adding a new optimization that avoids stack overflow
2909 errors on some Java virtual machines. The <em>Rats!</em>
2910 tool, <code>rats</code>, now supports command line flags to control
2911 which optimizations to perform. The Java parser
2912 tool, <code>pjava</code>, now supports the printing of parser
2913 statistics in white-space delimited format (to easier import data into
2914 spreadsheets).</dd>
2915
2916 <!-- ======================================================================= -->
2917
2918 <dt>1.0.0 (1/21/04)</dt>
2919
2920 <dd>Initial release.</dd>
2921
2922 </dl>
2923
2924 </body></html>