Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.misty.com!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: Articles/books that discuss separating the context-free part of a language from the context-sensitive part? Date: Mon, 20 May 2013 03:17:58 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 54 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <13-05-016@comp.compilers> References: <13-05-010@comp.compilers> <13-05-011@comp.compilers> <13-05-015@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1369076631 42372 64.57.183.58 (20 May 2013 19:03:51 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Mon, 20 May 2013 19:03:51 +0000 (UTC) Keywords: parse, errors Posted-Date: 20 May 2013 15:03:51 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:902 Gene Wirchenko wrote: (snip, I wrote) >>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. Yes, but there are some errors that you only get when there are reserved words, when you use the word in the wrong context. If you say: for = 1; in Java or C, the compiler could note that you used the reserved word in the wrong context, instead of, for example, an invalid 'for' statement. >>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. POINTER is the name of the variable, which doesn't have the same-named attribute. It could be: TYPE(DEEP), POINTER :: POINTER (since Fortran doesn't have reserved words). Where the variable POINTER has the POINTER attribute. Though when I tried: TYPE(TYPE) :: TYPE it didn't work. -- glen