🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3472

Re: Multi-level break and elimination of GOTO

#3472
From: Lawrence Kirby
Date: Sat, 11 Nov 1995 14:26
32 lines
1775 bytes
In article <481trh$cuj@news0.rain.rg.net> plong@perf.com "Paul Long" writes:

>Whoops, I remembered wrong! It's not simply that there is a conflict
>(specifically, a shift/reduce conflict), the problem is that, as
>Charles Fu indicated in another article, the grammar is ambiguous
>and no amount of lookahead will help. Expanding on what Charles
>wrote, this looks like a labeled do with an empty statement, right?
>
>    do outer
>        ;
>    while (0);
>
>Okay, but in the following form, it also looks like an unlabeled do
>with a statement that contains a single identifier.
>
>    do
>        outer;
>    while (0);
>
>If I can't figure out what it is, neither can the compiler. Let's
>try something else, or better yet, let's give up. :-)

It would be quite reasonable to specify the grammar to limit this type
of label only to compound statements. In fact one of the possibilities
is simply to define a compound statement label which has scope limited
to within the compound statement labelled.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID: <816099986snz@genesis.demon.co.uk>
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!genesis.demon.co.uk
References: <47s7l0$r18@news.mel.aone.net.au> <815950407snz@genesis.demon.co.uk> <480eio$2uf@news0.rain.rg.net> <481trh$cuj@news0.rain.rg.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!genesis.demon.co.uk
From: Lawrence Kirby <fred@genesis.demon.co.uk>
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: Multi-level break and elimination of GOTO
Date: Sat, 11 Nov 95 14:26:26 GMT
Organization: none
Message-ID: <816099986snz@genesis.demon.co.uk>
References: <47s7l0$r18@news.mel.aone.net.au> <815950407snz@genesis.demon.co.uk> <480eio$2uf@news0.rain.rg.net> <481trh$cuj@news0.rain.rg.net>
Reply-To: fred@genesis.demon.co.uk
X-NNTP-Posting-Host: genesis.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.27