Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-06 - 43,50366/recsm5.doc
There are no other files named recsm5.doc in the archive.
J @J U L Q D '' @F '
' T L ; )@A

 	[SUBRUTINA PARA COMPILAR UNA EXPRESION REC]

( (R) ; I ((@N;;)) :  ' '  E D L L : L ')' E L L D  @R > ; L

  '(' E L D  L <  @E @G @C : A B D L  

	34% = @Q : 39% = @Q : '[' = L @[ :
	'A' = @P : 'B' = @P : 'C' = @P :
	'D' = @O : 'E' = @P : 'F' = @P : 
	'G' = @O : 'H' = @P : 'I' = @O : 
	'J' = @O : 'K' = @P : 'L' = @O :
	'M' = @P : 'N' = @P : 'O' = @O :
	'P' = @P : 'Q' = @O : 'R' = @P : 
	'S' = @O : 'T' = @O : 'U' = @P :
	'V' = @P : 'W' = @O : 'X' = @O :
	'Y' = @O : 'Z' = @O :
	'<' = L 'SWS'  @O :
	'@' = L 'SB' @I @B Q D ? 32 -  O L B B Q D @P :
	'=' = L 'EQ' @P :
	':' = L @D :
	';' = L @S :
	'+' = L 'SUMA'   @O :
	'-' = L 'RESTA'  @O :
	'*' = L 'MULT'   @O :
	'/' = L 'DIV'    @O :
	'\' = L 'MOD'    @O :
	'!' = L 'RTEXT1' @O :
	'#' = L 'C.NUM'  @O :
	'%' = L 'CNA'    @O :
	'&' = L 'SYSF'   @O :
	'>' = L 'RWS'    @O :
	'?' = L 'CAN'    @O :
 	'^' = L 'REPPDL' @O :
	'$' = L 'CONT
	EXP 0' @P : L : ; )@C
 
	[*** PROGRAMA PRINCIPAL ***]

( Z J D  'RTIME' & O 2S  D 'E0' @I 0S D  
('INPUT:' T L @A 'READ' & 'T' = L ; L L : )
('OUTPUT:' T L @A 'WRITE' & 'T' = L ; L L : )

ZJD '	TITLE ' @I I @K @K

'	SUBTTL ' @I @I @K @K

 '	EXTERNAL A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

	EXTERNAL EQ,LOADAC,CONT,C.NUM,SUMA,RESTA,MULT,MOD,RTEXT1

	EXTERNAL DIV,INPUSH,REPPDL,SYSF,SWS,RWS,QUOTE,CAN,CNA

	EXTERNAL LTEXT,CSBR.1,DP.1,TEXT0,TEXT3,TEX00,LOW2,PP

	EXTERNAL JOBFF

	REC=17
	ACOMP=4
	FLAG=10
	TEXT1=13
	TEXT2=14

	WKSIZE=3500' @I @K @K 

( Z @K @K J W D ( R '(' = L <  'START' @I @G ;

 '[' = L @[ : 34% = L @T @I  @0 D '>' @I  @K @K :

 39% = L @T @I  @1 D '>' @I @K @K  : L : ) @C

J ('JRST ^^'  @L : ;) J  ('JRST _@_' @F 'POPJ REC,' @I : ; )

'	AOS (REC)
	POPJ REC,
' Z @I Z ( R ' ' = L : '$' = L ; ) ;

('@' = L R ? 32 - 'SB' @I O B B Q D J ( 'START' @F I : ; ) J @J @K

 '	ENTRY ' @I @I @K @K ; ) J @M J : 'ERROR DEF.' T L ; )

J @M Z @K 'TEXTO:	BLOCK WKSIZE+1
TDCSR:	TDCSR
' @I 1 

(63$'	XWD 0,SB' @I O @K 1 + : ; )

@K '	END START' @I @K J 
'START:	' F L 'CLEAR FLAG,
	MOVE REC,INPUSH
	HRRZ ACOMP,JOBFF
	HRRZI ,TDCSR
	HRRM ,CSBR.1
	HRRM DP.1
	HRRZI ,TEXTO+WKSIZE
	MOVEM ,LTEXT
	SETZM ,@LTEXT
	MOVE TEXT1,TEX00
	HRRI TEXT1,TEXTO-1
	MOVEM TEXT1,TEXT0
	MOVEM TEXT1,TEXT2
	MOVEM TEXT1,TEXT3
	MOVE LOW2
	MOVEM PP
	PUSHJ REC,.+3
	TLN
	CALL [SIXBIT/EXIT/]
	' @I 'JRST START' J ( F '+23' @I : L ; )

ZJ W D 'CLOSE' & 'RTIME' & 2G # D -

O Z B B B @J '.' @I Z @K J Q 'RUNTIME: ' T L T L  : Y ; )$
[TRANSLATION OF PARENTHESIZED EXPRESSIONS INTO REC]
[25-SEP-75]

[@1 - SINGLE QUOTE BALANCER: FALSE OR POINTS AT CHARACTER NEXT FOLLOWING
THE CLOSING QUOTE]
(@'A (@'A; @"@2: A:); )@1

[@2 - DOUBLE QUOTE BALANCER: FALSE OR POINTS AT CHARACTER NEXT FOLLOWING
THE CLOSING QUOTE]
(@"A (@"A; @'@1: A:); )@2

[@B - PARENTHESIS BALANCER: FALSE OR POINTS AT CHARACTER NEXT FOLLOWING
THE CLOSING PARENTHESIS]
(@(A (@)A; @(@B: @'@1: @"@2: A:); )@B

"@L - WRITE CR,LF"
("
"TL;)@L

[@N - MOVES UP TO THE END OF AN INTEGER]
(@#A:""FL;)@N

[@P - PARSE AN EXPRESSION]
("END"(=) IL"  "L[2^TL] <(@(@T (@P:;);;)>; )@P

[@T - PARSE TOP LEVEL OF AN EXPRESSION]
(@(JD @U "%" (@U:;); )@T

[@U - DETATCH A SINGLE UNIT FROM AN EXPRESSION]
(@)D;" "EDL;L (@$@W" "; @#@N" "; @(@B; @"@2; @'@1;)JQD;)@U

[@W - MOVES UP TO THE END OF A WORD]
(@$A:""FL;)@W

[@' - SINGLE QUOTE RECOGNIZER]
(39%EL;L)@'

[@" - DOUBLE QUOTE RECOGNIZER]
(34%EL;L)@"

[@# - SINGLE DIGIT RECOGNIZER]
("0"ML":"(M)L;L)@#

[@$ - SINGLE LETTER RECOGNIZER]
("A"ML"["(M)L;L)@$

[@( - LEFT PARENTHESIS RECOGNIZER]
("("EL;L)@(

[@) - RIGHT PARENTHESIS RECOGNIZER]
(")"EL;L)@)

"@* - WIPE THE SCREEN CLEAN"
(29%TL(2000$:;)31%TL;)@*

("END" "(CONS    'NIGHTIME' (CONS   (CONS (LIST 88 10 X) (CADR Y)) (LIST U 3))))"T@L
 @P Y ;)$
"@0 - QUOTE THE SUBSTITUTION TABLE"
("(A,ADVANCE)(B,BACKUP)(C,CLOSE FILE)(D,DELETE)(E,EQUAL)(F,FIND)
 (G,GET)(H,ZERO)(I,INSERT)(J,EXCERPT)(K,KILL)(L,LIFT)(M,GREATER)
 (N,NEGATIVE)(O,OCTAL)(P,PAGE)(Q, )(R,READ)(S,STORE)(T,TYPE)
 (U,LOCALIZE)(V,OUTPUT)(W,WRITE FILE)(X,READ TELETYPE)
 (Y,PRINT WORKSPACE)(Z,FAST RETURN)"TIL;)@0

"@1 - GENERATE TITLE 'SUBSTITUTION TABLE'"
("
SUBSTITUTION TABLE:
"TL;)@1

"@2 - GENERATE TITLE 'COMPILED TABLE'"
("
COMPILED TABLE:
"TL;)@2

"@3 - GENERATE TITLE 'TEST PHRASE'"
("
TEST PHRASE:
"TL;)@3

"@4 - GENERATE TITLE 'TRANSFORMED EXPRESSION'"
("
TRANSFORMED EXPRESSION:
"TL;)@4

"@L - GENERATE CR, LF"
("
";)@L

"@Q - GENERATE A QUOTE MARK"
(34%;)@Q

"@I - INSERT ONE PAIR"
("("FDL@QIL ","FDL@QIL" ELD "IL@QIL ")"FDL@QIL" @LILIL''UL:L"IL;)@I

"@J - INSERT SEQUENCE OF PAIRS"
(J""FL"<("IL@LIL(@I:;)(A:;)@LIL"A:;)$>"IL;)@J

(@1 @0 @J @2 YJ""FL "<"FL ">"UL Q J""FLZ!D
@3"NOW IS THE TIME FOR THE QUICK BROWN FOX"TIL"PDL"C@4YL;)$



	REFERENCIAS
	==========

	1)   HAROLD V.MCINTOSH

	A CONVERT COMPILER OF "REC" FOR THE PDP-8
	ACTA MEXICANA DE CIENCIA Y TECNOLOGIA
	VOL. II.# 1,PAGS. 33-43 ,ENERO-ABRIL 1968.

	2)   GERARDO CISNEROS S.

	A FORTRAN CODED REGULAR EXPRESION COMPILER
	FOR THE IBM 1130 COMPUTING SYSTEM.
	ACTA MEXICANA DE CIENCIA Y TECNOLOGIA
	VOL. IV ,#,PAG.30-86,ENERO-ABRIL 1970.

	3)   A.A. MARKOV

	THEORY OF ALGORITHMS
	MATHEMATICAL INSTITUTE IMENI V.A. STEKELOV.
	TRADUCIDO AL INGLES DE LA EDICION RUSA 1955 POR:
	OFFICE OF TECHNICAL SERVICES,U.S.DEPARMENT OF
	COMMERCE,WASHINTON,D.C. 1962.
	DISTRIBUIDO POR:CLEARING HOUSE (TT60-51085).

	4)   VARAS ARAUJO J.L.

	UN COMPILADOR DE "REC" PARA LA CDC 6400
	TESIS PROFESIONAL I.P.N. 1971.

	5) R.C.GARCIA-JURADO.

	UN "REC" VISUAL PARA LA PDP-15 EN COMUNICACION
	CON LA PDP-10.
	TESIS PROFESIONAL I.P.N. 1971.

	6) DIGITAL EQUIPMENT CORPORATION

	PDP-10 REFERENCE HANDBOOK.
IIIAAAA>>AAA>						AA@@@@IIIAAAA>``'EEI1
*U*$?!?