🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6314

Re: language commenting constructs

#6314
From: F. L. Charles Seeger III
Date: Wed, 15 Mar 1989 22:57
27 lines
1917 bytes
In article <12362@watdragon.waterloo.edu> gvcormack@watdragon.waterloo.edu (Gordon V. Cormack) writes:
|
|The lack of nested comments is an artifact of the conventional
|way of building compilers using a finite state scanner and a
|context-free parser.  It is difficult (very difficult) to recognise
|nested comments with a finite state scanner.

Isn't it extremely trivial to augment a FSM scanner with a counter to keep
track of nesting level?  A heuristic nesting limit can be used to catch
mismatched comment delimiters.  Of course, whatever the limit, it should
be settable via the command line.  I don't think that I've ever wanted to
nest more than two levels deep.  Would that be so difficult with a "pure"
FSM scanner?  Then again, lack of nested comments isn't something that
I get excited about.

|With modern text editors, is there really any excuse for bracketed
|comments?  I think end-of-line is a perfect comment terminator.
|Then nesting becomes a non-issue.

Personally, I like bracketed comments for "commenting out" code (no flames
please) and for long, multi-line comments for files and functions.  Seems
pretty easy to provide both without a significant performance hit.

--
  Charles Seeger            216 Larsen Hall		+1 904 392 8935
  Electrical Engineering    University of Florida
  seeger@iec.ufl.edu        Gainesville, FL 32611
Technical Details
Message-ID: <19925@uflorida.cis.ufl.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!uflorida!poe.ufnet.ufl.edu!seeger
References: <Mar.11.18.24.04.1989.18285@athos.rutgers.edu> <1543@zen.UUCP> <12362@watdragon.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!uflorida!poe.ufnet.ufl.edu!seeger
From: seeger@poe.ufnet.ufl.edu (F. L. Charles Seeger III)
Newsgroups: comp.lang.misc
Subject: Re: language commenting constructs
Message-ID: <19925@uflorida.cis.ufl.EDU>
Date: 15 Mar 89 22:57:41 GMT
References: <Mar.11.18.24.04.1989.18285@athos.rutgers.edu> <1543@zen.UUCP> <12362@watdragon.waterloo.edu>
Sender: news@uflorida.cis.ufl.EDU
Reply-To: seeger@iec.ufl.edu (F. L. Charles Seeger III)
Organization: UF EE Dept
Lines: 27