Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

At many levels, Perl is a "diagonal" language. -- Larry Wall in <199709021854.LAA12794@wall.org>


devel / comp.lang.fortran / Improved accuracy in diagnostics. Is it worthwhile?

SubjectAuthor
* Improved accuracy in diagnostics. Is it worthwhile?Ev. Drikos
+- Re: Improved accuracy in diagnostics. Is it worthwhile?Daniel Feenberg
`* Re: Improved accuracy in diagnostics. Is it worthwhile?gah4
 `- Re: Improved accuracy in diagnostics. Is it worthwhile?Ev. Drikos

1
Improved accuracy in diagnostics. Is it worthwhile?

<t1203d$1leb$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1848&group=comp.lang.fortran#1848

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!r8HxJyhrTrz9sPOgj3OQFw.user.46.165.242.91.POSTED!not-for-mail
From: drikosev@gmail.com (Ev. Drikos)
Newsgroups: comp.lang.fortran
Subject: Improved accuracy in diagnostics. Is it worthwhile?
Date: Fri, 18 Mar 2022 15:05:49 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t1203d$1leb$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="54731"; posting-host="r8HxJyhrTrz9sPOgj3OQFw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.5.1
X-Notice: Filtered by postfilter v. 0.9.2
X-Mozilla-News-Host: news://news.aioe.org
Content-Language: en-US
 by: Ev. Drikos - Fri, 18 Mar 2022 13:05 UTC

Hello,

This is mainly a parsing question but it's also Fortran related as well.

