[antlr-interest] unreachable code detected

Micheal J open.zone at virgin.net
Thu Feb 2 18:14:11 PST 2006


What version of ANTLR are you using?. I'm guessing 2.7.5 (and that you're using C#). If so, please upgrade to 2.7.6 as that fixes issues such as this reported in 2.7.5. ASTPair management fir C# targets is definitely different.
 
Cheers,
 
Micheal

-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ëï¼Í¸Õ Jigang (Robert) Sun
Sent: 02 February 2006 23:45
To: antlr-interest at antlr.org
Subject: [antlr-interest] unreachable code detected 


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免费邮箱百分百防垃圾信 <http://cn.mail.yahoo.com> 
雅虎助手-搜索、杀毒、防骚扰 <http://cn.zs.yahoo.com>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060203/c34960d9/attachment.html


More information about the antlr-interest mailing list