comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada to Ada Translator ?
Date: Tue, 21 May 2019 17:20:18 -0500
Date: 2019-05-21T17:20:18-05:00	[thread overview]
Message-ID: <qc1tj2$k06$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: a8d0f6ca-d5cf-4831-8803-9c1bb6198116@googlegroups.com

Oops, sent too soon:

"Optikos" <optikos@verizon.net> wrote in message 
news:a8d0f6ca-d5cf-4831-8803-9c1bb6198116@googlegroups.com...
On Monday, May 20, 2019 at 6:19:55 PM UTC-5, Randy Brukardt wrote:
> "Optikos" wrote in message
> news:64883feb-3e49-4c6a-855c-6673068e970c@googlegroups.com...
...
> But I think that error messages for *syntax* in a compiler are pretty much
> irrelevant these days; it's the IDE's job to check the syntax before 
> calling
> the compiler, and in the IDE you only care about the first error anyway.
> Presuming the check is fast enough (and it is on all but the largest 
> files),
> you check, then fix, then check again until it is correct.

I didn't say "syntax".  My "/this/" and "/that/" are wide-meaning enough to 
encompass semantic checks as well.  LR reductions are often abstracted 
enough at an index into a table to have (at the surface level without 
digging again) the easily-available-at-hand contextual information to give 
good-human-friendly semantic error messages of the category:  I thought we 
were doing /this/ but then you gave me conflicting /that/ semantically. 
Because they are human-crafted for human consumption, LL parsers tend to not 
aggressively conflate abstractions as much as LR parser tables try to 
conflate commonality to avoid combinatorial or exponential explosion.  With 
LR parsers, there is more digging & sifting through what just got 
successfully (fully-syntactically and partially-semantically) parsed to 
analyze it.  LL grammars do somewhat less of that rediscovery because LL 
parsers tended to preserve more implicit knowledge of what has been accepted 
so far.  All that I am saying is that LL parsers tend to have more 
interesting accumulated state implicitly laying around locally that LR 
parsers need to overtly either accumulate via intentionally-crafted mementos 
a priori or go digging & sifting through a posteriori.

----

This is just a bunch of babble. Most compilers do all of their semantic 
analysis using an AST, and that would be the same regardless of the parsing 
technology. Janus/Ada doesn't use an AST for the entire program, but even in 
it, the grammar productions are irrelevant once semantic processing 
starts -- that's all driven by the synbol table and the relevant entites. 
The quality of semantic error messages is what the compiler writer makes 
them, and any claim that some technology makes it harder is probably an 
excuse for doing a bad job. (That's my attitude about bad Janus/Ada 
messages - I try to improve them, not complain about how hard it is.)

                                                 Randy.



  parent reply	other threads:[~2019-05-21 22:20 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 14:21 Ada to Ada Translator ? foo wong
2019-05-17 21:00 ` Simon Wright
2019-05-18 12:05   ` foo wong
2019-05-18 12:11     ` foo wong
2019-05-18 14:47     ` Simon Wright
2019-05-18 15:26       ` foo wong
2019-05-18 16:48         ` Simon Wright
2019-05-19 16:04         ` G.B.
2019-05-19 17:08           ` Simon Wright
2019-05-19 18:27             ` Optikos
2019-05-19 21:27               ` Simon Wright
2019-05-19 21:42               ` Simon Wright
2019-05-21 20:54                 ` Optikos
2019-05-22  6:59                   ` Simon Wright
2019-05-22 12:06                     ` Optikos
2019-05-22 12:33                       ` Simon Wright
2019-05-22 12:57                         ` foo wong
2019-05-22 15:24                           ` Shark8
2019-05-22 16:34                             ` Optikos
2019-05-22 20:07                               ` Randy Brukardt
2019-05-23  7:21                           ` G. B.
2019-05-22 13:33                         ` Optikos
2019-05-20 14:11         ` Optikos
2019-05-20 16:37           ` foo wong
2019-05-18 15:44       ` foo wong
2019-05-18 16:49         ` Simon Wright
2019-05-19 15:04         ` G.B.
2019-05-19 12:41 ` Optikos
2019-05-19 17:38   ` foo wong
2019-05-19 22:52   ` foo wong
2019-05-20 23:19   ` Randy Brukardt
2019-05-21  0:13     ` Optikos
2019-05-21 22:15       ` Randy Brukardt
2019-05-22  0:16         ` Optikos
2019-05-22 20:16           ` Randy Brukardt
2019-05-22 23:27             ` foo wong
2019-05-23  7:56               ` Simon Wright
2019-05-23 12:29                 ` foo wong
2019-05-21 22:20       ` Randy Brukardt [this message]
2019-05-21  0:17     ` Optikos
2019-05-22 18:49 ` Optikos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox