Annotation of OpenXM/src/k097/lib/printSVector.modified.sm1, Revision 1.1
1.1 ! maekawa 1: %%% supporting code for printSVector.
! 2: /greaterThanOrEqual {
! 3: /arg2 set /arg1 set
! 4: arg1 arg2 gt { 1 }
! 5: { arg1 arg2 eq {1} {0} ifelse} ifelse
! 6: } def
! 7:
! 8: /lengthUniv {
! 9: length (universalNumber) dc
! 10: } def
! 11:
! 12: /getUniv {
! 13: (integer) dc get
! 14: } def %% Do not forget to thow away /.
! 15:
! 16: [(printSVector)
! 17: [( vector printSVector outputs the <<vector>> in a pretty way.)
! 18: ( The elements of the vector must be strings.)
! 19: ]
! 20: ] putUsages
! 21:
! 22: %%% compiled code by d0, 1996, 8/17.
! 23: /printSVector {
! 24: /arg1 set
! 25: [ %%start of local variables
! 26: /keys /i /j /n /max /width /m /k /kk /tmp0 ] pushVariables [ %%local variables
! 27: /keys arg1 def
! 28: /n
! 29: keys lengthUniv
! 30: def
! 31: /max (0).. def
! 32: /i (0).. def
! 33: %%for init.
! 34: %%for
! 35: { i n lt
! 36: { } {exit} ifelse
! 37: [ {%%increment
! 38: /i i (1).. add def
! 39: } %%end of increment{A}
! 40: {%%start of B part{B}
! 41: keys i getUniv lengthUniv
! 42: max gt
! 43: %% if-condition
! 44: { %%ifbody
! 45: /max
! 46: keys i getUniv lengthUniv
! 47: def
! 48: }%%end if if body
! 49: { %%if- else part
! 50: } ifelse
! 51: } %% end of B part. {B}
! 52: 2 1 roll] {exec} map
! 53: } loop %%end of for
! 54: /max max (3).. add
! 55: def
! 56: /width (80).. def
! 57: /m (0).. def
! 58:
! 59: %%while
! 60: { m max mul
! 61: (80).. lt
! 62: { } {exit} ifelse
! 63: /m m (1).. add
! 64: def
! 65: } loop
! 66: /k (0).. def
! 67: /kk (0).. def
! 68: /i (0).. def
! 69: %%for init.
! 70: %%for
! 71: { i n lt
! 72: { } {exit} ifelse
! 73: [ {%%increment
! 74: /i i (1).. add def
! 75: } %%end of increment{A}
! 76: {%%start of B part{B}
! 77: keys i getUniv messagen
! 78: /kk kk (1).. add
! 79: def
! 80: /k k
! 81: keys i getUniv lengthUniv
! 82: add
! 83: def
! 84: /tmp0 max
! 85: keys i getUniv lengthUniv
! 86: sub
! 87: def
! 88: /j (0).. def
! 89: %%for init.
! 90: %%for
! 91: { j tmp0 lt
! 92: { } {exit} ifelse
! 93: [ {%%increment
! 94: /j j (1).. add def
! 95: } %%end of increment{A}
! 96: {%%start of B part{B}
! 97: /k k (1).. add
! 98: def
! 99: kk m lt
! 100: %% if-condition
! 101: { %%ifbody
! 102: ( ) messagen
! 103: }%%end if if body
! 104: { %%if- else part
! 105: } ifelse
! 106: } %% end of B part. {B}
! 107: 2 1 roll] {exec} map
! 108: } loop %%end of for
! 109: kk m greaterThanOrEqual
! 110: %% if-condition
! 111: { %%ifbody
! 112: /kk (0).. def
! 113: /k (0).. def
! 114: newline
! 115: }%%end if if body
! 116: { %%if- else part
! 117: } ifelse
! 118: } %% end of B part. {B}
! 119: 2 1 roll] {exec} map
! 120: } loop %%end of for
! 121: newline
! 122: /ExitPoint ]pop popVariables %%pop the local variables
! 123: } def
! 124: %%end of function
! 125:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>