When I make syntax checking with the command 'fcheck' in the code below,
the error message doesn't contain a '(' in the expected tokens. This
happens due to default actions, although the parser is basically LALR. A
pure LALR parser wouldn't make reductions without examine the lookahead.

Default actions are useful because they save a lot of space in parsing
tables, at the cost of missing expected tokens in the error messages
printed by the command 'fcheck'. This is the relevant BNF rule for the
example given at the end of this message:

implicit-stmt ::=
IMPLICIT implicit-spec-list
| IMPLICIT NONE [ ( [ implicit-none-spec-list ] ) ]

Disabling default actions for the command 'fcheck' is fairly simple,
just a button click in Syntaxis, but at the moment I can't think of
how many error messages would be improved, whereas a parsing table
increase (50%) would be granted. The command 'fcheck' can be found at
https://github.com/drikosev/Fortran

So far, my approach has been that improved diagnostics shouldn't slow
down the processing of correct programs. Is it worthwhile to improve
diagnostics by disabling default actions in a LALR parser?

Thanks,
Ev. Drikos

----------------------------------------------------------------------
$ cat default-actions.f90 && fcheck default-actions.f90
IMPLICIT NONE ? (type, external)
PRINT *, "Only ';', not a '(', in the expected tokens in diagnostics."
END

default-actions.f90:1: error: syntax:Unexpected: '?'. Expected: ";".

Parsed with Errors: default-actions.f90
$

Re: Improved accuracy in diagnostics. Is it worthwhile?

<6e9ac150-dad7-4417-92fa-2f4fd82af325n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1849&group=comp.lang.fortran#1849

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:4104:b0:42c:1db0:da28 with SMTP id kc4-20020a056214410400b0042c1db0da28mr7049659qvb.67.1647609488921;
Fri, 18 Mar 2022 06:18:08 -0700 (PDT)
X-Received: by 2002:a81:1ed2:0:b0:2e5:84ba:65a4 with SMTP id
e201-20020a811ed2000000b002e584ba65a4mr11039691ywe.170.1647609488718; Fri, 18
Mar 2022 06:18:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 18 Mar 2022 06:18:08 -0700 (PDT)
In-Reply-To: <t1203d$1leb$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=71.192.180.75; posting-account=UKzVQwoAAAC0p4fW4nFhSsDyRRVgSJiF
NNTP-Posting-Host: 71.192.180.75
References: <t1203d$1leb$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6e9ac150-dad7-4417-92fa-2f4fd82af325n@googlegroups.com>
Subject: Re: Improved accuracy in diagnostics. Is it worthwhile?
From: feenberg@gmail.com (Daniel Feenberg)
Injection-Date: Fri, 18 Mar 2022 13:18:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 23
 by: Daniel Feenberg - Fri, 18 Mar 2022 13:18 UTC

On Friday, March 18, 2022 at 9:05:54 AM UTC-4, Ev. Drikos wrote:
....
> Default actions are useful because they save a lot of space in parsing
> tables, at the cost of missing expected tokens in the error messages
> printed by the command 'fcheck'. This is the relevant BNF rule for the
> example given at the end of this message:
....
> So far, my approach has been that improved diagnostics shouldn't slow
> down the processing of correct programs. Is it worthwhile to improve
> diagnostics by disabling default actions in a LALR parser?
> ...
>
> Thanks,
> Ev. Drikos
>
..

Improved diagnostics might reduce the number of compilations required before a program was correct. Hence the concern about improved diagnostics slowing down the processing of correct programs might be misplaced. Personally I find good diagnostics a very pleasant surprise when encountered and a strong incentive to use that compiler.

Daniel Feenberg

Re: Improved accuracy in diagnostics. Is it worthwhile?

<dd538a9b-7b05-4c06-bac1-ed9e0a3c6965n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1850&group=comp.lang.fortran#1850

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:5de5:0:b0:441:50e:ce56 with SMTP id jn5-20020ad45de5000000b00441050ece56mr2352540qvb.128.1647636869701;
Fri, 18 Mar 2022 13:54:29 -0700 (PDT)
X-Received: by 2002:a25:6c03:0:b0:62c:2c43:cd29 with SMTP id
h3-20020a256c03000000b0062c2c43cd29mr11924392ybc.478.1647636869496; Fri, 18
Mar 2022 13:54:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 18 Mar 2022 13:54:29 -0700 (PDT)
In-Reply-To: <t1203d$1leb$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:f9f3:6737:20f3:b3a6;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:f9f3:6737:20f3:b3a6
References: <t1203d$1leb$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dd538a9b-7b05-4c06-bac1-ed9e0a3c6965n@googlegroups.com>
Subject: Re: Improved accuracy in diagnostics. Is it worthwhile?
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 18 Mar 2022 20:54:29 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 19
 by: gah4 - Fri, 18 Mar 2022 20:54 UTC

On Friday, March 18, 2022 at 6:05:54 AM UTC-7, Ev. Drikos wrote:
> This is mainly a parsing question but it's also Fortran related as well.
You might ask in comp.compilers, where parsing questions go.

> When I make syntax checking with the command 'fcheck' in the code below,
> the error message doesn't contain a '(' in the expected tokens. This
> happens due to default actions, although the parser is basically LALR. A
> pure LALR parser wouldn't make reductions without examine the lookahead.
This is an interesting case. Since the ( isn't required, it isn't so obvious
that the message should mention it.

On the other hand, if a common error was to put in a letter and forget
the (), then it is a nice reminder.

Seems to me that the question is more user experience, and less
parsing tables. Users can make some strange mistakes, and it is
nice to help them in those cases. But you can't find all the cases.

Re: Improved accuracy in diagnostics. Is it worthwhile?

<t1br40$1ia8$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1912&group=comp.lang.fortran#1912

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!r8HxJyhrTrz9sPOgj3OQFw.user.46.165.242.91.POSTED!not-for-mail
From: drikosev@gmail.com (Ev. Drikos)
Newsgroups: comp.lang.fortran
Subject: Re: Improved accuracy in diagnostics. Is it worthwhile?
Date: Tue, 22 Mar 2022 08:42:06 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t1br40$1ia8$1@gioia.aioe.org>
References: <t1203d$1leb$1@gioia.aioe.org>
<dd538a9b-7b05-4c06-bac1-ed9e0a3c6965n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="51528"; posting-host="r8HxJyhrTrz9sPOgj3OQFw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.5.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
X-Mozilla-News-Host: news://news.aioe.org
 by: Ev. Drikos - Tue, 22 Mar 2022 06:42 UTC

On 18/03/2022 22:54, gah4 wrote:
>
> This is an interesting case. Since the ( isn't required, it isn't so obvious
> that the message should mention it.

There are more vague cases (IMHO of course), ie the "." (dot) and the
new line character (ASCII decimal code 10).

-GNU Fortran ie accepts the dot as an alternative to "%" only if the
command line option "-fdec" has been specified (legacy support).

-The new line character is an alternative to ";" in Fortran lines but
the only character that ends an OpenMP statement in Fortran programs.

Not sure if users would like to see all the above duplicate choices
or just a "\n" instead of a "; or \n" and a "%" instead of ". or %".

> ...
>
> Seems to me that the question is more user experience, and less
> parsing tables.
>

IMHO, one has to figure out out what programmers find less disturbing.
Also, the command 'fcheck' is a LALR based parser, which means that the
lookahead sets may contain spurious tokens (in few cases I hope).


devel / comp.lang.fortran / Improved accuracy in diagnostics. Is it worthwhile?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor