⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changelog

📁 java cup constructor to compiler
💻
字号:
CUP version 0.10k is a maintenance release.CUP will now accept a filename on the command-line if it is the lastargument and does not start with "-".  This allows better GUIintegration.  Some unix-isms in end-of-line handling have been fixed,too; thanks to Jean Vaucher <vaucher@iro.umontreal.ca> for the tip.The java_cup.runtime.Scanner interface has been refined to allowthe scanner to return null to signal EOF.  JLex and JFlex users willlike this, as it means they can use the default scanner EOF behavior.Bruce Hutton <b_hutton@cs.auckland.ac.nz>, Zerksis Umrigar <zdu@acm.org>,and Vladimir Antonevich <Vladimir.Antonevich@solcorp.com> all sent bugreports touching on erroneous error recovery in the parser runtime.Dr. Hutton provided the fixes that I've adopted; Zerksis sent a veryhelpful CUP-vs-bison test case.  If you're in a position to noticecorrect/incorrect error recovery and this release works better for youthan previous ones, thank them --- and send me email so I know whetherwe've quashed this bug for good.Klaus Georg Barthelmann <barthel@Informatik.Uni-Mainz.DE> caught anoversight in the constructors for java_cup.runtime.Symbol.  I've alsotaken an obsolete constructor allowing specification of a start statefor some symbol to package-scope; if this causes anyone backwardscompatibility problems, email me and I will consider changing it back.C. Scott AnanianLaboratory for Computer ScienceMassachusetts Institute of TechnologyJul-24-1999 [CSA]------------------------------------------------------------------------CUP version 0.10j adds new features.A "-version" command-line option is now accepted, which prints out theworking 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 andimport statements, and in (non)terminal labels. In addition, semicolonsafter 'action code', 'parser code', 'init code', and 'scan with' sectionshave been made optional (if language noise annoys you).  Also, these foursections may now appear in any order, instead of the strict orderingpreviously required.  Finally, you can now spell 'non-terminal' as either"non terminal" (old way) *or* "nonterminal" without upsetting CUP.[Flexibility requested by Stefan Kahrs <S.M.Kahrs@ukc.ac.uk>][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 thescanner and to throw an Error in this case.  The scanner must returna fresh Symbol object on each invocation, because these objects aretagged with parse state and added to the parse stack.  Object sharingdoes evil things to the parser; don't do it (you won't get away with it).[Symbol recycling problems reported by Ken Arnold <Ken.Arnold@Sun.COM>]Improved scanner interface, designed by David MacMahon <davidm@smartsc.com>.The new java_cup.runtime.Scanner interface is used by the defaultimplementation of lr_parser.scan().  See the manual for more details.Old parsers will work with the new runtime, but parsers generated with0.10j will not work with the runtime from earlier versions unless youspecify the (new) "-noscanner" option.C. Scott AnanianLaboratory for Computer ScienceMassachusetts Institute of TechnologyJul-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 correctedby Chris Harris <ckharris@ucsd.edu>.The fields in the emitted symbol class have been made public, rather thanpackage scope, since the class already was public.The issues formerly addressed in Appendix D (accessing parser methods/fieldsfrom the action class) have been partially addressed by adding a newprivate final field named 'parser' to the action object that points tothe parser object.  THIS INTRODUCES A POTENTIAL INCOMPATIBILITY if you hadpreviously 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 friendlyto makefiles.A reminder: please submit bug-fixes or feature-additions as *patches*, notcomplete archives.  Your patch will have a greater chance of integrationinto 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 outwhat you've changed and why.C. Scott AnanianLaboratory for Computer ScienceMassachusetts Institute of TechnologyFeb-18-1999 [CSA]------------------------------------------------------------------------CUP version 0.10h is a maintenance release.Starting with this version, CUP encodes the various parser tables as stringsto get around java's 64k method-size limitation.  This allows largerparse tables and thus more complicated grammars.Furthermore, a long-standing buglet that would cause CUP to occasionallygenerate "Attempt to construct a duplicate state" internal errors has beenfixed.Another contributed Microsoft-compatible makefile has also been addedto the distribution.C. Scott AnanianLaboratory for Computer ScienceMassachusetts Institute of TechnologyFeb-10-1999 [CSA]------------------------------------------------------------------------CUP version 0.10g contains bug fixes, added functionality, andperformance 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 AnanianLaboratory for Computer ScienceMassachusetts Institute of Technology3/24/98 [CSA]------------------------------------------------------------------------CUP version 0.10f is a maintenance release.  The code has been cleaned upfor JDK 1.1 functionality. No major functionality has been added; any bugsin 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 byC. Scott Ananian.  Suggestions and bug-fixes should be sent tocananian@alumni.princeton.edu. 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 AnanianLaboratory for Computer ScienceMassachusetts Institute of Technology12/21/97 [CSA]------------------------------------------------------------------------CUP version 0.10e contains a few bug fixes from 0.10a- %prec directive now works correctly 	fixed by cananian@princeton.edu <C. Scott Ananian>- Shift reduce conflicts are now correctly reported	fixed by danwang@cs.princeton.edu <Daniel . Wang>- Error with reporting the positon of the error token also fixed	fixed by cananian@princeton.edu <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 danwang@cs.princeton.edu <Daniel . Wang>- Fixed bug introduced by previous fix patches from <hosking@.cs.purdue.edu>  Added '\r' as a whitespace character for the lexer suggested by 	(dladd@spyglass.com)- Fixed botched relaseDaniel WangDepartment of Computer SciencePrinceton UniversityLast updated:  9/12/97 [DW]------------------------------------------------------------------------Changes and Additions to CUP v0.9eCUP 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 differentmanner.  In the previous releases, a new class was used for everydistinct 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 typein the parser specification file.  The second two are the instancevariables left and right.  They should be filled with the int value ofwhere in the input file, character-wise, that terminal was found.2. Terminal and non-nonterminal declarations now can be declared in twodifferent ways to indicate the values of the terminals or non-terminals.The previous declarations of the formterminal {classname} {terminal} [, terminal ...];still works.  The classname, however indicates the type of the value ofthe terminal or non-terminal, and does not indicate the type of objectplaced 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 allnon-terminals as well.  When a production reduces to a non-terminal, anew Symbol is created, and the value field is filled with the value ofthat non-terminal.  The user must know that the terminal and non terminaldeclarations specify a type corresponding to the type of the value fieldfor the symbol representing that terminal or non-terminal.4. Label references do not refer to the object on the parse stack, as inthe old CUP, but rather to the value of the value instance variable ofthe Symbol that represents that terminal or non-terminal.  Hence,references to terminal and non-terminal values is direct, as opposed tothe old CUP, where the labels referred to objects containing the valueof the terminal or non-terminal.5. The RESULT variable refers directly to the value of the non-terminalto 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 isdirect, rather than to something that will contain the data.6. For every label, two more variables are declared, which are the labelplus left or the label plus right.  These correspond to the left andright locations in the input stream to which that terminal ornon-terminal came from.  These values are propagated from the inputterminals, so that the starting non-terminal should have a left value of0 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 isof the start non-terminal, so the value field contains the final RESULTassignment. 8. CUP now has precedenced terminals.  a new declaration section,occurring between the terminal and non-terminal declarations and thegrammar specifies the precedence and associativity of rules.  Thedeclarations are of the form:precedence {left| right | nonassoc} terminal[, terminal ...];...The terminals are assigned a precedence, where terminals on the sameline have equal precedences, and the precedence declarations fartherdown the list of precedence declarations have higher precedence.  left,right and nonassoc specify the associativity of these terminals.  leftassociativity corresponds to a reduce on conflict, right to a shift onconflict, and nonassoc to an error on conflict.  Hence, ambiguousgrammars may now be used.  For a better explanation, see the manual.9.  Finally the new CUP adds contextual precedence.  A production may bedeclare 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 terminalspecified after the "%prec".  Hence, shift/reduce conflicts can becontextually resolved.  Note that the "%prec terminal" part comes afterall actions strings.  It does not come before the last action string.For more information read the manual, found in manual.htmlFrank FlanneryDepartment of Computer SciencePrinceton UniversityLast updated:  7/3/96 [FF]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -