mirror of
https://github.com/PDP-10/its.git
synced 2026-03-22 17:08:15 +00:00
1005 lines
42 KiB
Plaintext
Executable File
1005 lines
42 KiB
Plaintext
Executable File
!* -*-teco-*- This library implements EMACS PL1 MODE. The source
|
||
resides in MC:ECC;PL1LIB >, compiled version in
|
||
EMACS;PL1 :EJ on all machines. Note that the
|
||
source assumes the use of EMACS;IVORY, not EMACS;PURIFY.!
|
||
|
||
!* Initially designed by Charles R. Davis and Eugene C. Ciccarelli, in the
|
||
* fall of 1977 (I think), and implemented by the latter (ECC).!
|
||
|
||
|
||
!~FILENAME~:! !Package for editing PL1 code (PL1 MODE).!
|
||
PL1
|
||
|
||
!PL1 Mode:! !C Set up for editing PL1 code.
|
||
"/* " and " */" become comment delimiters.
|
||
$PL1IND ..D$ is set up for use by PL1 indent macros. (E.g. no special
|
||
Lisp characters, and _ is not a break.)
|
||
Calls user-providable macro, INIT PL1 MODE, which can put pl1
|
||
macros into desired qregs. If no macro exits, calls
|
||
& Default Init PL1 Mode. See the description of that subr
|
||
for more details on what it does and how to construct your own.!
|
||
|
||
m(m.m & Init Buffer Locals) !* Discard locals of old mode, and set: *!
|
||
!* .Q: Make Local Q-Reg. *!
|
||
!* .0: old value of $Switch Mode Process *!
|
||
!* Options$ *!
|
||
|
||
!* Standard stuff to set up: *!
|
||
|
||
1,:i*/* m.LComment Startw !* Comment start... *!
|
||
1,:i*/* m.LComment Beginw !* begin... *!
|
||
1,:I* */M.LComment Endw !* And comment end. *!
|
||
1,m.m& Indent Without Tabsm.LMM & Indentw !* Dont use tabs. *!
|
||
1,m.m& XIndent Without Tabsm.LMM & XIndentw !* ... *!
|
||
1,36m.LCOMMENT COLUMNw !* Set comment column. *!
|
||
|
||
!* Now either personal or standard init: *!
|
||
!* They can use .0, .Q. *!
|
||
1:<m(m.mInit PL1 Mode) !* Call users init. *!
|
||
>"N !* User has no init, *!
|
||
m(m.m& Default Init PL1 Mode)' !* ...so use default one. *!
|
||
|
||
m.vPL1IND ..Dw !* Create a var for our dispatch table. *!
|
||
^:iPL1IND ..D| A A AA A AA AA A A ( ) A A A AA A AA AA AA AA AA AA AA AA AA AA A A A A A A A AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA A A A A AA A AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA A A A A | !* And set up the dispatch table. *!
|
||
|
||
q.0,1M(M.M& Set Mode Line)PL1 !* Set, display mode. *!
|
||
|
||
|
||
!Cref PL1 Labels:! !C Crefs label references in a PL1 listing in the buffer.
|
||
The buffer should be a compilation listing.
|
||
If you just want a listing, not an object segment, try
|
||
compiling with options -sb -ck.
|
||
If a statement on a line references more than one label then
|
||
whichever label is highest alphabetically will be creffed.
|
||
If you want to cref a source, not a listing, use MM Cruf PL1 Entries.!
|
||
|
||
[7[9 f[sstring !* save!
|
||
fsruntimeu7 .u9 fn q9j !* 7: Start time.!
|
||
!* 9: Original point, auto-restored.!
|
||
zj -s
|
||
NAMES DECLARED BY EXPLICIT CONTEXT.
|
||
fkc [1 .u1 !* 1: start cref.!
|
||
[2 :s
|
||
|
||
"N .u2 '"# zu2 ' !* 2: end cref.!
|
||
[0 q..ou0 q1j !* 0: list buffer.!
|
||
[..o !* be sure to restore that!
|
||
!* buffer.!
|
||
fsbcreatew [3 q..ou3 !* 3: table buffer.!
|
||
[4 !* 4: dcl line#.!
|
||
[5 !* 5: ref line#.!
|
||
q0u..o !* to list buffer.!
|
||
|
||
< !* Do next dcl.!
|
||
.,q2:fb dcl ; \u4 !* 4: dcl!
|
||
:sref; !* Get its refs.!
|
||
f<!NEXT REF! !* Catch when done 1 ref.!
|
||
c !* past space??!
|
||
1< 0,1a"c \u5 !* ref#!
|
||
q4-q5"N !* ignore dcl=ref case!
|
||
q3u..o 4,q5\ !* pad with 0s for sorting, search!
|
||
!* now in table buffer.!
|
||
i 4,q4\ !* ref-dcl to tbl!
|
||
i
|
||
q0u..o'' !* list buffer.!
|
||
0,1a-15."e 1l 0,1a- "n 1f;NEXT REF' !* end of ref!
|
||
s 2r' !* still in ref!
|
||
>> !* done ref processing!
|
||
> !* done dcl processing!
|
||
|
||
|
||
|
||
q3u..o fwl l !* Now sort ref-dcl table, ordering by ref.!
|
||
|
||
|
||
|
||
!* MUST REMOVE DUPLICATES!
|
||
|
||
!* Now search for each ref line and put cref in place of blanks.!
|
||
|
||
q0u..o bj q3u..o bj !* to top in both buffers.!
|
||
|
||
< !* next ref/dcl!
|
||
q3u..o :s ; .-5,.-1x5 !* 5: ref!
|
||
4 |