question of compiler code
=?gb2312?B?ztKyu9aqtcC=?=
shangzhongyong at hotmail.com
Tue Sep 1 20:50:23 PDT 2009
Thank you very much.
Date: Tue, 1 Sep 2009 18:18:32 -0700
From: Jonathan.Gibbons at Sun.COM
Subject: Re: question of compiler code
To: shangzhongyong at hotmail.com
CC: compiler-dev at openjdk.java.net
ÎÒ²»ÖªµÀ wrote:
I am sorry, I do not speak English, but there are problems on the compiler.
Hope to get help,Thanks.
(source code version:openjdk-7-ea-src-b70-20_aug_2009)
1,
--------------------------------------source begin
package com.sun.tools.javac.util;
public interface LayoutCharacters
/** Tabulator character.
*/
final static byte TAB = 0x8;
---------------------------------------source end
---------------------------------------question begin
TAB = 0x8;???
(ASCII-TAB==0x9??)
---------------------------------------question end
Yes, this is an error, but the value TAB is unused, so
there is no incorrect behavior. The value should be
fixed or deleted. I have filed CR 6878146.
2,
--------------------------------------source begin
package com.sun.tools.javac.parser;
private void scanOperator() {
while (true) {
putC har(ch);
Name newname = names.fromChars(sbuf, 0, sp);
if (keywords.key(newname) == IDENTIFIER) {
sp--;
break;
}
---------------------------------------source end
---------------------------------------question begin
keywords.key(newname) == IDENTIFIER;
Special Operator--> IDENTIFIER ?
---------------------------------------question end
This looks like defensive programming since Keywords.key(Name)
can return IDENTIFIER. The normal exit from the loop is here:
if (!isSpecial(ch)) break;
mail end
Thanks
ʹÓÃÐÂÒ»´ú Windows Live Messenger ÇáËɽ»Á÷ºÍ¹²Ïí£¡ Á¢¿ÌÏÂÔØ£¡
-- Jonathan Gibbons
_________________________________________________________________
ÉÏWindows Live ÖйúÊ×Ò³£¬ÏÂÔØ×îаæMessenger£¡
http://www.windowslive.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20090902/7242ccf8/attachment.html
More information about the compiler-dev
mailing list