[antlr-interest] unreachable code detected
=?gb2312?q?=CB=EF=BC=CD=B8=D5=20Jigang=20(Robert)=20Sun?=
sunjigang1965 at yahoo.com.cn
Thu Feb 2 15:44:44 PST 2006
The grammar is
type returns [int ty=0]
: "int" LSQUARE RSQUARE {ty=INT_ARRAY_type;}
| "int" {ty=INT_type;}
| "boolean" {ty=BOOLEAN_type;}
| id:ID {ty=ID_type;}
antlr generates
public int type()
{
....
returnAST = type_AST;
return ty;
ASTPair.PutInstance(currentAST);
}
there is always a statement appears after return.
Why?
---------------------------------
ÑÅ»¢1GÃâ·ÑÓÊÏä°Ù·Ö°Ù·ÀÀ¬»øÐÅ
ÑÅ»¢ÖúÊÖ-ËÑË÷¡¢É±¶¾¡¢·ÀɧÈÅ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060203/1858da07/attachment.html
More information about the antlr-interest
mailing list