Article View: comp.arch
Article #116Re: Comment delimiters
From: EricP
Date: Wed, 14 Oct 2026 19:45
Date: Wed, 14 Oct 2026 19:45
57 lines
3555 bytes
3555 bytes
On 2026-Oct-14 14:07, John Savard wrote:
> On Wed, 14 Oct 2026 12:14:30 -0400, George Neuner
> <gneuner2@comcast.net> wrote:
>
>> Seriously, no thoughts on block comments? Shouldn't every language be
>> forced to use /* */
>
> Using pairs of special characters for *any* purpose, from ** for
> exponentiation in FORTRAN onwards, and including <= and >= as
> relational operators, vastly complicates the syntax decoding of
> languages.
>
> Of course, even at
> http://www.quadibloc.com/comp/lngint.htm
> I couldn't _entirely_ avoid compounds of special characters. So what I
> did was adopt systematic rules:
> Only ?, @, and & can begin multi-character strings which are to be
> treated as a single character. @" is used for //, and @< and @> are
> used for /* and */. (The @ sign is generally used only for tokens
> which are "outside" of actual statements, at the upper level of the
> syntax.) &LE and &GE are used for <= and >=.
>
> Incidentally, C didn't invent /* and */; it got them from PL/I,
> although no doubt PL/I got them from some representation or other of
> ALGOL.
>
> John Savard
Most languages are not as bad as pre-FORTRAN-90.
Lexing ** into a single token is a 1 character lookahead.
Old FORTRAN is difficult to parse because
a) it did not separate the language into lexical and syntax levels
b) it was white space oblivious except in quoted strings
c) there were no reserved words - keywords were statement
position and sometimes semantic context dependent.
d) statements were based on punch cards BUT because
continuation cards used the absence of a C in column 6
to indicate the start of a new statement, parsers have to
always look ahead to see in the next card has a C and
then "unget" the card if not.
The classic ambiguous parsing example being
DO I = 1,100
DOI = 1.100
depends on the presence or absence of a "naked comma" later in the
statement to decide whether there is a keyword DO and a variable I,
or a variable DOI. A "naked comma" is a comma not enclosed inside
a quoted character or string, or inside a possibly nested parenthesis.
There are other examples like keywords in FORMAT statements.
People learned a lot of what not to do in language design
from old FORTRAN.
Technical Details
Message-ID:
<HZQzS.6$TYg.3@fx21.iad>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx21.iad.POSTED!not-for-mailReferences:
<1791742457-5857@newsgrouper.org> <11agm4p$2tfut$1@dont-email.me> <11ahs8q$38ir0$4@dont-email.me> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <179190779286.25645.14465927900754526737@media.vsta.org> <179190779286.25645.14465927900754526737@media.vsta.org> <vandys@vsta.org> <jwvjynl2cg0.fsf-monnier+comp.arch@gnu.org> <808vclt9i2mso89n1itvnvos5j88g1mopl@4ax.com> <6acfc2b2.1547984@news.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx21.iad.POSTED!not-for-mail MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Comment delimiters Newsgroups: comp.arch References: <1791742457-5857@newsgrouper.org> <11agm4p$2tfut$1@dont-email.me> <11ahs8q$38ir0$4@dont-email.me> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <179190779286.25645.14465927900754526737@media.vsta.org> <179190779286.25645.14465927900754526737@media.vsta.org> <vandys@vsta.org> <jwvjynl2cg0.fsf-monnier+comp.arch@gnu.org> <808vclt9i2mso89n1itvnvos5j88g1mopl@4ax.com> <6acfc2b2.1547984@news.eternal-september.org> Content-Language: en-CA From: EricP <ThatWouldBeTelling@thevillage.com> In-Reply-To: <6acfc2b2.1547984@news.eternal-september.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Lines: 57 Message-ID: <HZQzS.6$TYg.3@fx21.iad> X-Complaints-To: abuse@UsenetServer.com NNTP-Posting-Date: Wed, 14 Oct 2026 19:45:43 UTC Date: Wed, 14 Oct 2026 15:45:41 -0400 X-Received-Bytes: 3323