Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Programming exercise/challenge
Date: Sat, 23 Jan 2021 09:51:30 -0800
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <86im7nmti5.fsf@linuxsc.com>
References: <86wnxwkyol.fsf@linuxsc.com> <2DaJH.72833$kZ1.12267@fx37.iad> <86d52273-f9eb-45a3-8a8d-5a106679d1c8n@googlegroups.com> <97ebd421-8f0f-4621-bdb9-96d655ba9d9an@googlegroups.com> <86czybpljj.fsf@linuxsc.com> <1ebc19c3-093d-4bc0-b680-aedbb9576eb5n@googlegroups.com> <868s8uozxo.fsf@linuxsc.com> <6a2e3784-1cb3-4d6a-99c2-6ac650dd6fben@googlegroups.com> <864kjbo2ql.fsf@linuxsc.com> <44c73f50-33af-43bb-afa2-a3b0244c7160n@googlegroups.com> <20210122103411.187@kylheku.com> <20210122130300.245@kylheku.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="52b538951ae99e6f169b0f62774a9fae"; logging-data="15702"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19avUjDtaahMZPnSLlR4cL/WXdg1V1kyJI="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:gb1u9afjemqStXFTTsCejAEcaAk= sha1:2Dn/EwUr2oXIl73uK+zklbZt02M=
Xref: csiph.com comp.lang.c:158582
Kaz Kylheku <563-365-8930@kylheku.com> writes:
> On 2021-01-22, Bart wrote:
>
>> On 22/01/2021 19:00, Kaz Kylheku wrote:
>>
>>> \
>>> \
>>>
>>>
>>> produce
>>>
>>>
>>>
>>> The next translation phase can then be tested with cases that do not
>>> include line continuation; that matter is settled by a correctly working
>>> previous translation phase.
>>
>> This is what makes the challenge in the OP harder.
>
> No, it doesn't; you just read input from state machine which
> handles that requirement, and then the rest of the code is completely
> oblivious to any line continuation requirement.
>
>> \newline sequences need to be retained, depending on context which
>> normally a compiler will know nothing about at this stage.
>
> The requirement for retaining uncommented line continuations
> was something that was needed by Tim in the original situation where
> the original program was deployed; it's not coming from the C language.
>
> I found my program quite easy to modify to accomodate the requirement,
> even though it was based on abuse of goto, which supposedly makes
> maintenance harder.
Note that there are still cases that your program gets wrong.