Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: Gene Wirchenko Newsgroups: comp.compilers Subject: Re: Articles/books that discuss separating the context-free part of a language from the context-sensitive part? Date: Sun, 19 May 2013 18:02:40 -0700 Organization: A noiseless patient Spider Lines: 37 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <13-05-015@comp.compilers> References: <13-05-010@comp.compilers> <13-05-011@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: leila.iecc.com 1369014602 84967 64.57.183.58 (20 May 2013 01:50:02 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Mon, 20 May 2013 01:50:02 +0000 (UTC) Keywords: parse, errors Posted-Date: 19 May 2013 21:50:01 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:901 On Sat, 18 May 2013 00:18:54 +0000 (UTC), glen herrmannsfeldt wrote: [snip] >As I remember it, it is not so easy to do for recursive descent >parsers. As a result, as noted, you get poor error messages, such as: > > SYNTAX ERROR > >somewhere near where the problem is. For languages with reserved works, >it is nice to say exactly what the problem is. It gets more It is nice for any language. When parsing string, I tend to avoid complex regexes for the same reason. If I build an FSA, I can often get specific on what the error is. >interesting without reserved words. Yesterday, following a post >in comp.lang.fortran I tried: > >TYPE :: DEEP > TYPE(DEEP) :: POINTER >END TYPE > >When compiling it, the error message, pointing right to the >word POINTER, say "must have POINTER attribute". > >Fortunately it only took me a few seconds to figure out, and then >laugh at it. But yes, you can get funny messages without reserved >words. Could you explain what the error was? I do not know modern Fortran. Sincerely, Gene Wirchenko