[antlr-interest] Re: How to get difference set between two sets?

yhhf_dy yhhf_dy at yahoo.com
Fri Apr 12 10:49:02 PDT 2002


Thank for your response!

Maybe I didn't describ my question clear last time. my question is 
there are two sets - identifier set and keyword set. keyword set is 
subset of identifier. I want to get the difference set between 
identifier and keyword, that is, get identifier but not include 
keyword. Is it possible to do that in antlr?

I'm going to develop a VB 6 parser. Now I have established vb grammar 
file of anltr based on VB .NET grammar
(http://msdn.microsoft.com/library/en-
us/vbls7/html/vblrfvbspec12.asp.) When I compile grammar file there 
are lots of nondeterminism warning. I hope I can overcome those 
problem, right now I knew that it was a hard work to generate VB 
parser.   

Good Wishes

Fan Yang


--- In antlr-interest at y..., Terence Parr <parrt at j...> wrote:
> 
> On Friday, April 12, 2002, at 09:17  AM, yhhf_dy wrote:
> 
> > Hi,
> >
> > There are two set described as following rules :
> >
> > IDENTIFIER:('a'..'z'|'A'..'Z'|'_') 
('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
> > keyword : "class" | "public" | "private" | etc.
> >
> > I want to get difference between IDENTIFIER set and keyword set, 
that
> > is  difference set = IDENTIFIER set - keyword set
> >
> > Would you please help me how to implement this in ANTLR.
> 
> That set is infinite.  No way to delineate on a finite computer.
> 
> Are you asking how to get ANTLR to return IDENTIFIER and CLASS, 
PUBLIC 
> etc...?  That's just a literals issue.  See the doc or FAQ.
> 
> Regards,
> Ter
> --
> Co-founder, http://www.jguru.com
> Creator, ANTLR Parser Generator: http://www.antlr.org


 

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



More information about the antlr-interest mailing list