Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: lvalue assignment difference between C and C++ Date: Mon, 06 Feb 2023 13:03:11 -0800 Organization: None to speak of Lines: 28 Message-ID: <87r0v2ecc0.fsf@nosuchdomain.example.com> References: <0mvDL.68810$b7Kc.34465@fx39.iad> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="181ea74528ed435ea473c00f282e1c24"; logging-data="3366995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9Vm5rhHTISdWlRF9KORyg" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:Q/klYAVjH9zgbA1obVz3zwJjN34= sha1:dPeLrZ+za1mJVWHjUzUODgdYJ70= Xref: csiph.com comp.lang.c++:88994 comp.lang.c:169207 Muttley@dastardlyhq.com writes: > On Sun, 5 Feb 2023 11:42:04 +0100 > David Brown wrote: >>On the other hand, the vast majority of C compilers are /not/ C++ > > Ok, I should have said most of the *common* C++ compilers are also C compilers. Discussed elsewhere. >>If you look at hobby projects, one-man toolchains and niche compilers, I >>have never heard of any that support C++, while a working C compiler is >>something many people have written. > > I don't know if its true or not, but I read once that lexx and yacc are > quite capable of parsing C grammar and create the appropriate lex and parse > code but the C++ syntax is apparently beyond them because there are so many > token overloads and special cases. And that was IIRC before C++ 2011, never > mind now. C's grammar is not trivial to parse, due to typedefs. A typedef effectively creates a context-specific keyword, which means the parser has to interact with the symbol table. (Historically, this is because typedefs were introduced relatively late in the evolution of C.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */