Article View: vmsnet.tpu
Article #84RE: Matching multi-character delimiters?
From: Michael
Date: Thu, 12 Nov 1992 06:24
Date: Thu, 12 Nov 1992 06:24
41 lines
2228 bytes
2228 bytes
In a message of Wed, 11 Nov 1992 21:44:00 GMT
Received on 12 Nov 1992, 00:17 GMT
fairfield@slacvx.slac.stanford.edu wrote
to: Text Processing Utility (TPU) Language Discussion List <INFO-TPU@SHSU.edu>
> 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?
Well, yes. The idea with an array sounds good and could be extended to
look for \begin{array} \end{array} etc. But then the SELECT stuff
wouldn't work. Would make an interesting LaTeX mode.
--
Michael Lemke
Astronomy, UT Austin, Texas
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
Technical Details
Message-ID:
<921112002404.b73b@IO.AS.UTEXAS.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!uwm.edu!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!mccall!info-tpu-newsgate!listShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!uwm.edu!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!mccall!info-tpu-newsgate!list From: (Michael Newsgroups: vmsnet.tpu Subject: RE: Matching multi-character delimiters? Message-ID: <921112002404.b73b@IO.AS.UTEXAS.EDU> Date: 12 Nov 92 06:24:04 GMT Reply-To: "(Michael Lemke, Astronomy UT Austin, Phone: +1-(512)-471-1483)" Organization: The Internet Lines: 41 Return-Path: <TPU-Mgr@SHSU.edu> Errors-To: TPU-Mgr@SHSU.edu X-Listname: Text Processing Utility (TPU) Language Discussion List X-Vmsmail-To: SMTP%"fairfield@slacvx.slac.stanford.edu"