changes_from_133.txt
来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· 文本 代码 · 共 1,767 行 · 第 1/5 页
TXT
1,767 行
If there is demand, a similar routine for follow sets can be added.
#247. (MR21) Misleading error message on syntax error for optional elements.
Prior to MR21, tokens which were optional did not appear in syntax
error messages if the block which immediately followed detected a
syntax error.
Consider the following grammar which accepts Number, Word, and Other:
rr : {Number} Word;
For this rule the code resembles:
if (LA(1) == Number) {
match(Number);
consume();
}
match(Word);
Prior to MR21, the error message for input "$ a" would be:
line 1: syntax error at "$" missing Word
With MR21 the message will be:
line 1: syntax error at "$" expecting Word, Number.
The generate code resembles:
if ( (LA(1)==Number) ) {
zzmatch(Number);
consume();
}
else {
if ( (LA(1)==Word) ) {
/* nothing */
}
else {
FAIL(... message for both Number and Word ...);
}
}
match(Word);
The code generated for optional blocks in MR21 is slightly longer
than the previous versions, but it should give better error messages.
The code generated for:
{ a | b | c }
should now be *identical* to:
( a | b | c | )
which was not the case prior to MR21.
Reported by Sue Marvin (sue@siara.com).
#246. (Changed in MR21) Use of $(MAKE) for calls to make
Calls to make from the makefiles were replaced with $(MAKE)
because of problems when using gmake.
Reported with fix by Sunil K.Vallamkonda (sunil@siara.com).
#245. (Changed in MR21) Changes to genmk
The following command line options have been added to genmk:
-cfiles ...
To add a user's C or C++ files into makefile automatically.
The list of files must be enclosed in apostrophes. This
option may be specified multiple times.
-compiler ...
The name of the compiler to use for $(CCC) or $(CC). The
default in C++ mode is "CC". The default in C mode is "cc".
-pccts_path ...
The value for $(PCCTS), the pccts directory. The default
is /usr/local/pccts.
Contributed by Tomasz Babczynski (t.babczynski@ict.pwr.wroc.pl).
#244. (Changed in MR21) Rename variable "not" in antlr.g
When antlr.g is compiled with a C++ compiler, a variable named
"not" causes problems. Reported by Sinan Karasu
(sinan.karasu@boeing.com).
#243 (Changed in MR21) Replace recursion with iteration in zzfree_ast
Another refinement to zzfree_ast in ast.c to limit recursion.
NAKAJIMA Mutsuki (muc@isr.co.jp).
#242. (Changed in MR21) LineInfoFormatStr
Added an #ifndef/#endif around LineInfoFormatStr in pcctscfg.h.
#241. (Changed in MR21) Changed macro PURIFY to a no-op
***********************
*** NOT IMPLEMENTED ***
***********************
The PURIFY macro was changed to a no-op because it was causing
problems when passing C++ objects.
The old definition:
#define PURIFY(r,s) memset((char *) &(r),'\\0',(s));
The new definition:
#define PURIFY(r,s) /* nothing */
#endif
#240. (Changed in MR21) sorcerer/h/sorcerer.h _MATCH and _MATCHRANGE
Added test for NULL token pointer.
Suggested by Peter Keller (keller@ebi.ac.uk)
#239. (Changed in MR21) C++ mode AParser::traceGuessFail
If tracing is turned on when the code has been generated
without trace code, a failed guess generates a trace report
even though there are no other trace reports. This
make the behavior consistent with other parts of the
trace system.
Reported by David Wigg (wiggjd@sbu.ac.uk).
#238. (Changed in MR21) Namespace version #include files
Changed reference from CStdio to cstdio (and other
#include file names) in the namespace version of pccts.
Should have known better.
#237. (Changed in MR21) ParserBlackBox(FILE*)
In the past, ParserBlackBox would close the FILE in the dtor
even though it was not opened by ParserBlackBox. The problem
is that there were two constructors, one which accepted a file
name and did an fopen, the other which accepted a FILE and did
not do an fopen. There is now an extra member variable which
remembers whether ParserBlackBox did the open or not.
Suggested by Mike Percy (mpercy@scires.com).
#236. (Changed in MR21) tmake now reports down pointer problem
When ASTBase::tmake attempts to update the down pointer of
an AST it checks to see if the down pointer is NULL. If it
is not NULL it does not do the update and returns NULL.
An attempt to update the down pointer is almost always a
result of a user error. This can lead to difficult to find
problems during tree construction.
With this change, the routine calls a virtual function
reportOverwriteOfDownPointer() which calls panic to
report the problem. Users who want the old behavior can
redefined the virtual function in their AST class.
Suggested by Sinan Karasu (sinan.karasu@boeing.com)
#235. (Changed in MR21) Made ANTLRParser::resynch() virtual
Suggested by Jerry Evans (jerry@swsl.co.uk).
#234. (Changed in MR21) Implicit int for function return value
ATokenBuffer:bufferSize() did not specify a type for the
return value.
Reported by Hai Vo-Ba (hai@fc.hp.com).
#233. (Changed in MR20) Converted to MSVC 6.0
Due to external circumstances I have had to convert to MSVC 6.0
The MSVC 5.0 project files (.dsw and .dsp) have been retained as
xxx50.dsp and xxx50.dsw. The MSVC 6.0 files are named xxx60.dsp
and xxx60.dsw (where xxx is the related to the directory/project).
#232. (Changed in MR20) Make setwd bit vectors protected in parser.h
The access for the setwd array in the parser header was not
specified. As a result, it would depend on the code which
preceded it. In MR20 it will always have access "protected".
Reported by Piotr Eljasiak (eljasiak@zt.gdansk.tpsa.pl).
#231. (Changed in MR20) Error in token buffer debug code.
When token buffer debugging is selected via the pre-processor
symbol DEBUG_TOKENBUFFER there is an erroneous check in
AParser.cpp:
#ifdef DEBUG_TOKENBUFFER
if (i >= inputTokens->bufferSize() ||
inputTokens->minTokens() < LLk ) /* MR20 Was "<=" */
...
#endif
Reported by David Wigg (wiggjd@sbu.ac.uk).
#230. (Changed in MR20) Fixed problem with #define for -gd option
There was an error in setting zzTRACE_RULES for the -gd (trace) option.
Reported by Gary Funck (gary@intrepid.com).
#229. (Changed in MR20) Additional "const" for literals
"const" was added to the token name literal table.
"const" was added to some panic() and similar routine
#228. (Changed in MR20) dlg crashes on "()"
The following token defintion will cause DLG to crash.
#token "()"
When there is a syntax error in a regular expression
many of the dlg routines return a structure which has
null pointers. When this is accessed by callers it
generates the crash.
I have attempted to fix the more common cases.
Reported by Mengue Olivier (dolmen@bigfoot.com).
#227. (Changed in MR20) Array overwrite
Steveh Hand (sassth@unx.sas.com) reported a problem which
was traced to a temporary array which was not properly
resized for deeply nested blocks. This has been fixed.
#226. (Changed in MR20) -pedantic conformance
G. Hobbelt (i_a@mbh.org) and THM made many, many minor
changes to create prototypes for all the functions and
bring antlr, dlg, and sorcerer into conformance with
the gcc -pedantic option.
This may require uses to add pccts/h/pcctscfg.h to some
files or makefiles in order to have __USE_PROTOS defined.
#225 (Changed in MR20) AST stack adjustment in C mode
The fix in #214 for AST stack adjustment in C mode missed
some cases.
Reported with fix by Ger Hobbelt (i_a@mbh.org).
#224 (Changed in MR20) LL(1) and LL(2) with #pragma approx
This may take a record for the oldest, most trival, lexical
error in pccts. The regular expressions for LL(1) and LL(2)
lacked an escape for the left and right parenthesis.
Reported by Ger Hobbelt (i_a@mbh.org).
#223 (Changed in MR20) Addition of IBM_VISUAL_AGE directory
Build files for antlr, dlg, and sorcerer under IBM Visual Age
have been contributed by Anton Sergeev (ags@mlc.ru). They have
been placed in the pccts/IBM_VISUAL_AGE directory.
#222 (Changed in MR20) Replace __STDC__ with __USE_PROTOS
Most occurrences of __STDC__ replaced with __USE_PROTOS due to
complaints from several users.
#221 (Changed in MR20) Added #include for DLexerBase.h to PBlackBox.
Added #include for DLexerBase.h to PBlackBox.
#220 (Changed in MR19) strcat arguments reversed in #pred parse
The arguments to strcat are reversed when creating a print
name for a hash table entry for use with #pred feature.
Problem diagnosed and fix reported by Scott Harrington
(seh4@ix.netcom.com).
#219. (Changed in MR19) C Mode routine zzfree_ast
Changes to reduce use of recursion for AST trees with only right
links or only left links in the C mode routine zzfree_ast.
Implemented by SAKAI Kiyotaka (ksakai@isr.co.jp).
#218. (Changed in MR19) Changes to support unsigned char in C mode
Changes to antlr.h and err.h to fix omissions in use of zzchar_t
Implemented by SAKAI Kiyotaka (ksakai@isr.co.jp).
#217. (Changed in MR19) Error message when dlg -i and -CC options selected
*** This change was rescinded by item #257 ***
The parsers generated by pccts in C++ mode are not able to support the
interactive lexer option (except, perhaps, when using the deferred fetch
parser option.(Item #216).
DLG now warns when both -i and -CC are selected.
This warning was suggested by David Venditti (07751870267-0001@t-online.de).
#216. (Changed in MR19) Defer token fetch for C++ mode
Implemented by Volker H. Simonis (simonis@informatik.uni-tuebingen.de)
Normally, pccts keeps the lookahead token buffer completely filled.
This requires max(k,ck) tokens of lookahead. For some applications
this can cause deadlock problems. For example, there may be cases
when the parser can't tell when the input has been completely consumed
until the parse is complete, but the parse can't be completed because
the input routines are waiting for additional tokens to fill the
lookahead buffer.
When the ANTLRParser class is built with the pre-processor option
ZZDEFER_FETCH defined, the fetch of new tokens by consume() is deferred
until LA(i) or LT(i) is called.
To test whether this option has been built into the ANTLRParser class
use "isDeferFetchEnabled()".
Using the -gd trace option with the default tracein() and traceout()
routines will defeat the effort to defer the fetch because the
trace routines print out information about the lookahead token at
the start of the rule.
Because the tracein and traceout routines are virtual it is
easy to redefine them in your parser:
class MyParser {
<<
virtual void tracein(ANTLRChar * ruleName)
{ fprintf(stderr,"Entering: %s\n", ruleName); }
virtual void traceout(ANTLRChar * ruleName)
{ fprintf(stderr,"Leaving: %s\n", ruleName); }
>>
The originals for those routines are pccts/h/AParser.cpp
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?