Re: Improved accuracy in diagnostics. Is it worthwhile?

"Ev. Drikos" <drikosev@gmail.com>
Sat, 19 Mar 2022 19:58:19 +0200

          From comp.compilers

Related articles
Improved accuracy in diagnostics. Is it worthwhile? drikosev@gmail.com (Ev. Drikos) (2022-03-18)
Re: Improved accuracy in diagnostics. Is it worthwhile? 480-992-1380@kylheku.com (Kaz Kylheku) (2022-03-18)
Re: Improved accuracy in diagnostics. Is it worthwhile? tkoenig@netcologne.de (Thomas Koenig) (2022-03-18)
Re: Improved accuracy in diagnostics. Is it worthwhile? drikosev@gmail.com (Ev. Drikos) (2022-03-19)
| List of all articles for this month |
From: "Ev. Drikos" <drikosev@gmail.com>
Newsgroups: comp.compilers
Date: Sat, 19 Mar 2022 19:58:19 +0200
Organization: Aioe.org NNTP Server
References: 22-03-035 22-03-038
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="94916"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, performance
Posted-Date: 19 Mar 2022 13:59:18 EDT
Content-Language: en-US

On 18/03/2022 20:12, Thomas Koenig wrote:
> ...
> If you are compiling, it is usually a small fraction of time that
> is spent in the parsing, and much more in optimization and code
> generation. An example: Compiling a 50 k line Fortran program with
> "gfortran -O2" takes 17.4 seconds on the computer I type this on.
> Checking with "gfortran -fsyntax-only" takes 4.2 seconds. (For
> those who want to reproduce: aermod.f90 from the Polyhedron suite).
> ...


Thanks. Just tested this large file and the runtime overhead seems
to be negligible.


Likely, I'll try the change but it took me a while to find another case
with enumerators (that also lack error recovery now). Although my trial
changes added messages for 43 states, some of them are useless and so
this approach seems to be useful for BNF rules with an optional tail.


Unavoidably, a parser/front-end has to make some guessing on error
and this doesn't change easily. So, any improvement without default
state reductions (hello Kaz) will be limited, as in the code below:




-----------------------------------------------------------------------


miniserver:errors suser$ cat enum-1.f90 && fcheck enum-1.f90
                  ENUM, BIND(C)
                    ENUMERATOR :: RED => 4, BLUE => 9
                    ENUMERATOR YELLOW
                  END ENUM
                  END
enum-1.f90:2: error: syntax:Unexpected: '=>'. Expected: ",", ";", or "=".


Parsed with Errors: enum-1.f90
miniserver:errors suser$


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.