-
Notifications
You must be signed in to change notification settings - Fork 12
/
changelog.txt
595 lines (489 loc) · 25.2 KB
/
changelog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
------------------------------------------------------------------------
CUP version jh-javacup 1.2 (2021-08-07)
- The strings for the ParseTable are only parsed once in the static
constructor.
------------------------------------------------------------------------
CUP version jh-javacup 1.1 (2019-09-01)
- New feature by Yoav Sternberg:
The new keyword after reduce defines code that is executed whenever a
production rule is reduced. The arrays symbols contains all terminal
and non-terminal symbols of the current production rule. RESULT can
be used to access and modify the value of the nonterminal created by
the production rule. Example usage:
after reduce {:
int lineNumber = symbols[0].left + 1;
if (RESULT instanceof AST_Node) {
((AST_Node) RESULT).lineNumber = lineNumber
}
:}
- New SimpleSymbolFactory that supports line/column number without the
extra overhead of the Location objects.
------------------------------------------------------------------------
CUP version jh-javacup 1.0
First Maven release.
------------------------------------------------------------------------
CUP version 0.12joho 20110608
Efficient support for proxy rules. A proxy rule is a production where the
right-hand-side is a single terminal or nonterminal and the result should be
equal to the result of the right-hand-side. In that case the user can simply
write "nonterminal ::= symbol" without giving an action. These rules are
implemented efficiently without doing anything, not even a reduction step.
Wildcard support, i.e. nonterminal?, nonterminal*, and nonterminal+ are
now supported. The first matches either nonterminal, or the empty string,
has the same type as nonterminal, but is null if the nonterminal is not set.
The latter two have array types; nonterminal* stands for zero or more
occurences of nonterminal, nonterminal+ stands for one or more occurences.
These have the same effect as if the user had introduced the rules
nonterminal? ::= {: RESULT = null; :} | nonterminal;
nonterminal* ::= {: RESULT = new Type[0]; :} | nonterminal+;
nonterminal+ ::= nonterminal:nt {: RESULT = new Type[] { nt }; :}
| nonterminal+:nts nonterminal:nt
{: RESULT = new Type[nts.length+1];
System.arraycopy(nts, 0, RESULT, 0, nts.length);
RESULT[nts.length] = nt; :};
except that it is a bit more efficient (it uses ArrayList which are converted
transparently into arrays in the end).
J. Hoenicke
Universität Freiburg
2011-06-08
------------------------------------------------------------------------
CUP version 0.12joho 20081112
INCOMPATIBILITIES:
The super class of parser is now LRParser instead of lr_parser. This class
changed such that newly generated parsers do not run with old runtime package
and vice versa. Some protected and public members were removed, as they made
available some internal structures that are not present in new code or that are
likely to change in later versions. These are:
- prodution_table()
- reduce_table()
- start_state()
- start_production()
- EOF_sym()
- error_sym()
- _error_sync_size (error_sync_size() can still be overridden)
- _done_parsing (done_parsing() is still public)
- tos
- production_tab
- action_tab
- reduce_tab
- init_actions()
- get_action(int, int)
- get_reduce(int, int)
- error_recovery(boolean)
- shift_under_error()
- find_recovery_config(boolean)
- lookahead
- lookahead_pos
- read_lookahead()
- cur_err_token()
- advance_lookahead()
- restart_lookahead()
- try_parse_ahead()
- parse_lookahead()
- unpackFromStrings(String[])
the signature of function action_table() has changed, however, this function is
not meant to be accessed by user code.
Error handling is improved, by allowing reducing productions that contain error
as lookahead symbol.
Precedence handling is fixed. This may result in shift/reduce-conflicts that
were not reported by previous versions of java cup. You need to fix your grammar.
For each labeled (non-)terminal there is now an additional variable <label>$
that allows access to the Symbol object. On the other hand some variables with
a dollar sign are no longer generated like CUP$parser$top and some variables
are renamed. You should not use variables in your code containing a $, except
for the new <label>$ variable.
OTHER CHANGES:
Added new switch -java15 to emit Java 1.5 compatible code with generic
Stack parameter and SuppressWarnings annotation.
Fix operator precedences: Report shift/reduce-conflicts unless both rules
have a precedence and this resolves the conflict. Report non-assoc conflicts
immediately and not at run-time.
Cleaned up source code to use less static structures.
Use comb-compressed action/reduce-shift tables, which have better run-time
performance while achieving a similar compression ratio.
Add the switch (-newlocations) to turn off generation of <label>left and
<label>right variables. A better way to access left and right part is via the
newly generated symbol object: <label>$.left
J. Hoenicke
Universität Freiburg
2008-11-06
------------------------------------------------------------------------
CUP version 0.11a beta 20060608 is a bugfix release.
Embedded actions in CUP didn't really relay their intermediate results to the
main action part. now, embedded actions have the following (new) properties:
- the LHS has the type of the "parent" lhs
- the RESULT variable of following embedded actions have their RESULT
variables initialized with the RESULT of the previous embedded action
M. Petter, A. Flexeder
Technische Universität München
2006/06/08
------------------------------------------------------------------------
CUP version 0.11a beta 200603230 is a bugfix release.
corrected new issue with SymbolFactory. Forgot to offer one of the non-
propagating factory methods for Symbol generation. (thanks to
M. Petter
Technische Universität München
2006/03/30
------------------------------------------------------------------------
CUP version 0.11a beta 20060328 is a feature release.
Introduced the concept of the java_cup.runtime.SymbolFactory, which serves
multiple purposes; now You have the chance to manage extended information
relating to the sourcecode file in Your symbols, by using own child classes
of java_cup.runtime.Symbol.
In Addition to that You can implement Your own child class of SymbolFactory
to have a callback function whenever a new Symbol is created. This is
especially handy when equipping Your syntax tree with location information
from the source code file. For exactly this purpose the new Factories
java_cup.runtime.DefaultSymbolFactory and
java_cup.runtime.ComplexSymbolFactory
are introduced.
Experiments with the new runtime have revealed a few little flaws in the
build file, resulting in classpath confusion: In fact, JFlex itself depends
on the CUP runtime, leading to a mixture of runtimes, that could spoil Your
build process. I have corrected the errors in the CUP buildfile.
M. Petter
Technische Universität München
2006/03/28
------------------------------------------------------------------------
CUP version 0.11a beta 20060102 is a bugfix release.
Corrected two minor issues: a build.xml bug resulting in a slightly smaller
runtime JAR (thanks to Florian [email protected] ) and an
incorrect initialized parameter (thanks to Andreas [email protected])
M. Petter
Technische Universität München
2006/01/02
------------------------------------------------------------------------
CUP version 0.11a beta 20051104 is a bugfix release.
the buildfile now creates Java 1.2 compliant code as well as it uses an actual
JDK 1.2 compliant CUP version for bootstrapping. [email protected] has
contributed to bugfixes, concerning an ant parameter as well as a more
informative CODE_STRING Token.
M. Petter
Technische Universität München
2005/11/04
------------------------------------------------------------------------
CUP version 0.11a beta 20050921 is a combined bugfix release.
added calls to clear the content of static fields in CUP, to be able to
call the main() method several times instead of only one time without
strange errors.
M. Petter
Technische Universität München
2005/09/21
------------------------------------------------------------------------
CUP version 0.11a beta 20050920 is a combined bugfix/feature release.
Made use of .peek() function for Stacks in generated parsers.
-destdir parameter added for generation in Makefiles or with ant.
Completely rewrote the CUP-anttask to properly call ant even, if You use
paths including whitespaces.
M. Petter
Technische Universität München
2005/09/20
------------------------------------------------------------------------
CUP version 0.11a beta 20050628 is a combined bugfix/feature release.
Henning Niss ( hniss at itu dot dk ) sent me a patch to improve the
generics handling in CUP. It also introduces a new parameter
"-typeargs" to cup, whith which one can parametrize the generated parser.
M. Petter
Technische Universität München
2005/06/28
------------------------------------------------------------------------
CUP version 0.11a beta 20050516 is a management release.
To indicate, that the CUP project switches from the Princeton team to the
technical university of munich, we switch to version 11 since this moment.
Nothing else has changed since the last bugfix release, as indicated in
the version date.
M. Petter
Technische Universität München
2005/05/16
------------------------------------------------------------------------
CUP version 0.10k TUM Edition 20050516 is a bugfix release.
We forgot to implement a simple line in the wildcard production integration,
leading to wildcards like ArrayList<? extends MyClass> being
destroyed. Meanwhile, everything should work as it is supposed to.
M. Petter
Technische Universität München
2005/05/16
------------------------------------------------------------------------
CUP version 0.10k TUM Edition 20050514 is a bugfix/enhancement release.
Along with the redesigned Lexer, CUP lost a lot of error tracking and
displaying capabilities; now we have redesigned the Errormanager to display
even better error informations like column/line and the token in plain text,
CUP is processing, when the error occurs.
M. Petter
Technische Universität München
2005/05/14
------------------------------------------------------------------------
CUP version 0.10k TUM Edition 20050510 is a feature release.
CUP now supports generic parametrisation of datatypes for CUP terminals
and non terminals, as provided by Java 1.5. We do hope, it works correctly
all flavours of Java generics, as for example wildcards.
! Be carefull ! : there are the new keywords "super" and "extends", which
had to be introduced to support generic types. Watch out for identifiers in
Your CUP files, that have these names.
There is now an ANT Task for CUP, namely java_cup.anttask.CUPTask. It will
soon be added to the documentation - for the moment, You can look into the
sources to figure out, how to use it.
The CUP frontend, which parses .cup-files has changed to a JFlex-generated
scanner, which allows an easier maintainance.
M. Petter
Technische Universität München
2005/05/10
------------------------------------------------------------------------
CUP version 0.10k is a maintenance release.
CUP will now accept a filename on the command-line if it is the last
argument and does not start with "-". This allows better GUI
integration. Some unix-isms in end-of-line handling have been fixed,
too; thanks to Jean Vaucher <[email protected]> for the tip.
The java_cup.runtime.Scanner interface has been refined to allow
the scanner to return null to signal EOF. JLex and JFlex users will
like this, as it means they can use the default scanner EOF behavior.
Bruce Hutton <[email protected]>, Zerksis Umrigar <[email protected]>,
and Vladimir Antonevich <[email protected]> all sent bug
reports touching on erroneous error recovery in the parser runtime.
Dr. Hutton provided the fixes that I've adopted; Zerksis sent a very
helpful CUP-vs-bison test case. If you're in a position to notice
correct/incorrect error recovery and this release works better for you
than previous ones, thank them --- and send me email so I know whether
we've quashed this bug for good.
Klaus Georg Barthelmann <[email protected]> caught an
oversight in the constructors for java_cup.runtime.Symbol. I've also
taken an obsolete constructor allowing specification of a start state
for some symbol to package-scope; if this causes anyone backwards
compatibility problems, email me and I will consider changing it back.
C. Scott Ananian
Laboratory for Computer Science
Massachusetts Institute of Technology
Jul-24-1999 [CSA]
------------------------------------------------------------------------
CUP version 0.10j adds new features.
A "-version" command-line option is now accepted, which prints out the
working version of CUP and halts. This allows automatic version-checking,
for those applications which require it.
Broadened the CUP input grammar to allow CUP reserved words in package and
import statements, and in (non)terminal labels. In addition, semicolons
after 'action code', 'parser code', 'init code', and 'scan with' sections
have been made optional (if language noise annoys you). Also, these four
sections may now appear in any order, instead of the strict ordering
previously required. Finally, you can now spell 'non-terminal' as either
"non terminal" (old way) *or* "nonterminal" without upsetting CUP.
[Flexibility requested by Stefan Kahrs <[email protected]>]
[Package and import reserved word issues noted by Frank Rehberger,
Brandon Schendel, and Bernie Honeisen, among others.]
Clarified the parse table dumps generated by the -dump* options.
I have added code to lr_parser to detect illegal Symbol recycling by the
scanner and to throw an Error in this case. The scanner must return
a fresh Symbol object on each invocation, because these objects are
tagged with parse state and added to the parse stack. Object sharing
does evil things to the parser; don't do it (you won't get away with it).
[Symbol recycling problems reported by Ken Arnold <[email protected]>]
Improved scanner interface, designed by David MacMahon <[email protected]>.
The new java_cup.runtime.Scanner interface is used by the default
implementation of lr_parser.scan(). See the manual for more details.
Old parsers will work with the new runtime, but parsers generated with
0.10j will not work with the runtime from earlier versions unless you
specify the (new) "-noscanner" option.
C. Scott Ananian
Laboratory for Computer Science
Massachusetts Institute of Technology
Jul-24-1999 [CSA]
------------------------------------------------------------------------
CUP version 0.10i is a maintenance release.
A one-off bug in the parser error-recovery code has been caught and corrected
by Chris Harris <[email protected]>.
The fields in the emitted symbol class have been made public, rather than
package scope, since the class already was public.
The issues formerly addressed in Appendix D (accessing parser methods/fields
from the action class) have been partially addressed by adding a new
private final field named 'parser' to the action object that points to
the parser object. THIS INTRODUCES A POTENTIAL INCOMPATIBILITY if you had
previously defined a field named 'parser' in the 'action code {: ... :}'
portion of your grammar. The solution is to rename your field.
Finally, incorporated Jako Andras' suggestions to make CUP more friendly
to makefiles.
A reminder: please submit bug-fixes or feature-additions as *patches*, not
complete archives. Your patch will have a greater chance of integration
into the distribution if you package each feature or fix as a separate patch,
instead of lumping everything together and leaving it to me to figure out
what you've changed and why.
C. Scott Ananian
Laboratory for Computer Science
Massachusetts Institute of Technology
Feb-18-1999 [CSA]
------------------------------------------------------------------------
CUP version 0.10h is a maintenance release.
Starting with this version, CUP encodes the various parser tables as strings
to get around java's 64k method-size limitation. This allows larger
parse tables and thus more complicated grammars.
Furthermore, a long-standing buglet that would cause CUP to occasionally
generate "Attempt to construct a duplicate state" internal errors has been
fixed.
Another contributed Microsoft-compatible makefile has also been added
to the distribution.
C. Scott Ananian
Laboratory for Computer Science
Massachusetts Institute of Technology
Feb-10-1999 [CSA]
------------------------------------------------------------------------
CUP version 0.10g contains bug fixes, added functionality, and
performance improvements. Thanks to Matthias Zenger, Peter Selinger,
Jaroslaw Kachinarz, Ian Davis and others for contributions.
- New command line option '-interface' added. This causes JavaCUP to
emit an *interface* with the symbol constants, instead of a
*class*. Without the command-line flag, behavior is identical to
v0.10f and before: the symbols are emitted as a class.
- (minor) Added toString() method to java_cup.runtime.Symbol and
modified the debugging parser to use it. This allows you to
override toString() to allow a more intelligible debugging parse.
- The CUP grammar has been extended to allow one to declare array types
for javaCUP terminals and non-terminals. Matthias Zenger first
suggested this feature; Peter Selinger was the first to show the
right way to do it.
- The symbols prefixed with CUP$ now have the parser class file name
added to the prefix as well, to allow more than one parser object
per package. Thanks to Jaroslaw Kachniarz for pointing out this
problem.
- Fixed bug that prevented one from invoking the parser multiple times.
To quote Ian Davis, who found and diagnosed the bug:
Repeat invocations of the same instantiation of lr_parser.java to parse
distinct input statements fail for the simple reason that the stack is
not emptied at start of parsing, but the stack offset is reset to 0.
This has been fixed.
- Fixed bug with implicit start productions not receiving a RESULT.
- Fixed bug with RESULT assignments that are not right-most in the
production.
- Updated documentation.
Known issues:
- All known bugs have been fixed.
- The java_cup.runtime.SymbolStack / java_cup.runtime.intStack
performance hack originally suggested by Matthias Zenger has been
postponed to the next release. By eliminating typecasts and
synchronized methods, a substantial performance improvement can be
obtained. Backwards-compatibility issues have forced the postponement
of the code merge.
C. Scott Ananian
Laboratory for Computer Science
Massachusetts Institute of Technology
3/24/98 [CSA]
------------------------------------------------------------------------
CUP version 0.10f is a maintenance release. The code has been cleaned up
for JDK 1.1 functionality. No major functionality has been added; any bugs
in 0.10e are still in 0.10f.
- Removed trailing semicolons from class definitions which upset strict
compilers (not Sun's javac, for some reason).
- Changed 'PrintStream's to 'PrintWriter's to eliminate deprecation
warnings.
As of this release, the javaCUP code is being maintained by
C. Scott Ananian. Suggestions and bug-fixes should be sent to
Known issues:
- Precedence bug: rules unmarked by precedence information are treated
as if they had existing, but very low, precedence. This can mask
parser conflicts.
- Efficiency hack: java.util.Stack will be replaced in the next
release with a special-purpose stack to eliminate
performance-robbing type-casts.
- It has been suggested that the symbol *class* should be an
*interface* instead. This will be a command-line option in the next
release.
C. Scott Ananian
Laboratory for Computer Science
Massachusetts Institute of Technology
12/21/97 [CSA]
------------------------------------------------------------------------
CUP version 0.10e contains a few bug fixes from 0.10a
- %prec directive now works correctly
fixed by [email protected] <C. Scott Ananian>
- Shift reduce conflicts are now correctly reported
fixed by [email protected] <Daniel . Wang>
- Error with reporting the positon of the error token also fixed
fixed by [email protected] <C. Scott Ananian>
- INSTALL script now has a slightly more complex test.
- foo.java.diff included for changes from previous release
- Fixed more bugs with reporting of shift reduce conflicts.
fixed by [email protected] <Daniel . Wang>
- Fixed bug introduced by previous fix patches from <[email protected]>
Added '\r' as a whitespace character for the lexer suggested by
- Fixed botched relase
Daniel Wang
Department of Computer Science
Princeton University
Last updated: 9/12/97 [DW]
------------------------------------------------------------------------
Changes and Additions to CUP v0.9e
CUP version 0.10a is a major overhaul of CUP. The changes are severe,
meaning no backwards compatibility to older versions.
Here are the changes:
1. CUP now interfaces with the lexer in a completely different
manner. In the previous releases, a new class was used for every
distinct type of terminal. This release, however, uses only one class:
The Symbol class. The Symbol class has three instance variables which
are significant to the parser when passing information from the lexer.
The first is the value instance variable. This variable contains the
value of that terminal. It is of the type declared as the terminal type
in the parser specification file. The second two are the instance
variables left and right. They should be filled with the int value of
where in the input file, character-wise, that terminal was found.
2. Terminal and non-nonterminal declarations now can be declared in two
different ways to indicate the values of the terminals or non-terminals.
The previous declarations of the form
terminal {classname} {terminal} [, terminal ...];
still works. The classname, however indicates the type of the value of
the terminal or non-terminal, and does not indicate the type of object
placed on the parse stack.
A declaration, such as:
terminal {terminal} [, terminal ...];
indicates the terminals in the list hold no value.
3. CUP doesn't use the Symbol class for just terminals, but for all
non-terminals as well. When a production reduces to a non-terminal, a
new Symbol is created, and the value field is filled with the value of
that non-terminal. The user must know that the terminal and non terminal
declarations specify a type corresponding to the type of the value field
for the symbol representing that terminal or non-terminal.
4. Label references do not refer to the object on the parse stack, as in
the old CUP, but rather to the value of the value instance variable of
the Symbol that represents that terminal or non-terminal. Hence,
references to terminal and non-terminal values is direct, as opposed to
the old CUP, where the labels referred to objects containing the value
of the terminal or non-terminal.
5. The RESULT variable refers directly to the value of the non-terminal
to which a rule reduces, rather than to the object on the parse stack.
Hence, RESULT is of the same type the non-terminal to which it reduces,
as declared in the non terminal declaration. Again, the reference is
direct, rather than to something that will contain the data.
6. For every label, two more variables are declared, which are the label
plus left or the label plus right. These correspond to the left and
right locations in the input stream to which that terminal or
non-terminal came from. These values are propagated from the input
terminals, so that the starting non-terminal should have a left value of
0 and a right value of the location of the last character read.
7. A call to parse() or debug_parse() return a Symbol. This Symbol is
of the start non-terminal, so the value field contains the final RESULT
assignment.
8. CUP now has precedenced terminals. a new declaration section,
occurring between the terminal and non-terminal declarations and the
grammar specifies the precedence and associativity of rules. The
declarations are of the form:
precedence {left| right | nonassoc} terminal[, terminal ...];
...
The terminals are assigned a precedence, where terminals on the same
line have equal precedences, and the precedence declarations farther
down the list of precedence declarations have higher precedence. left,
right and nonassoc specify the associativity of these terminals. left
associativity corresponds to a reduce on conflict, right to a shift on
conflict, and nonassoc to an error on conflict. Hence, ambiguous
grammars may now be used. For a better explanation, see the manual.
9. Finally the new CUP adds contextual precedence. A production may be
declare as followed:
lhs ::= {right hand side list of terminals, non-terminals and actions}
%prec {terminal};
this production would then have a precedence equal to the terminal
specified after the "%prec". Hence, shift/reduce conflicts can be
contextually resolved. Note that the "%prec terminal" part comes after
all actions strings. It does not come before the last action string.
For more information read the manual, found in manual.html
Frank Flannery
Department of Computer Science
Princeton University
Last updated: 7/3/96 [FF]