🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by fairfield Wed, 11 Nov 1992 21:44
Matching multi-character delimiters?
#82
Author: fairfield
Date: Wed, 11 Nov 1992 21:44
32 lines
1851 bytes
    All this discussion about matching up delimiters brought to mind a
case I don't think is handled by any of the procedures posted: has
anyone thought about the problem of, for example, matching opening and
closing comment delimitors in C?  

	/* Hi! I'm a comment, what are you? */

I've thought of two possiblities:

    1) Create an _array_ of left-delimitors and an array of 
       right-delimitors with each array entry being a string
       of arbitrary length.  You might need to order the array
       elements so as to check the multi-character delimiters 
       before the single character ones if the multi's included
       characters in the single-character set...

    2) Use SELECT to highlight a string of characters, then do
       a "MATCH SELECTED".  Eve_Match_Selected would extract the
       selected string of characters and reverse them to form the
       match delimiter string.  Problem here is you don't know
       whether to search FORWARD or REVERSE sine there is no
       intrinsic left- or rightness to the strings.

Comments?

		Cheers, Ken
-- 
 Dr. Kenneth H. Fairfield    |  Internet: Fairfield@Slac.Stanford.Edu
 SLAC, P.O.Box 4349, MS 98   |  DECnet:   45537::FAIRFIELD (45537=SLACVX)
 Stanford, CA   94309        |  BITNET    Fairfield@Slacvx
 ----------------------------------------------------------------------------
 These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads