Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Top 10 most common hard skills listed on resumes... Date: Sat, 31 Aug 2024 14:03:56 -0700 Organization: None to speak of Lines: 28 Message-ID: <87le0c4d6r.fsf@nosuchdomain.example.com> References: <874j75zftu.fsf@bsb.me.uk> <87mskwy9t1.fsf@bsb.me.uk> <875xrkxlgo.fsf@bsb.me.uk> <87o75bwlp8.fsf@bsb.me.uk> <871q27weeh.fsf@bsb.me.uk> <20240829083200.195@kylheku.com> <87v7zjuyd8.fsf@bsb.me.uk> <20240829084851.962@kylheku.com> <87mskvuxe9.fsf@bsb.me.uk> <875xrivrg0.fsf@bsb.me.uk> <20240829191404.887@kylheku.com> <86cylqw2f8.fsf@linuxsc.com> <871q2568vl.fsf@nosuchdomain.example.com> <20240830232138.772@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 31 Aug 2024 23:03:56 +0200 (CEST) Injection-Info: dont-email.me; posting-host="78f6e35217d9802ff674987bcdbe52ec"; logging-data="1215711"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GyyrO3FpR9cPv75+NKCf/" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:i47SswATeNuSX7cbXeJYv6mjliA= sha1:i+G5QEntx39uwx/YeG/iawaMwvQ= Xref: csiph.com comp.lang.c:388058 James Kuyper writes: > On 8/31/24 03:08, Kaz Kylheku wrote: >> On 2024-08-30, Keith Thompson wrote: > ... >>> However, the compilers I've tried produce the same diagnostic (not a >>> syntax error message) for both. Probably they use a tweaked grammar >>> that allows more a general expression as the LHS of an assignment, >>> and catch errors later in semantic analysis, for the purpose of >>> producing diagnostics that are easier to understand. It's obvious >>> that in `x + 1 = y`, the programmer (probably) intended `x + 1` >>> to be the LHS of an assignment. These compilers (I tried gcc, >>> clang, and tcc) are clever enough to recognize that. >> >> A standard operator precedence parsing algorithm such as Shunting Yard >> cannot help but parse that. > > True, which is an example of why a precedence parsing algorithm is > inappropriate for parsing C, which is not defined in terms of precedence > levels. Perhaps -- but as long as it's used in a way that allows all syntax errors and constraint violations to be diagnosed, it's not a problem. I haven't looked into what parsing algorithms any existing compilers use. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */