On 2020-09-02 12:46, Paul Gilmartin wrote:
On Wed, 2 Sep 2020 10:47:05 +0000, Robert Prins wrote:
More than 20 years ago I wrote an edit macro "EDOEND", that lets me exclude, in
PL/I source, all statements other than
'PACKAGE',
'PROC',
'PROCEDURE',
'DO',
'BEGIN',
'SELECT', and
'END'
This seems to go hand-in-hand with HILITE. Does it understand that
PL/I has no reserved words and that any of the above might be merely
identifiers?
ISPF HILITE is just that highlight. It does not do any parsing of the language.
I think EDOEND predated HILITE, and it also has an option to just show all
"myproc: proc;" ... 'end myproc;' statements
"Language and logic hiliting is not supported for ASCII or UTF-8 editing
sessions and the HILITE command is not available during these edit sessions."
and a few days ago, using it again, I realised that it could benefit from adding
a bit of Doug Nadel magic to it, as the '_' character is not part of the word
character set, and as such the macro will happily un-exclude identifiers like
"list_end" etc.
Might this be extended to other languages such as Rexx, C, bash, ...
which have different lexical syntax? '{', '(', ')', and '}' might take the
function of DO and END. And FORTRAN, where blanks are ignored?
Of course it would be possible for EDOEND to detect the language, but as I only
use PL/I, that's left to the user. There is no option in ISPF to HILITE Fortran,
and people writing Fortran without blanks should be shot, hanged, and quartered!
However, before his MVS goodies page was removed, Doug had put a little routine
on it to include characters into the word character set:
...
tldp = ptr(ptr(24 + ptr(112 + ptr(132 + ptr(540)))))
tablep = ptr(24 + ptr(20 + ptr(96 + ptr(56 + tldp))))
do while wordchars <> ""
parse var wordchars char 2 wordchars
call storage d2x(tablep + c2d(char)),1,"00"x
...
Ouch! Is this zapping vendor code? How robust is it with respect to
vendor updates? I see 8 undocumented hard-coded constants.
I don't know when Doug wrote this, but he was the ultimate personification of
ISPF, and some of the constants are actually quite well documented, I'm sure
others can come up with more proper names, but 540 is "PSATOLD", and in one of
my execs I have some equally cryptic, but actually fully documented code:
tcb = ptr(540, 4) /* PSATOLD in PSA */
tiot = ptr(tcb + 12, 4) /* TCBTIO in TCB */
jscb = ptr(tcb + 180, 4) /* TCBJSCB in TCB */
jct = swareq(stg(jscb + 260, 4)) /* JSCBJCTA in JSCB */
act = ptr(jct + 40, 3) /* JCTACTAD in JCT */
ssib = ptr(jscb + 316, 4) /* JSCBSSIB in JSCB */
programmer = stg(act + 24, 20)
jobid = stg(ssib + 12, 8)
jobidnc = strip(substr(stg(ssib + 12, 8), 4, 5))
msgclass = stg(jct + 6, 1)
jobname = stg(tiot, 8)
stepname = stg(tiot + 8, 8)
procstepname = stg(tiot + 16, 8)
/* Add the characters you want to be part of a word below. This */
/* macro only needs to be run once per ISPF session but works fine */
/* as an initial macro or session macro (see manual for ZUSERMAC) */
Unfortunate choice of scope (but I suppose there was no choice.)
The user can't support different languages in different splits.
Never tried it, but what's stopping you?
I'd rather see an RFE allowing the user to specify the definition of
WORD, perhaps as a regular expression. But I wouldn't hold my
breath.
Neither would most of us.
Robert
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN