Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!nerds-end From: Hans-Peter Diettrich Newsgroups: comp.compilers Subject: Re: Parsing C#-like generics Date: Tue, 12 Jul 2011 13:25:46 +0100 Organization: Compilers Central Lines: 21 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-07-021@comp.compilers> References: <11-07-019@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: gal.iecc.com 1310515482 64909 64.57.183.58 (13 Jul 2011 00:04:42 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 13 Jul 2011 00:04:42 +0000 (UTC) Keywords: parse Posted-Date: 12 Jul 2011 20:04:42 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:197 Harold Aptroot schrieb: > I'm having some trouble parsing generics when mixed with comparisons. The > way I try to do it, there is an ambiguity between LessThan and a "list of > types between angle brackets". > For example, x(x to a function call x with a type parameter list < x > and a single argument > which is the expression x make it clearer, the actual result should just be an AST). IMO you should better separate declarations from code (statements, expressions). Then the parser will "know" from that context, that a declaration can contain type lists, but not x{x