Google
 

Trailing-Edge - PDP-10 Archives - steco_19840320_1er_E35 - 10,5676/teco/macros/pgmfmt.tec
There is 1 other file named pgmfmt.tec in the archive. Click here to see a list.
!PROGRAM FORMATTING TECO MACRO, DIRECTLY FROM THE DECSYSTEM-10
USER'S GUIDE TO TECO.  WILL FORMAT THE ENTIRE FILE, BASED ON YOUR
GIVING A FILENAME.  RUNS IN 1EO MODE.!
HKIEB "?" FOR HELP!GET-FILE!
FILE: !NXCHR!UTQT-63"E
TYPE THE FILENAME OF THE MACRO PROGRAM TO BE FORMATTED (LINES-UP
COMMENTS, ETC.).  DEFAULT EXTN IS .MAC.  END WITH <CR>.OGET-FILE
'QT-^O177"E.-1,.T-DONXCHR'QT-^O25"E^UOGET-FILE'
QT-^O15"NQTIONXCHR'IJ:S."FZ-1JI.MAC'HXTMTEY
[WAIT...THIS MAY TAKE A WHILE]
1EO!START!0UL<S
;%L>ZJR1A-10"N%L'!		COUNT LINES ON PAGE!
!LOOP!JQL<0UC1A-90"GOZ'!		EXECUTE LOOP ONCE FOR EACH LINE!
!FSTCH!1A"COTAG'
!FSTCH2!1A-9"ECOOP'1A-32"NOZ'
!FSTCH3!%C-8"GOZ'C1A-32"EOFSTCH3'1A-9"EQC-7"GOZ'COFSTCH4'
QC-8"GOZ'
!FSTCH4!0US!			CHANGE LEADING SPACES TO A TAB!
!FSTCH5!-D%S-QC"LOFSTCH5'	OOP
!TAG!%C-6"GOZ'C1A"COTAG'1A-58"NOZ'
!COLON!0USC1A-9"ECOOP'1A-32"NOZ'!		LOOK FOR A COLON!
!COLON2!%SC1A-32"EOCOLON2'QC+QS-7"GOZ'QC+QS-7"EOCOLON3
'1A-9"NOZ'D
!COLON3!R1A-32"EDOCOLON3
'C	!				CHG SPACES AFTER COLON TO TAB!
!OP!1A-90"GOZ'1A-65"LOZ'0UC
!OP2!%CC1A-90"GOZ'1A-64"GOOP2'1A-57"GOZ'1A-47"GOOP2'
1A-9"EC1A-32"EOZ'1A-9"EOZ'OOP3!	GIVE UP IF NO OPERANDS!'
1A-32"NOZ'QC-7"GOZ'C1A-32"EOZ'1A-9"EOZ'
-D	!		IF A SINGLE SPACE FOLLOWS OP, CHANGE TO A TAB!
!OP3!0UC
!EOL!%CC!		LOOK FOR EOL OR SEMICOLON!
!EOL2!1A-9"EOEOL'1A-13"G1A-59"NOEOL'0US
!SEMI!R1A-32"N1A-9"NOSEMI2''%SDOSEMI!	LINE UP COMMENTS!
!SEMI2!QS"NC	QC-QS-8"L	'''
!Z!L>
PZ"NOSTART'0UC!		LOOK FOR NEXT PAGE!
!GET!YZ"NOSTART'%C-10"NOGET'EF00EO!QUIT WHEN 10 YANKS FIND NOTHING!
[DONE...BAK FILE IS ORIGINAL COPY]