|How detect grammar not derive nonterminals ? firstname.lastname@example.org (Andy) (2023-09-11)|
|Re: How detect grammar not derive nonterminals ? email@example.com (gah4) (2023-09-12)|
|Re: How detect grammar not derive nonterminals ? firstname.lastname@example.org (Andy) (2023-09-13)|
|Re: How detect grammar not derive nonterminals ? email@example.com (Kaz Kylheku) (2023-09-14)|
|Re: How detect grammar not derive nonterminals ? firstname.lastname@example.org (gah4) (2023-09-14)|
|From:||Kaz Kylheku <email@example.com>|
|Date:||Thu, 14 Sep 2023 03:41:12 -0000|
|Injection-Info:||gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="87929"; mail-complaints-to="firstname.lastname@example.org"|
|Posted-Date:||14 Sep 2023 18:40:45 EDT|
On 2023-09-13, gah4 <email@example.com> wrote:
> On Tuesday, September 12, 2023 at 10:42:28 AM UTC-7, Andy wrote:
> (the subject not included in the message)
>> How detect grammar not derive nonterminals ?
> Ethernet uses the spanning tree protocol to detect loops in a switched network.
> I think the same idea works here, but didn't try it.
Loops are allowed in a grammar, and are the essence of expressive
languages that can generate sentences of arbitrary length/depth.
The situation is similar to recursion: recursion can terminate
or run away.
This has a loop, but is okay, because it has a terminating case:
A := A b | b
This isn't okay; and note that all we did was take *away* the b case:
A := A b
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
[At the very least, you'd need some rules that don't have nonterminals
on the right side to make it possible to break loops. -John]
Return to the
Search the comp.compilers archives again.