home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!doug.cae.wisc.edu!umn.edu!noc.msc.net!uc.msc.edu!apctrc!wsc!mozart!zjlc12
- From: zjlc12@hou.amoco.com (Jerry Campbell)
- Newsgroups: comp.lang.rexx
- Subject: PARSE wishlist/brainstorming
- Message-ID: <1992Aug20.154822.8057@hou.amoco.com>
- Date: 20 Aug 92 15:48:22 GMT
- Sender: news@hou.amoco.com
- Reply-To: zjlc12@hou.amoco.com
- Organization: Amoco
- Lines: 47
-
- Why not add the STEM keyword to the Parse instruction?
-
- Parse Var data STEM (stem style template)
-
- where template could be composed of the usual string pattern matching and
- numeric positional specifiers. String patterns would work in the usual way.
- The numeric positional (column) specifiers would indicate a stem variable
- range to assign to. The numerics would imply a starting location (stem index)
- and a repetition factor. I sure I'm not making myself clear. Let me try an
- example:
-
- data = "Hello world, hello solar sytem, hello galaxy"
- Parse Var data STEM "hello" 1 stem. +3
-
- and Parse would assign to stem. like so:
-
- stem.1 = "world,"
- stem.2 = "solar system,"
- stem.3 = "galaxy"
-
- Another possible new feature that could make use of the STEM idea would be a
- new source keyword, such as QUEUE. QUEUE would imply "Parse Pull" and keep
- on pulling till the repetition implied in the stem template is
- satisfied or end of stack is reached. Example:
-
- Address "uni-shell" "ls -l" "TO QUEUE"
- Parse QUEUE STEM 1 permissions. . user. size. . . . filename.
-
- and have the lines output from the ls command parsed into the stem variables
- permission. , user. , size. , and filename.
-
- Or better yet, how about adding the concept of data streams/files to Rexx so you
- could read an input stream/file in the following way:
-
- Address "uni-shell" "ls" "TO STDIN"
- Parse STREAM STDIN STEM 1 records. +999 (CR_LF)
-
- and have records.(1-eof) loaded with the data waiting on STDIN (the CR_LF variable
- would contain line separator characters to break the stream into record/line chunks).
-
- Anyone care to comment? Feel free to flame away. This wasn't meant to be a
- really serious proposal, just a thought stimulator.
-
- ---
- Jerry Campbell reply to: zjlc12@hou.amoco.com
- Amoco Corp. ISD SSS/Graphics
- Houston, Tx. 713/556-7036
-