The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Dave Horsfall <dave@horsfall.org>
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: The 'usage: ...' message. (Was: On Bloat...)
Date: Mon, 20 May 2024 06:42:09 +1000 (EST)	[thread overview]
Message-ID: <alpine.BSF.2.21.9999.2405200632070.15285@aneurin.horsfall.org> (raw)
In-Reply-To: <CAKH6PiVSU4o5twt8EXZO6FAKdxMu19SOWLEyYRVa0yBM3BXAUA@mail.gmail.com>

On Sun, 19 May 2024, Douglas McIlroy wrote:

> Another non-descriptive style of error message that I admired was that 
> of Berkeley Pascal's syntax diagnostics. When the LR parser could not 
> proceed, it reported where, and automatically provided a sample token 
> that would allow the parsing to progress. I found this uniform 
> convention to be at least as informative as distinct hand-crafted 
> messages, which almost by definition can't foresee every contingency. 
> Alas, this elegant scheme seems not to have inspired imitators.

I did something like that for our compiler-writing assignment.  An 
ALGOL-like language (I think I used ALGOLW) it would detect when a 
semicolon was missing, and insert it (with a warning).  As a test case, it 
successfully compiled a program with no semicolons at all...

-- Dave

  parent reply	other threads:[~2024-05-19 20:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-19 14:03 [TUHS] " Douglas McIlroy
2024-05-19 16:18 ` [TUHS] " Paul Winalski
2024-05-19 16:21   ` Paul Winalski
2024-05-19 17:22 ` [TUHS] Re: The 'usage: ...' message Ralph Corderoy
2024-05-19 20:42 ` Dave Horsfall [this message]
2024-05-19 23:08 [TUHS] The 'usage: ...' message. (Was: On Bloat...) Douglas McIlroy
2024-05-20  0:58 ` [TUHS] " Rob Pike
2024-05-20  3:19   ` arnold
2024-05-20  3:43     ` Warner Losh
2024-05-20  4:46       ` arnold
2024-05-20  3:54   ` Bakul Shah via TUHS
2024-05-20 14:23   ` Clem Cole
2024-05-20 17:30     ` Greg A. Woods
2024-05-20 20:10     ` John Levine
2024-05-21  1:14       ` John Cowan
2024-05-20 17:40   ` Stuff Received

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.BSF.2.21.9999.2405200632070.15285@aneurin.horsfall.org \
    --to=dave@horsfall.org \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).