[antlr-interest] Re: cgram and SEMI! usage

mzukowski at yci.com mzukowski at yci.com
Thu Jan 29 11:25:09 PST 2004


SEMI is probably the only token with this problem.  I'd check COMMA too.  

And yes, do it on a rule by rule basis.  

I would concentrate your efforts on the StdCParser.g.  If you start changing
GnuCParser.g then you will also have to change the tree parsers
GnuCTreeParser.g and GnuCTreeEmitter.g.

Grammar "inheritance" in antlr is really replacement at the rule level.
This is something we will address in antlr 3.

Monty

-----Original Message-----
From: jenlhunt2003 [mailto:steam at tapisinc.com] 
Sent: Thursday, January 29, 2004 11:17 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Re: cgram and SEMI! usage

Yes, after posting, I thought to look at GnuCParser.g and sure enough the !
wasn't there.

It's probably not as simple as going through and replacing SEMI! with SEMI
in StdCParser.g 
since SEMI! is used in some places in GnuCParser.g.  I guess I would have to
look at it on a 
rule by rule basis.

Q. Do you think SEMI is the only token that might have this problem?  If so,
I might just try 
to fix StdCParser.g.

On the otherhand, I wouldn't mind using GnuCParser.g, except that doing so
about doubles my 
chances of making an error in going to CPP if I still have to worry about
StdCParser.g.

Q. When one grammar (GnuCParser.g) extends another (StdCParser.g) does a
particular rule in the 
new one (like rule declaration) completely replace the rule from the old
one, or does it somehow inherit 
from the old one?  If GnuCParser.g pretty much replaces what's in
StdCParser.g, then I will concentrate 
my efforts on GnuCParser.g.

Since I'm not well grounded yet on this, I would appreciate any suggestions.

And, thanks for your efforts on this grammar in the first place.

Henry

--- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
> It looks like I did all my testing by combining GnuCParser and
> GnuCTreeParser.  I should also test with StdCParser and GnuCTreeParser!
I'm
> trying to remember why, but with Gnu C I needed to use SEMIs in the tree
> more.  I would recommend changing the StdCParser as you have, by removing
> the ! from the SEMIs when you see this.
> 
> Monty



 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 


 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list