Frank Swarbrick wrote about trying to parse z/OS-style parameter lists, with
nested parens, in Rexx.
This has been a challenge since Rexx leapt from VM (where its parsing fits the
normal command syntax). In part, I'd say that IF you can make statements about
how things MUST be specified, you can do OK. For example, is this valid:
Input: parens cobol(test)somethingelse(woof)
? If so, then it's harder. But I suspect that's not "normal" in z/OS-land, so
if you say "Each entity must be space-delimited", then you can take something
like:
Input: parens cobol(test(member)) somethingelse(woof)
And parse it:
arg args
do while args <> ''
parse var args option args
option = space(option, 0)
parse var option keyword '(' value ')' +1 paren
if paren = ')' then /* It's nested! */
...
This can, of course, be made more iterative. It ain't that pretty, but it's not
too hard to do. I can even imagine a function that returns multiple nested
values, at least to the Rexx implementation limit (typically 250).
Does this help?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN