Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Mathematical aspects of a graphical programming language and its implementation Chan, Bon-boon 1976

You don't seem to have a PDF reader installed, try download the pdf

Item Metadata

Download

Media
UBC_1976_A7 C49.pdf [ 3.65MB ]
Metadata
JSON: 1.0065568.json
JSON-LD: 1.0065568+ld.json
RDF/XML (Pretty): 1.0065568.xml
RDF/JSON: 1.0065568+rdf.json
Turtle: 1.0065568+rdf-turtle.txt
N-Triples: 1.0065568+rdf-ntriples.txt
Original Record: 1.0065568 +original-record.json
Full Text
1.0065568.txt
Citation
1.0065568.ris

Full Text

MATHEMATICAL GRAPHICAL PROGRAMMING  ASPECTS  LANGUAGE  OF A  AND I T S IMPLEMENTATION  by  Bon-boon B.Sc,  University  Chan  of California,  B e r k e l e y , 1973  A T H E S I S SUBMITTED I N P A R T I A L FULFILMENT THE REQUIREMENT MASTER  FOR THE DEGREE OF  OF A P P L I E D  in  SCIENCE  t h e Department of  Electrical  We a c c e p t the  this  required  thesis  as conforming t o  standard  THE UNIVERSITY  OF B R I T I S H  July,  0  Engineering  COLUMBIA  1976  BON-BOON CHAN, 1976  OF  In p r e s e n t i n g  this  thesis  an advanced degree at the I  Library shall  f u r t h e r agree  for  scholarly  by h i s of  this  written  make i t  freely available  that permission  for  the requirements  Columbia,  I agree  r e f e r e n c e and  f o r e x t e n s i v e copying o f  this  It  for financial  is understood gain s h a l l  permission.  University of B r i t i s h  2075 W e s b r o o k P l a c e V a n c o u v e r , Canada V6T 1W5  Columbia 1  that copying or  not  for  that  study. thesis  purposes may be granted by the Head of my Department  Depa rtment The  fulfilment of  the U n i v e r s i t y of B r i t i s h  representatives. thesis  in p a r t i a l  or  publication  be allowed without my  ABSTRACT  This t h e s i s describes  t h e improvements i n t h e m a t h e m a t i c a l  a s p e c t s o f t h e h i g h - l e v e l programming language f o r i n t e r a c t i v e g r a p h i c s (LIG). areas:  Improvement p o s s i b i l i t i e s were i n v e s t i g a t e d i n t h r e e dependence on t h e o r d e r o f t r a n s f o r m a t i o n s ,  r e s s i o n s a p p e a r i n g i n LIG s t a t e m e n t s ,  and t h e i m p l e m e n t a t i o n t o a l l o w  t h e programming o f g r a p h i c a l f u n c t i o n s . of the proposed improvements i s a l s o  i  a r i t h m e t i c exp-  The method o f i m p l e m e n t a t i o n  discussed.  TABLE  OF  CONTENTS PAGE  ABSTRACT  i  TABLE OF CONTENTS  i i  LIST OF FI GERES. . .  i i i  ACKNOWLEDGEMENT I.  iv  INTRODUCTION  1  1.1  Host Language Concept  1  1.2  Purpose of Research.  3  I I . ORDER OF GRAPHICAL TRANSFORMATIONS  5  2.1  The Requirement f o r Transformations  5  2.2  The Formulation of Transformations  5  2.3  The Transformation Equations and Matrices  8  2.4  Transformations i n LIG  10  2.5  Non-commutativity  12  2.6  To Derive the A and B Matrices  property  18  I I I . SYNTACTIC IMPROVEMENT FOR LIG STATEMENTS  22  3.1  Description of Syntax  22  3.2  The Backus Normal Form  22  3.3  Graphical Variable and Modification Attributes  27  3.4  Attribute Assignment and Numerical Assignment  29  3.5  LIG Preprocessor and Improvement Result  30  IV. PICTURE GENERATION BY GRAPHICAL FUNCTIONS  35  4.1  Picture Generation i n LIG  35  4.2  The LIG Data Base  38  4.3  Graphical Function  40  4.4  Implementation  42  4.5  Generation of Special Plane Curves by a Graphical  Scheme  Function : Examples 4.6 V.  43  Graphical Assignment Statement with a Graphical Function 46  CONCLUSION  50  REFERENCES  , •  54  APPENDIX A  57  APPENDIX B  62  APPENDIX C  76 ii  LIST  OF  FIGURES PAGE  F i g . 1.1  2  O b j e c t Code G e n e r a t i o n  F i g . 2 . 1 S i g n i f i c a n c e i n t h e Sequence o f T r a n s f o r m a t i o n s . . . .  7  F i g . 2.2 T r a n s f o r m a t i o n Order  21  F i g . 3.1 S y n t a c t i c Chart  2  F i g . 4.1 Primitives;,..-.  35  F i g . 4 . 2 2 Input-And-Gate  .  4  37  F i g . 4.3 A Track  37  F i g . 4 . 4 LIG D a t a Base S t r u c t u r e  39  F i g . 4-5 H y p o c y c l o i d w i t h Four Cusps  48  F i g . 4 . 6 Tree l e a v e d r o s e  48  F i g . 4 . 7 Four l e a v e d r o s e  49  F i g . 4.8 Function Generation  49  iii  ACKNOWLEDGEMENT The  author  G.F.Schrack throughout  to  thank  f o r h i s interest, the period of t h i s  Financial National  wishes  support  fiesearch  advice  supervisor. and  Dr.  encouragement  research.  forthis  Council  his  of  0148.  iv  research Canada  was p r o v i d e d fay t h e under  grant  number A-  1 I.  INTRODUCTION  H o s t Language  Graphics  languages  production  of diagrams  and  [25]-  GROAN  intended  usual  numerical,  as  picturesa  developed Examples  graphics  activities  and  etc.).  addition  to  For t h i s  is pure  requires  string  r e a s o n , LIG  procedural language  £6]  which  c a n n o t be a  design  character  the  a r e B-LINE  the  handling  of a problem-oriented h i g h - l e v e l language  t o a c c e p t an e x i s t i n g  (e.g.  was  designed  as a h o s t  language,  t h e g r a p h i c s s t a t e m e n t s proper- Examples  l a n g u a g e e x t e n s i o n s a r e LIG [ 1 7 ] , GPL/1 XPLG  for  language  computer-aided  Boolean,  FORTRAN, ALGOL, APL  in  been  computer-aided  language,  capabilities  and  However,  to a s s i s t  graphics  have  Concept  [ 2 2 ] , TUIA  [2],  of and  123).  Fortran language Fortran involved  LIG.  Thus,  an  and L I G s t a t e m e n t s .  f o r the h i g h - l e v e l  application Fig.  1.1  program shows  i n the g e n e r a t i o n of the o b j e c t  The Fortran  i s the host language  graphics  contains the  procedure  code-  LIG p r e p r o c e s s o r t r a n s l a t e s a l l LIG s t a t e m e n t s call  statements  statements,  directly  but  passes  to the output f i l e .  t h e LIG p r e p r o c e s s o r i s d i s c u s s e d  both  the The  i n Section  pure  into  Fortran  c o n s t r u c t i o n of 3.5  £12] [ 8 j .  2  Object Code  Fig.1.1  Object Code Generation  3 ls.2 Purpose of The and  mathematical aspects  graphics  listed  system  are  (a)  the  d e p e n d e n c e on  (b)  LIG  statement syntax  the  previous  always e v a l u a t e d  guestion  are  operators arranged  In contain  were  areas  language  of s t u d y  are  with  version  variable  The  preprocessor  were c h a n g e d .  has  grammatical  graphical  object  to  the  arithmetic  identifier-  of  The and  transformation  transformations rotation.  is  The  transformations  seguences. D i f f e r e n t  the  a  order.  these  from  of  transformation  order  scaling  investigated  previous  of  improvement  in a fixed  were g e n e r a t e d  subscript  order  system, the  different  imbedded  graphical  the  translation,  into  pictures  it  graphics  of g r a p h i c a l f u n c t i o n s  LIG  associated  seguences  LINE,  LIG  as f o l l o w s :  In  A  of t h e  i n v e s t i g a t e d - The  (c) i m p l e m e n t a t i o n  was  .Research  determine  is difficult  be  transformation i f  identical  same g r a p h i c a l o b j e c t .  of LIG,  statements could  expressions. to  be  example,  a  a single  number o r  an  as  well  built  up  from a f i x e d  curves  not  For  rules  SQUARE , CIJ8CLE and to generate  three  can  as  the  p r i m i t i v e s . These g r a p h i c a l p r i m i t i v e s a r e ;  TRIANGLE,  in  LIG  set  BLANK,  SCIRCLE- From t h i s  described  by  an  of  set,  algebraic  4 equationsomewhat In  Thus, the v a r i e t y o f g r a p h i c a l  objects  generated i s  limited. order  to  graphical  function  function  which  graphical  object-  permit  algebraic  was i n t r o d u c e d ,  returns  a  curves,  k graphical  the n o t i o n function  value of type g r a p h i c a l ,  of a is  i.e.  a a  I I . ORDER OF GRAPHICAL TRANSFOBMATIOHS  2. 1 A  graphics  programmer  to  system define  should  allow  the  application  p i c t u r e s , to d i s p l a y these p r e d e f i n e d  p i c t u r e s on the s c r e e n , and t o manipulate  these p i c t u r e s . The  b a s i c type of manipulation should i n c l u d e the c a p a b i l i t y position  a p i c t u r e a t any d e s i r e d l o c a t i o n o f t h e s c r e e n , t o  change the dimension to  of a p i c t u r e i n X- or  ^-direction,  and  r o t a t e a p i c t u r e by a s p e c i f i e d angle i n the c l o c k w i s e o r  anti-clockwise  direction.  In  types of p i c t u r e manipulation and  to  rotation.  They  graphics  are c a l l e d  are c o l l e c t i v e l y  terminology, translation, known  as  these scaling  graphical  transformations.  2 - 2 The Formulation of T r a n s f o r m a t i o n s E s s e n t i a l l y , t h e r e a r e two a s p e c t s i n the f o r m u l a t i o n o f graphical transformations £ 1 5 ] : (a)  A  transformation  mathematical  which  is  a  single  e n t i t y , and which can be denoted by  a s i n g l e name or a symbol; (b) Two or combined,  more or  transformations  concatenated,  to  which yield  t r a n s f o r m a t i o n which has the same e f f e c t  can be a single as the  6  sequential  application  of  the  original  transformations. In  the h i g h - l e v e l i n t e r a c t i v e  translation  i s  and  by ANGLE- T h i s c o n f o r m s  rotation  formulation.  Moreover,  concatenated, ( 16 ][ 17 ][20 ] transformation evaluation resulting following  denoted  graphics  is  the  by t h e keyword AT, s c a l i n g  when  result  these  is  in  scaling,  a  LIG  are  (LIG),  by SCALE,  the f i r s t  aspect of  transformations  evaluated  rotation  transformations LIG  with  Independent of the order entity  language  in  a fixed  are order-  of appearance of the  statement,  the  order  and t r a n s l a t i o n .  identical  for  of  Thus t h e  a l l of  the .  statements:  AT X,Y SCALE SX,SY ANGLE A AT X,Y ANGLE A SCALE SX,SY SCALE SX,SY AT X,Y ANGLE A SCALE SX,SY ANGLE A AT X,Y ANGLE A SCALE SX,SY AT X,Y ANGLE As  the  dependent, t h e previous aspect  A AT X,Y SCALE SX,SY  resulting formulation  LIG g r a p h i c s  e x a m p l e , one w i l l graphical  of  t h e seguence  of  system  of the formulation  of  transformations the  are  transformation  does n o t c o n f o r m  with  of transformations.  i s important.  of t r a n s f o r m a t i o n s  applied  order  in  the  t h e second  Using  n o t i c e t h a t the order i n the  transformations  not  a  simple  concatenation  The s i g n i f i c a n c e to  a  graphical  7 object  i s shown i n Fig»  Seguence _1 i s c a l i n g +  original  picture  Sequence 2 i r o t a t i o n  2-1.  rotation)_  after  scaling  + scalingj_  rotation  the  sequence  after  rotation  8 Hence, by  implementing  formulation  2^3 First, point The set  the p r e v i o u s into  LIG  g r a p h i c s s y s t e a can  the system  of  transformations-  The  Transformation  consider  the  Equations  of  can  points  Algebraically, a.  then  the  defines  equations  in  a  co-ordinate  a  the  Matrices -  applied to  be a p p l i e d t o t h e  which  the  of  improved  aspect  and  the t r a n s f o r m a t i o n s  with r e s p e c t t o the o r i g i n equations  second  be  single system-  c o - o r d i n a t e s of graphical  the  object-  are [ 5 ] ;  Translation  of a p o i n t  (X1,Y1) t o  (X2,Y2)  by  (Xt,Yt)  b.  X2  = X1  +  Y2  = Y1  + Yt  Rotation of a point  the  origin  clockwise  c.  through  an  angle  = X1  c o s © - Y1  sine  Y2  = X1  s i n e + Y1  cose  B  respect in  the  to  anti-  axes  with  value  factors  Sx,Sy  origin  X2  •= X1  Sx  Y2  = Y1  Sy  the  with  #  direction  S c a l i n g the  using  (X1 Y1)  X2  about the  When  Xt  above  algebraic  eguations  for  the  9  concatenation  of  transformations,  a l g e b r a i c equations these  will  the  be d i f f i c u l t t o manipulate.  t r a n s f o r m a t i o n s can be represented  a 3x3 matrix [ 1 ].  resulting  set  of  Morever,  i n a uniform  way by  T h i s i s c a l l e d the homogeneous c o o r d i n a t e  representation. The  homogeneous  transformations  of  coordinate a  point  representation  about  of  the  the o r i g i n are given as  follows: a. T r a n s l a t i o n r  [X2  I1 I  12 1] = [X1 Y1 1]|0  I  i  0 1  OJ 1 0j  I  j Xt Yt 1 J  L  J  b. R o t a t i o n  i  r  | cose [X2  s i n e 0|  I  i  Y2 1 ] = [X1 Y1 1 ] j - s i n e cose Oj  I  |0  I  0  11  c. S c a l i n g r  |Sx 0  [X2 Y2 1] = [X1 11 1]|0  i  jO  L  Then, f o r any scaling, follows:  the  seguence  1  01  Sy Oj 0  i  1J  of  J  translation,  rotation  and  r e s u l t i n g t r a n s f o r m a t i o n can be r e p r e s e n t e d as  10  r [X2  1 ] = £X1 Y1  ¥2  Due t o coordinate  T 0| 01  |a d j fa e lc f  13  i t s uniform  11  characteristics,  representation  of  the  the  homogeneous  transformation  is  more  convenient.  2.2.4 T r a n s f o r m a t i o n s i n LIG In basic  the LIG g r a p h i c s graphical  primitives graphical graphical defined  available objects  a r e t o be b u i l t The  LIG  a u n i t square,  point  object  variety  i n Section from  this  graphical  lower  left-hand  of the screen.  primitive  a n g l e 9, t h e f o l l o w i n g  is  is  i s at  transformed  three  set  of  of the  unit  t o be l o c a t e d  at a  o f t h e u n i t s q u a r e . The  system  graphical  oasic  as the dimension  i s considered  point  4.1. a l l o t h e r  Each  of the co-ordinate  the reference  graphical  which i s 750 x 750 p o i n t s .  origin  primitive,  of  are the  are  which i s t h e center  corner  primitives  primitives  p r i m i t i v e i s as l a r g e  s q u a r e . The g r a p h i c a l reference  [ 2 0 ] . The  i s discussed  primitives.  within  graphical  objects  system, g r a p h i c a l  defined  to  be  Thus f o r a  in  the  graphical  ( 0 . 5 , 0 . 5 ) , Hence,  i f  a  by r o t a t i o n t h r o u g h an  s t e p s need t o be  performed:  11 (a) T r a n s l a t e from r e f e r e n c e  point  (0.5,0.5)  to  the o r i g i n (0,0) (b) Rotate about the o r i g i n  Osing  (c) T r a n s l a t e  from  reference  (0.5,0.5).  matrix  representation  point  notation,  the  the  origin  homogeneous  back  to  the  co-ordinate  i s as f o l l o w s :  (a) T r a n s l a t e t o the o r i g i n  [X2  (b)  r  -i  L  J  |1 0 Oj ! I ¥2 1] = £ XI ¥1 1J|0 1 0| 1 J 1-0.5 -0.5 1j  fiotate  about the o r i g i n by angle & i n a n t i - c l o c k w i s e  direction r  |cose [X3  1  T  s i n e 0| 1  Y 3 1 ] = £X2 ¥2 IJJ-sine- cos8 0J I J JO 0 1J  12 (c) T r a n s l a t e b a c k t o t h e r e f e r e n c e p o i n t  | 1  0  T 0|  1 ]|0  1  0|  0.5  1|  r  I  [Xl* Y4  1 ] = [X3 Y3  I  |Q-5  I  I  J  L  Hence, we  have [X4  1]  Y4  = £X1  1][M]  Y1  where r  i  jr  1  u 0|  1  r  i r  |1  1  [M]=|s v OJ = |0  i l l  |t  w 1|  L  The to every t o be  J  resulting  0J|cose  1  0||-sine  s i n e Oj|1 Ji c o s e OJ 10  -0.5  1||0  0  II  ii  J  L  p a i r of the  -j  II  0  0|  1  0|  I  1||0.5 0.5  L  J L  transformation matrix  co-ordinate  [Mj can  1  1| J  be  graphical primitive  applied which i s  rotated.  2-J5  I n the  process  formulation of r o t a t i o n to  1-0.5  T r  0  unify  property  of implementing the  second aspect  o f t r a n s f o r m a t i o n s , t h e non-commutative and the  concatenation •sing  Non-commutativity  scaling  has  t o be  method  of  implementation.  of t r a n s f o r m a t i o n s  the  procedure  taken  into  must be  discussed  in  in  the  property  account,  so  as  A l l cases  in  the  examinedSection  2-4,  the  13 different  cases  following  are  formulated  in  matrix  form,  using the  pair  before  notation:  (X1,Y1)  i s  the  co-ordinate  transformation (X2,Y2)  i s  the  co-ordinate  pair  after  transformation (Xr,Yr) point  i s the coordinate  before  (Xt,Yt) point  i s  after  pair of  the coordinate  direction, rotation  r  n i  o  pair  of the reference  transformation value  8 i s the angle of r o t a t i o n for  reference  transformation  (Sx,Sy) i s t h e s c a l e  value  the  rotation or  i t has  i n the clockwise  in a  It  has  the  a  anti-clockwise  negative  value  direction.  i  oi i  [T0J=|0 1 0} , t r a n s l a t i o n f r o m I I reference point l - X r - Y r 1|  positive  the o r i g i n a l  for  14 r  1 0| I I £ T 1 J = 10 1 oj , t r a n s l a t i o n back to the o r i g i n a l r e f e r e n c e point I i iXr Yr 11 |0  J  r  |0  i 1  T  1  01 1  1 01 1 1 1 1 Yt I xt 11  [12]=  10  1  |cose I [R]=|-sine  sine 0 | 1  cose 0 ) , r o t a t i o n matrix  1  1  10  0  11  L  J  r i |Sx 0 0| 1 I £S}=10 Sy 01 , s c a l i n g matrix 1 1 10 0 11  i.  A list i s given a-  J  of a l l p o s s i b l e c o n c a t e n a t i o n s of  as f o l l o w s :  Translation £ X 2  Y2  1]  b. T r a n s l a t i o n £ X 2  Y2  =  £ X 1  Y1  1 ] £ T 0 ] £ T 2 ]  + rotation  1 ] = £ X 1  Y1  1 ][ TO  ]£ E ][ T 2  ]  transformations  15 c.  Translation  Translation  e. T r a n s l a t i o n  = £X1 Y1 + scaling  1] = £X1 Y1  Rotation  +  Rotation  Y1  Rotation  Rotation  + scaling  £X1 ¥1  1 ]£ TO ]£ B ]£ S ]£ T2 J translation 13£T0]£B3£S]£T2]  1j = £X1 Y1 1 ]£T0 j£S 3£T1 j  Scaling  +  Scaling £ X 2 Y2 Scaling [X2 Y2  rotation 13 = £X1  £ X 2 Y2  n»  +  + scaling  Scaling £ X 2 12  m.  1 ]£ TO ][ R ]£ T2 ]  + translation  £ X 2 ¥2 1 J ' =  1»  1 ]£ TO ]£fiJ£ T 1 ]  1] = £X1 Y1 1 ]£ TO ]£ R ]£ S ]£ T1 ]  £X2 Y2 1J - £X1 Y2  k.  rotation  + scaling  £X2 Y2  j.  +  translation  £ X 2 Y2 1] = £X1  i.  1]£T0]£B]£SJ£T2 j  Rotation £X2 Y2  h-  + scaling  1] = £X1 Y1 1 ]£ TO ]£ S ]£ E ]£ T2 ]  £ X 2 Y2  g-  1 3£T0 3£S ]£T2]  •+ r o t a t i o n  1]  £X2 12  f.  scaling  1] = £X1 Y1  £ X 2 12 d.  +  +  Y1  1]£T0]£S]£R3£T13  translation 13 = £X1 Y1  + rotation  +  1] = [X1 ¥1  1 3£ TO 3£ S J£T2 3 translation 13£TO]£S3£R3£T2 3  o-  Scaling [X2  These T h e s e two Case  Y2  1] = [X1  fifteen  cases  1  £ X 2 Y2 2  £ X2  Y2  1 ] [ T 0 ] £ S JJ;R j [ T 2 J  can as  be g e n e r a l i z e d  by two  cases.  follows; Y1  1 ] £ T ] [fi][ S ][ T ] 1 ][ T ][ S ][ R  l'J !'  1 represents cases f o r + rotation  h. R o t a t i o n  + scaling  i.  Rotation  + translation  j.  Rotation  + scaling  + scaling  +  scaling  + translation  2 represents cases f o r  1.  either  rotation  1 ] = [ X1 Y1  e. T r a n s l a t i o n  As  +  1] = [X1  d. T r a n s l a t i o n  Case  Y1  cases are l i s t e d  Case Case  + translation  Scaling  +  + scaling  + rotation  o. S c a l i n g  + translation  Case  represented  the r e m a i n i n g 1  or either  m a t r i x £SJ w i l l  be  rotation  rotation  h. S c a l i n g  for  +  Case by  +  translation +  rotation  cases, they  2. Case  For  c a n be r e p r e s e n t e d  example,  1 o r Case  rotation  2 a s S i = Sy =  can  by be  1 . The  17 |1 0 0|  ) [S]=|0  I 1 01  i I |0 0 1J  t.  Therefore a. R o t a t i o n b. S c a l i n g Setting into  J  the only  two  c a s e s t o be f u r t h e r d i s c u s s e d  The  are  + scaling + translation + rotation + translation  Xr = Yr = 0-5,.  and p u t t i n g  Case  1  and  Case  2  1,  1 X2 = Sx c o s e  (X1 - 0.5)  - Sx s i n e  (11 -  Y2 = Sy s i n e  (X1 - 0.5)  + Sy c o s e  (Y1 - 0.5)  X2 = Sx c o s e  (X1 - 0.5)  - Sy s i n e  {11  0.5)  + Xt  Y2 = Sx s i n e  (X1 - 0.5)  + Sy c o s 8  (Y1 - 0-5)  + Yt  Case Set  of  matrix)  t h e form o f a l g e b r a i c e q u a t i o n s , from C a s e Set  from  ( i . e . the u n i t  0-5)  + Xt +  Yt  2,  2  implemention  transformations  eguations-  of the second is  based  on  aspect the  -  o f the  above  two  formulation sets  of  18 2-6 To D e r i v e t h e A and B M a t r i c e s In which  the p r e v i o u s v e r s i o n  of IIG,  was used i s S e t 2- R e p r e s e n t e d  the  set  i n matrix  of  equations  form,  P2 = A»P1 + B r  T  r  i  |X2J where P2=J | |Y2| L. J  i xi i  PI=I  i  m i  r  i  |Sx c o s e  -Sy s i n e |  A= i  j  |Sx s i n e  Sy c o s e |  i  r  and  ixt  + 0 . 5 (Sy s i n e - s x c o s e )  |Yt L  - 0 . 5 (Sx s i n e  + Sy c o s e ) J J  The  v a l u e s A and B a r e s t o r e d  e.  One  modification  modification (A1,B1) a s  instead  ( A1  follows  • P1 +  Bl )  + B2  = A2 • A1 * P1 + A2 * B1 + B2 = C • P1 + D where  o f X t , Y t , Sx, S y ,  (A2,B2) c a n be a p p l i e d t o a n o t h e r  P3 = A2 • P2 + B2 = A2 •  j  19 C = A2  * A1  D = A2  * B1  +  B2'  r T I X31  P3 =  | ) , the point a f t e r transforming | Y3|  In order to keep t h i s f e a t u r e Set  2 i n t o the LIG  graphics  d i f f e r e n c e s between Set  Set 2 was  For s c a l i n g , r o t a t i o n and from Set  common  1 and and  investigated. are,  . _ r  i  lSx cose JSx s i n e L  -Sy  sinei | Sy cose | J  -j  r  \Tx  - 0.5  (-Sy  s i n e + Sx  cos9) j  B1=1  I  |Ty - 0.5 L  (Sx s i n e + Sy cose)  For r o t a t i o n , s c a l i n g and  |  J  t r a n s l a t i o n , the m a t r i c e s  from Set 1  iSx A 2= | |Sy  cose  -Sx  sine  Sy cose  L  |.Xt - 0-5 |Yt - 0.5 L  sine |  |  | J  T  B2=|  aspects  t r a n s l a t i o n , the m a t r i c e s  2 A1=|  twice  and t o implement. Set  system, the  1 and  P1  1  (-Sx  s i n e + Sx cose) j 1 (Sy s i n e + Sy cose-) 1 J  are,  20 An that are  examination  they  of  a r e t h e same e x c e p t  (A1,A2) and  (B1,B2) shows  i n two p l a c e s where Sx  and  Sy  interchangedIn the LIG g r a p h i c s  the  the p a i r s  matrices  A  transformation reguested order  and  system, t h e s u b r o u t i n e  B  is  named  TRAMA.  orders, a modification i s  matrices  are generated  of transformation-  The  To  satisfy  made  according  modified  which s e t s up  so  that  both the  to the s p e c i f i e d  TRAMA  i s  listed  in  A p p e n d i x CA parameter o f t h e sub-program supply  the  rotationcan  only  order  of  This order be  preprocessor  by  therefore  shows t h e r e s u l t s  ( v i z - I l f i A N S ) must  transformations  o f AT, SCALE, ANGLE  detected is  the  TRAMA  the  LIG  modified  of  in a  LIG  preprocessoraccordingly.  of t h e f o l l o w i n g LIG  SCALE 0-3,0.5 ANGLE  • DISPLAY TfilANGLE  ANGLE  demonstrating rotation-  the  effects  For comparison  a l s o shown i n T i g -  2-2-  statement The L I G Fig.  2.2  statements,  •DISPLAY TRIANGLE AT 0-5,0.5 AT 0-5,0.5  s c a l i n g and  1.57079  RAD;  1.57079 RAD SCALE 0.3,0.5;  o f an i n t e r c h a n g e  purposes, t h e o r i g i n a l  of scaling  and  triangle  i s  Fig.2.2  Transformation order  22 III.  SYNTACTIC IMPROVEMENT FOR  3.J Before  a  language  semantic s t r u c t u r e are  several  Description is  LIG STATEMENTS  of Syntax  generated,  the  o f t h e l a n g u a g e must be  ways  to  describe  syntactic  specified.  and There  the s y n t a c t i c s t r u c t u r e  of a  l a n g u a g e . F o r example, t h e r e a r e : (a)  The Backus Normal Form  (h)  Syntactic  (c)  C o m p i l e r D i r e c t i n g S t a t e m e n t and S e n t e n c e  Chart  [8]  £9]  The C o m p i l e r D i r e c t i n g S t a t e m e n t method  used  Oriented Normal  to describe  and  Sentence  t h e l a n g u a g e COBOL  (Common  Language). For comparison purpose, only  Form  and t h e S y n t a c t i c  The  Backus  definition metasymbols  of  the are  Form  syntax  is  of  employed-  the  Business  the  Backus  t h e l a n g u a g e ALGOL [ 9 ] £ 1 8 ] .  The B a c k u s N o r m a l  Normal  is  C h a r t a r e p r e s e n t e d , as both o f  them h a v e been u s e d t o d e s c r i b e  3-2  [19]  a  Form metalanguage  programming Their  for  languages-  definitions  the Four  are  the  construct.  A  following: Symbol < >  Definition Angular  brackets  construct  is  enclosing  developed  a  from t h e d e f i n i t i o n s o f  23  the  language- I f a c o n s t r u c t  hand  side of a define  defined  with  ),  d e f i n i t i o n s on t h e r i g h t - h a n d  s i d e , i t i s used t o d e f i n e the  the right-hand  Define  If a  on t h e l e f t - h a n d  construct  s i g n means t h a t t h e c o n s t r u c t  the  define  sign  i s  being  on t h e  defined  on t h e r i g h t -  I n c l u s i v e o r means t h a t  the construct  the v e r t i c a l  construct As an e x a m p l e ,  line  appears  side-  or constructs  of  <unsigned  the d e f i n i t i o n  o f an i n t e g e r Normal  Form  i n ALGOL and i s listed  integer>  + <unsigned  integer>  J - <unsigned  integer>  integer>  the  on t h e r i g h t -  :; = <unsigned |  by t h e  with  follows; <integer>  left  on t h e l e f t  i s interchangeable  s y n t a c t i c d e s c r i p t i o n i n Backus  ::=  <digit> j <unsigned  <digit>  i t i s  on  construct  its  :; =  sign-  of  1  (i-e-  side of the define  construct  ::-  the  sign  a p p e a r s on t h e l e f t -  ;:= 0|1]2 J314 I 5|6|7|8|9  integer>  <digit>  as  XD  Fig.3.1  7  S y n t a c t i c Chart  25  The  same d e f i n i t i o n  o f an i n t e g e r p r e s e n t e d  f o r m by a S y n t a c t i c C h a r t The  compiler  i n flowchart  i s shown i n F i g . 3 - 1 . XPL £ 1 2 ] which  generator  i s  used  In  generation of the language LIG, r e q u i r e s a d e s c r i p t i o n syntactic  structure  of  the  language  the  of the  LIG i n B a c k u s Normal  Form. Specifically, graphical each  u s i n g t h e Backus Normal Form n o t a t i o n , t h e  assignment  BNF s t a t e m e n t  <graphical  o f LIG was d e f i n e d  i s called  ::=  <expression>  <primary>  v a r i a b l e > <replace>  ::=  <expression>  I  < e x p r e s s i o n > + <primary>  I  < e x p r e s s i o n > - <primary> variable>  <display  variable>  v a r i a b l e > ::= < g r a p h i c a l J <graphical |  <modification> variable> priraitive>  <literal>  v a r i a b l e > ::= < i d e n t i f i e r > I  <variable>  rule.)  <primary>  ::= < d i s p l a y  <graphical  (Note:  :=  | <display  a production  follows-  assignment>  <graphical <replace>  as  < i d e n t i f i e r > ( <variable>  ::= < i d e n t i f i e r > | <number>  )  <modification>  <modifier> j <modification>  <modifiar>  <modifier>  = AT <arguments> | SCALE  <arguments>  | ANGLE  <variable>  | ANGLE < v a r i a b l e >  HAD  J ANGLE < v a r i a b l e >  DEG  | FROM  <arguments>  | TO <arguments>  <arguments> <graphical  j VSYM  <varia.ble>  | HSYM  <variable> j <arguments>  ::= < v a r i a b l e > primitive>  , <variable>  BLANK| LINE] SQUARE |TRIANGLEj CIRCLE|SCIHCLE  <identifier>, defined  in  graphical display  the  <number> XPL  assignment  and  compiler of  a  <literal>  are  [ 1 2 ] . Hence,  graphical  to  variable  v a r i a b l e TRIANGLE a t t h e c o - o r d i n a t e p o i n t  the LIG statement  i s coded  internally make  the  TAT t o t h e (0.6,1.0),  as f o l l o w s :  * TAT := TRIANGLE AT 0.6,1.0 ; The s y m b o l s * and ; a r e language. that  this  The s y m b o l * i s used i s  defined  in  the  original  LIG  to notify  t h e LIG p r e p r o c e s s o r  not a F o r t r a n statement-  The LIG p r e p r o c e s s o r  27 will *,  t r a n s l a t e the  and  file.  source statement  i t passes a l l Fortran The  symbol  ; is  beginning  statement  used  to  Gra£hical V a r i a b l e  and  with the  directly  denote  the  symbol  t o the  end  output  of  a  LIG  statement.  3.3  will  A  two-dimensional  be  visible  unit,  and  variable  v a r i a b l e can  invisible  be  is a  also  B a c k u s N o r m a l Form <graphical  be  ::=  Hence  P(1)  BOBT a r e  However, P(SQST(2.3+N)) v a r i a b l e names. The is  a  function  single  subscript function  of or  to a  and  by  as The  [21].  a  There single  value  A  a subscripted  of  a  graphical  (e.g. LINE1,  <identifier>  FLOSEE,  variable.  the  { <variable> )  | <number>  legal  graphical  Q(1,4)  subscript  and  subscripted  Compared  identifier  <identifier>  and  object.  lines.  <identifier> I  :;=  Considered  object  denoted  of  notation,  variable>  <variable>  lines.  a graphical  an  Attributes  i s composed  graphical  d e n o t e d by  HOUSE e t c ) . I t can In  picture  a picture i s called  graphical  Modification  of  the  second  are first  variable  illegal graphical  graphical  variable  naxes.  graphical variable i s not  a  variable.  many h i g h - l e v e l programming variable  even an  can  arithmetic  be  languages,  a number, an  e x p r e s s i o n . In  the  identifier,  order t o  a  retain  28 this  compact  feature,  implementation As allow  the  syntactic  in  2 - 1 , a graphics  Section  t h e a p p l i c a t i o n programmer object-  operators  and  i t s  i n L I G was i m p r o v e d -  mentioned  graphical  structure  In  LIG  system  t o modify and  statements,  should  manipulate  the  modification  a r e AT, SCALE, ANGLE, FROM, TO, VSYM AND HSYM-  value  factor associated  called  a modification  With r e f e r e n c e Section  3-2,  modifications  with these  modification  a  The  operators i s  attribute.  t o t h e Backus  the  Normal  following  i n a graphical  Form  examples  assignment  notation  are  legal  in LIG  statements,  AT X, Y SCALE  0-5,0.1  ANGLE 90 DEG However, t h e f o l l o w i n g g r a p h i c a l assignment  are i l l e g a l  LIG  modification, i n  statements,  AT (3 + 4) , (I/N*J) SCALE SQBT(N) ,B00T(6+T) ANGLE H (1) DEG In t h e previous the  only  LIG  syntax  can  also  two  legal  LIG syntax, i d e n t i f i e r s modification  was i m p r o v e d , s o t h a t be a s u b s c r i p t e d  and numbers  were  attributes- Therefore, the  the modification  variable, a Fortran  attributes  function  o r an  29 arithmetic  e x p r e s s i o n . These  the s y n t a x as g i v e n  Attribute The  i n Appendix  Assignment  modification  v a r i a b l e are stored statements  which  values  any  of  variable-  They  numerical  i n the can  and  Numerical  reflected  in  data  base.  with a  There  t o modify  attribute  are the a t t r i b u t e  Assignment  associated  be u t i l i z e d  simple  are  A-  attributes  assignment  notation,  improvements  bonded  assignment  statement.  In  are  graphical two  LIG  and  examine t h e  a  graphical  to  s t a t e m e n t and  Backus  Normal  the Form  the grammatical r u l e s are:  <attribute  assignment> ::=  <numerical  assignment  ::= <attribute  <attribute function> = <variable>  <variable> = <attribute  functioa>  function>  ::=  <functionhead>  <functionhead>  ::=  <display variabie> )  <functicnname>  (  <f unctionname> ::= The  XLOC|YLGCJ XSCALE|YSCALEJ ANGLEJ  attribute  attribute  of  SUBSCRIPT  assignment s t a t e m e n t changes  a graphical  v a r i a b l e t o a new  the F o r t r a n  v a r i a b l e on i t s r i g n t  assignment  statement  extracts  hand the  sidevalue  the  one  previous  specified  by  The  numerical  of the  attribute  30 bonded  to a g r a p h i c a l v a r i a b l e  specified  FORTRAN  There like a  are  case  cases  a  where an  attribute  the  application  value  to  programmer  v a l u e by a s s i g n i n g t h e  f u n c t i o n o r an  of a numerical  assign  assigns  a  variable-  t o change t h e  variable,  and  value  of  a r i t h m e t i c expression. In  the  assignment statement,  the e x t r a c t e d a t t r i b u t e  would  value  he  might  wish  to  to a s u b s c r i p t e d F o r t r a n  variableAll  these  structure  of the  reflected  LIG  statements-  i n the syntax  3.5 To  have been i m p l e m e n t e d  LIG  the  syntactic  LIG  BNF  form  and  the  preprocessor-  statements  The  determines  Backus XPL  Normal  first Form  a n a l y z e r takes the  fiesult step  I f there  is  no  ANALYZER (XPL)  error,  a  is  to  for  the  LIG  LIG  syntax  in  i f i t i s acceptable f o r the  i s generated £ 1 2 ] -  L I G SYNTAX (BNF)  the  also  A.  Im£rovement  Preprocessor,  correct  structure-  and  syntactic  These improvements are  g i v e n i n Appendix  Preprocessor  change the  formulate  as  to improve the  table  parser of of  XPL  31 The  second s t e p i s t o modify t h e XPL SKELETON- Then the  t a b l e generated by the XPL a n a l y z e r , the s y n t a x - s e m a n t i c s  and  t h e m o d i f i e d XPL SKELETON are combined and i n p u t t o  XPL  compiler LIG  as  source  Preprocessor  s t r u c t u r e of LIG  the  codes. The r e s u l t i n g o b j e c t code i s t h e  which  accepts  the  revised  syntactic  statements.  TABLE  LIG  PREPRO-  CESSOR  SKELETON  A  listing  of  the t e s t r e s u l t i s shown i n the l a s t  pages o f t h i s s e c t i o n . For the g r a p h i c a l assignment * 0BJ1(SUB1) := OBJ2(S0B2) AT X,¥ t h e LIG p r e p r o c e s s o r  will  statement  SCALE SX,S¥ ANGLE A ;  generate  the  following  two  , Fortran  statements: CALL ASSIG(»0BJ1 CALL PRIMA(1,* OBJ2 The  last  ',S0B1) •,SUB2,X,Y,SX,SY,A,1)  parameter of PRIMA w i l l be 2 i f s c a l i n g i s a p p l i e d  before r o t a t i o n -  The  preprocessor  translates  a. n u m e r i c a l  assignment the  statement  function  C0RF1  assignment  statement  statement  (i.e.  first  parameter  into on will  a F o r t r a n assignment the  right  statement  hand s i d e .  be t r a n s l a t e d  as  a  An a t t r i b u t e Fortran  t h e s u b p r o g r a m CHCHOR i s i n v o k e d ) .  i n CHCHOR s p e c i f i e s  ANGLE o r SUBSCRIPT i s t o be examined  whether  with  X,  or modified.  1,  call The  SX,  SI,  L I G  - PREPROCESSOR  TODAY I S : 06-28-76. 1 2 3 H 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  1 *  •  (MAY 27,1976 VERSION)  TIME = 15:46:55.80.  *NOVA VERSION *STATE 1: C TO TEST THE LIG SYNTACTIC STRUCTURE 1 j HE GRAPHICAL ASSIGNMENT STATEMENTS * O B J ( M ( N ( 0 ( P ( Q ( R ( S { ( ( D + D ) / ( M + D ) ) * G ) ) ) ) ) ) ) ) :=CIRCLE AI (S + D (I) +M (D*G+F/K) */M (1+1) }, (SQRT ( (J + K)/M) ) ANGLE FMT SCALE HAHA; *OBJ (SQRT(I + 2*K/D) ) :=CIRCLE AT (X3+X4* (SQfiT (D) ) ) ,Y3 SCALE (F (I*H) ) , (M-D) *ANGLE ( (ROOT (F)+SQRT (G) ) *D) ; C 2ND, THE NUMERICAL ASSIGNMENT STATEflENTS *NEM1 = X L O C ( 0 B J 2 ) ; *NOMBEH(I) = YLOC (Q (1+1) ) ; *INT ( (SQRT (M**2)+C-D/Q) *D(I)-D) =XSCALE (F (ROOT (F*G) )) ; * I N T ( 1 ) =YSCALE (OBJ (1) ) ; *INT (I) = ANGLE (M (6) ) ; *INT(I*J/K) = SUBSCRIPT(OBJJJJJ) ; C 3RD, ATTRIBUTE ASSIGNMENT STATEMENTS *XLOC(OBJ1) =ARITHEXP; * YLOC (OBJ (2) ) = A+C /D; *XSCALE (OBJ (I) ) =M**SQRT (D/C + D) ; *YSCALE (OBJ (ROOT (M) *D-C (I) ) ) =SQRT (M**N**1) - ROOT (Q); *ANGLE (QUEET) = 6 ; *SUBSCRIPT (INTEG (6 + 6) } = 6+1-4**2; STOP *END STATE 1: C  S T  f  *EOF EOF EOF MAIN PROGRAM GENERATED  COMPILATION TIME  0:0:0.14.  END OF COMPILATION NO ERRORS WERE DETECTED.  C C .  C C  C  C  LIG PREPROCESSOR OUTPUT NOVA VERSION (MAY 27, 1976) OVERLAY OVS01 SUBROUTINE S01 STATS 1 LOGICAL HITON COMMON IDUMMY(5147) TO TEST THE L I G SYNTACTIC STRUCTURE 1ST , THE GRAPHICAL ASSIGNMENT STATEMENTS (M(N(0(P{Q(R(S(((D+D)/(M+D))*3) ) ) ) > ) ) ) ) CALL A S S I G ( » O B J ',0, (S + D(I)+M(D*G + F/K)/M(I+1)) , (SQRT((J+K)/M CALL PRIMA (1 ,'CIRCLE *) ) ,HAHA,HAHA,FMT,2) (SQRT(I + 2*K/D) ) ) CALL ASSIG ('OBJ CALL PRIMA(1,'CIRCLE ',0, (X3 + X4*(SQRT(D) ) ) ,Y3, (F (I+M) ) , (M-D) , ((RO *OT (F) + SQRT (G) ) *D) ,1) 2ND, THE NUMERICAL ASSIGNMENT STATEMENTS NEM 1 = CORF1 (1 , 'OBJ2 ',0) NUMBER (I) = CORF1(2,'Q ',(1 + 1)) INT ( (SQRT (M**2) + C-D/Q) *D(I)-D) = CORF1 (3,»F (ROOT (F*G))) INT (1) = CORF 1 (4, 'OBJ • , (1) ) I N T ( I ) = CORF 1 (5, ' M • , (6) ) I N T ( I * J / H ) = CORF1 ( 6 , ' O B J J J J J »,0) 3RD, ATTRIBUTE ASSIGNMENT STATEMENTS CALL CHCHOR(1,'OBJ1 ,0,ARITHEXP) CALL C H C H O R ( 2 , • O B J , ( 2 ) A + C/D) CALL C H C H O R ( 3 , • O B J , (I) ,M**SQRT (D/C+D) ) CALL C H C H O R ( 4 , ' O B J , (ROOT(M) * D - C ( I ) ) ,SQRT(M**N**1)-BOOT(Q)) CALL C H C H O R ( 5 , ' Q U E E T ,0,6) CALL C H C H O R ( 6 , • I N T E G , (6+6) ,FLOAT(6 + 1-4**2) ) STOP END f  35 •IV. PICTOEE GENERATION  4.1  In  the  assignment called  Graphical objects,  high-level  G e n e r a t i o n i n LIG  graphics  language LIG, t h e g r a p h i c a l  s t a t e m e n t i s used t o b u i l d  the  statement  Picture  BY GRAPHICAL FUNCTIONS  graphical  will  place  objects which  object a  can  are  [ 7 ] . The  graphical be  called  up a p i c t u r e ,  p r i m i t i v e s c a n n o t be f u r t h e r  graphical  e l e m e n t s . The s e t o f g r a p h i c a l  BLANK,  LINE,  TRIANGLE, SQUARE,  on  i s  display  the  into basic  graphical  graphical  of  grapnicai  object  decomposed  which  screen. graphical  primitives.  These  decomposed i n t o  other  primitives  consists  CIRCLE a n d S C I a C L E  (refer  t o F i g . 4. 1) .  LINE  TRIANGLE  A OC SQUARE  FIG. 4.1 PRIMITIVES  CIRCLE  SCIRCLE  BLANK  All square  LIG g r a p h i c a l with  square. Using objects  are  the  primitives are defined  reference  these built.  point  s i xgraphical The  within  at the centre  two  examples  f o r m a t i o n o f a 2 - i n p u t AND g a t e and t h e p i c t u r e o f a (a)  2-input * GATE  :=  AND g a t e  graphical show  ( r e f e r t o F i g . 4.2)  L I N E FROM 0.1, 0.5 TO 0.3, 0.5 + SCIBCLE SCALE 0.6, 0.4 AT 0-6, 0-5  *  + L I N E FROM 0.6, 0-7 TO 0-6, 0-3  *  + LINE FROM 0-6, 0.6 TO 0.9, 0-6  *  + L I N E FROM 0-6, 0-4 TO 0-9, 0-4;  * DISPLAY  GATE;  A truck  ( r e f e r t o F i g - 4.3)  * TRUCK := SQUARE SCALE 0.3 AT 0.35, 0-65 *  + SQUARE SCALE 0.8, 0.3 AT 0-5, 0-35  *  + CIRCLE SCALE 0-2 AT 0-3, 0-2  *  + CIRCLE SCALE 0-2 AT 0.7, 0.2;  * DISPLAY TRUCK;  the  truck.  *  (b)  unit  ox t h e u n i t  p r i m i t i v e s , other  following  a  38  4.2 The LIG Data Base The  LIG data base s t r u c t u r e i s shown i n F i g - 4.4- I t i s  a linked l i s t  s t r u c t u r e £3] £4] £7]  initialization,  t h e name  of  [24],  i n s e r t i o n £11]  £13].  used i n t h e p r e v i o u s LOCLST 200  contains  LIG  data  modification  LIG  the  For  a  system.  data  values  block in  The  associated  consists  compact  of the  form, the  (SOPP), t h e d e f i n i t i o n p o i n t e r  (DEFP),  p o i n t e r and t h e use p o i n t e r .  graphical  primitive,  the d e f i n i t i o n pointer i s  b i a s e d by a v a l u e o f 10000. I t s t r u e  value  i s used  p o i n t e r , p o i n t i n g t o t h e f i r s t e n t r y i n t h e XYP l i s t list  contains  the  for  T h i s a l g o r i t h m was p r e v i o u s l y  graphics  Each  attribute  the i n d e x , t h e i n d e x  i s employed  p o i n t e r t o a LIG data block- There a r e  blocks.  superposition pointer  system  the g r a p h i c a l p r i m i t i v e s are  i n s e r t e d i n t o t h e NAHLST. A hash a l g o r i t h m name  Luring  co-ordinate  pairs  as  a  The XYP  and the P e n - v a l u e , a  v a l u e i n d i c a t i n g whether t h e pen i s i n w r i t i n g o r n o n - w r i t i n g position-  To d i s p l a y a p i c t u r e on t h e s c r e e n , t h e a l g o r i t h m  d i s c u s s e d i n S e c t i o n 2.6 i s used. I n order t o keep all  the  track  of  m o d i f i c a t i o n a t t r i b u t e v a l u e s , a push down s t a c k i s  implemented.  39 ^ NAMLST ^ LOCLST  PEN  Y  1 <  •  * TRUCK := SQUARE a + SQUARE b + CIRCLE c + CIRCLE d ; where a,b,c and d a r e m o d i f i c a t i o n a t t r i b u t e s .  Fig.4.4  LIG- D a t a Base S t r u c t u r e  40 Besides deletion  data  block  again.  For  block  the  to  the  for further  there  generation  This  is  the  are of  LIG  LIG  graphic  data  only  graphic By  true  appropriate  l a n g u a g e LIG  definition,  [10]  resulting  a  Similarly,  is  an  garbage  wnich  block  is  then  somewhat  limited.  a p p l i c a t i o n programmer  composed of  feature  function  following Fortran  was  irregularly  generation  of  implemented  an in  is  called  almost the  a  universal  value  of  the  statement,  (C,D)  function, value  re-used  [14].  In t h e  a  be  graphical primitives,  example i s t h e  function.  is  the  Function  when  which y i e l d s a r e s u l t ,  SUM  a  deleted  released data  pool,  object  operator,  A = SUM  The  could not  The  s i x b a s i c LIG  a r c . Hence, a g r a p h i c a l f u n c t i o n the  will delete  system, a simple  block  Graphical  a graphical  An  i s also  use.  particularly  lines.  there  base,  version  wants to g e n e r a t e a g r a p h i c a l o b j e c t curved  •+*,  data  i s implemented-  4^3 As  from  improved.LIG  back  operator  d e l e t i o n operator  previous  algorithm  linked  available  The  i n the the  collection is  superposition  operator  appropriate data  the  of  whose v a l u e  C + D  i s the  i s associated  sua with  of the  C and name  D.  The SUM-  a g r a p h i c a l f u n c t i o n i s a f u n c t i o n which d e l i v e r s  41 a  value  of  defining  type  the  graphical.  function  may  p a r a m e t e r s which u s u a l l y above  Fortran  resulting  A is  graphical  function  graphical  expression.  the  function  points  with  different  objects  depending  invoked  by  T h u s , AfiC(X1,  and  set  C  of  and  function on  its Y1,  the  X2,  (X3,  X3,  passing  ¥3) -  For  the  D,  the  parameters.  ¥2,  arc  input  generates  appearance  g e n e r a t e an  (X2,Y2)  a  operations  argument l i s t .  graphical  which w i l l  of  d e p e n d e n t on  A  is  (21,11),  sequence  a p p e a r i n an  different.  graphical  graphical  be  statement,  different  The  For  in Y3)  A a  is a  through the  LIG  statement, * the  DISPLAY ABC (0.1, graphical  reguested this  case,  base. For * P * the  arc  the  0.4,  ABC  LIG  is  and  parameters  0.6,  0.1,  0.3);  referred  displayed will  not  on be  ,  to,  and  so  the  the  screen.  In  stored  i n the  data  statements  ABC(X1, Y1,  X2,  Y2,  X3,  ¥3)  AT  X4,  Y4  SCALE M  ;  DISPLAY P ;  value  have  function i s generated  the  :=  0.2,  of  t o be  be  retrieved  on  the  the  p a r a m e t e r s and  stored  into  when t h e  screen.  the  data  graphical  the  modification  base. These data object  P i s to  be  attributes values  will  displayed  42 iii£ il£l®lSSi§ii2a Scheme In  the  former  LIG  graphics  was  referred  to  for display  variable was  checked  by  program)- I f graphical  object,  generating  of  an  graphical The  graphical  error  message,  or  existence  of  subprogram)  this  That  is,  passed  i s no  system  the  back  or  user  the  subprogram).  modification  to  picture  In  on  the  the  name  is  this  name  (name s e a r c h i n g  sub-  not  handled  Error  graphical XYP-list  and  the  instead  of  identified as  a  FSSCH  as  (graphical for  messages w i l l  function  is  be  a  function  I f there  will  will  For  function-  DISPL  DISPL  predefined  f u r t h e r check  function.  XYP-list  its  subroutine  subroutine  displaying  screen,  feature,  such g r a p h i c a l  appropriate to  a  the  graphical  i s generated.  which w i l l  graphical  generated i f there match, t h e  call  when a  p r i m i t i v e or a  function  primitive  will  the  message  the  program  switch  error  on  NMSRCH  a graphical  an  variable  function  a  subroutine  i t i s not  implementation  call.  the  system,  the be is  called.  generated  (grapnical  and  object  apply  the  necessary  display  the  generated  screen-  case  when a g r a p h i c a l  assignment  i s involved,  as  in * P the  :=  A(M,N) AT  values of  stored  the  X,  Y SCALE SX,  modification  i n t o a data block.  The  SY  ANGLE A DEG;  a t t r i b u t e s i n compact name o f  the  graphical  , form  are  function  43 A,  and t h e p a r a m e t e r s  is  registered  of  this  data  values,  (M,N) have t o he k e p t -  i n another data  block,  i s biased  which c o n t a i n s  by a v a l u e  pointer,  pointing  to  graphical  function  name  Therefore, biased to  when  pointer  block-  P  is  will  the  pointer  the modification a t t r i b u t e  data  block  the  be  information  The d e f i n i t i o n  o f 20,000, I t s t r u e  and to  This  value  which  stores  associated  displayed  be used i n d i r e c t i n g  i s  a  the  parameters.  on t h e s c r e e n , t h e  the necessary  action  be p e r f o r m e d .  4.5 G e n e r a t i o n by Using programmer impossible  a Graphical  the graphical can  i n the previous  )  Examples  feature,  graphical  LIG g r a p h i c  f o u r cusps  i s a curve described  a/4 a s i t r o l l s  a  Curves  an  application  object  system-  which  Some  of  (refer  by a p o i n t  P on a c i r c l e of  of radius  radius  by t h e e g u a t i o n s i n p a r a m e t r i c  a.  3  sin A 3  LIG statements, the f u n c t i o n  was coded a s f o l l o w s  *  FUNCTION CUSPS:  C  TO GENERATE A HYPOCYCLOID WITH FOUR  CUSPS  The  form:  x = a cos A  Using  the  t o F i g - 4.5)  on t h e i n s i d e o f a c i r c l e  c u r v e c a n be d e s c r i b e d  y = a  i s  as f o l l o w s :  Ml£2£Y.Si2id w i t h  This  Function^  function  generate  examples a r e l i s t e d a  of S p e c i a l Plane  44 *  START (1-0,0.5) ; DO 10 K=1,5 9  I=T*Q.1047199 T1=C0S (T) T2=SIN (T) T3=0.5+Q.5*T1*T1*T1 T4=0-5-Q.5*T2*T2*T2 *  FORBAED(T3,T4) ;  10  CONTINUE  *  STOP (1-0,0-5) ; RETURN E N D  (fa) Three-leaved Rose  ( r e f e r t o F i g - 4.6)  The curve i s d e s c r i b e d by the e g u a t i o n r=a c o s 3A . Using LIG statements,  the f u n c t i o n was coded as f o l l o w s ;  *  FUNCTION R0SE3:  C  TO GENERATE A ROSE OF 3 LEAVES ANGLE^O.01282  *  START (1.0,0.5) ; DO 10 K=1,4 90 T=K*ANGLE TT=A*COS (3*T) T1 = 0.5*TT*COS{T) T2=0.5-TT*SIN (T)  *  FORWARD (T1, T2) ;  10  CONTINUE  *  STOP (1.0/0.5) ; RETURN END  ( )  l2ii£~i§.ived Rose  The  c u r v e i s d e s c r i b e d by t h e e g u a t i o n r=a c o s 2 A .  c  Using  (refer  LIG s t a t e m e n t s ,  t o F i g . 4.7)  the f u n c t i o n  was c o d e d a s f o l l o w s :  *  FUNCTION  ROSE4:  C  TO GENERATE A ROSE OF 4 LEAVES ANGLE=0.00641  *  START (1.0,0-5) ; DO  10 K=1,4 90  T=K*AHGLE TT=A*COS (4*T) T1 = 0. 5+TT*COS (T) T2=0.5-TT*SIN{T) *  FORWARD(11,T2);  10  CONTINUE  *  STOP (1.0,0.5) ; RETURN END In g e n e r a l , f o r the case r  (b) and (c) t h e e g u a t i o n i s  = a c o s nA  o r r = a s i n nA The  generated  g r a p h i c a l o b j e c t has n l e a v e s i f n i s o d d , o r  2n n  leaves  i f n i s e v e n and i t d e g e n e r a t e s  into a  circle  for  = 0. Using LIG statements, the f u n c t i o n  *  FUNCTION  was c o d e d a s f o l l o w s :  EOSE(N):  ANGLE=0-01282 L=N/2 L-=L*2 I F (N.NE-L)ANGLE=0.00641  *  START (1.0,0-5) ; DO  10 K=1,490  T=K*ANGLE TT=A*COS (N*I) T1=Q-5+IT*COS (T) T2=0.5-TT*SIN(T)  *  FORWARD (T1,T2) ;  10  CONTINUE  *  STOP (1-0,0-5) ; RETURN END  4.6 G r a g h i c a l Shen  a  Assignment  Statement with  graphical  function  i s  a Graphical  Function  invoked i n a g r a p h i c a l  a s s i g n m e n t s t a t e m e n t , t h e name o f t h e g r a p h i c a l f u n c t i o n its  associated  base-  In  p a r a m e t e r s have t o be s t o r e d  the d i s p l a y  process,  this  and  into  the L I G d a t a  information  i s retrieved  from  t h e d a t a base-  reguested graphical  graphical function,  modifications displayed  Computations object,  i s built-  to t h i s  which After  generated  on t h e s c r e e n .  a r e then is  performed generated  applying  graphical  object,  * DISPLAY P ; generate  a picture  the  by  the  necessary i t will  F o r example, t h e L I G s t a t e m e n t s  * P:= ROSE(O) + ROSE (2) + ROSE (4) ;  will  the  and  a s shown i n FIG- 4 . 8 -  be  Fig.4.6  Three leaved rose  50 V. after seguence was  investigating of  the  of  The  on  previous  appearance  the  a  different  same g r a p h i c a l o b j e c t , i t  generated  LIG  of  of applying  to the  pictures  dependence  significant. order  the e f f e c t  transformations  shown t h a t t h e  Thus,  CONCLUSION  were  order  of  graphics  not  identical.  transformation i s  system  ignores  the t r a n s f o r m a t i o n e n t i t y  the  in a  s t a t e m e n t . Then f o r w h a t e v e r s e g u e n c e o f t r a n s f o r m a t i o n s applied  to  a  graphical  object,  the  same  LIG were  picture  was  generated. is in  a  the LIG  order  of a p p e a r a n c e  statement  preprocessor,  the  can  XPL  of t h e t r a n s f o r m a t i o n  only  Skeleton  be  detected  was  modified  by  the  d e t e c t i o n of the  t r a n s f o r m a t i o n s e g u e n c e . Then a  LIG  preprocessor  generated  The  LIG  will  generate the The  not  supporting  the  number o r  identifier.  the  modified  order  to  grammar o f t h e  accept LIG  the  any  XPL  as w e l l ,  modified compiler.  such  that i t  picture-  arithmetic expressions a t t r i b u t e and  In  means o f t h e  p r e v i o u s LIG  modification an  was  appropriate  grammar o f  accept  system  by  LIG  to incorporate  the  was  entity  graphics  i n any  subscript  LIG  language  does  statements.  could  only  The  be  a  imbedded a r i t h m e t i c e x p r e s s i o n ,  graphics language  was  changed.  aith  51 the  revised  used  to  build  statements rules  grammar, a new the  which  XPL t a b l e  revised  were  are the g r a p h i c a l  LIG  affected  was g e n e r a t e d ,  preprocessor-  The  by t h e changed  assignment statement,  graphical  incorporated a  function  i n t o t h e LIG g r a p h i c s  variety of graphical  this the  feature  the  featureassociated  objects  The g r a p h i c a l parameters-  modified  function  feature.  The  LIG  The r e v i s e d  graphical time,  function  a simple  use.  In  blocks  LIG g r a p h i c s  from a g r a p h i c a l  data  block  previous  a l s o d e p e n d s on  accept  previous the  system  system  will  variable. algorithm  graphics  LIG  graphical was  also  distinguish a At  was  the  same  implemented.  c a n be made a v a i l a b l e f o r  LIG  that  system, r e l e a s e d  future data  were n o t made a v a i l a b l e f o r r e - u s e .  The have  the  to  and  by t h e use o f  the  supporting  garbage c o l l e c t i o n  Thus, a r e l e a s e d  generated  The grammar o f  was  statement.  s y s t e m - I t was shown  object  language  numerical  proposed  c a n be g e n e r a t e d  graphics  modified-  was  LIG  grammatical  a s s i g n m e n t s t a t e m e n t and t h e a t t r i b u t e a s s i g n m e n t A  and was  following  been  list  implemented  summarizes into  the  the  improvemeats,  LIG g r a p h i c s  which  l a n g u a g e and  system: (a)  For  resulting sequential  concatenated transformation applications  transformations,  the  has t h e same e f f e c t a s of  the  original  transformations. (b)  LIG  s t a t e m e n t s can  have imbedded a r i t h m e t i c  expressions. (c) More v a r i e t y generated  by  of  graphical  dynamically  paramenter (d) , The use  of  (e)  The  by  be  Using  g r a p h i c a l o b j e c t can  altering  the  be  associated  list.  garbage c o l l e c t o r  r e l e a s e d data LIG  recoded  can  means o f g r a p h i c a l f u n c t i o n s .  a g r a p h i c a l f u n c t i o n , the changed  objects  system  and  unnecessary  supporting to  subroutine of  the  re-  blocks.  combined  possibility  scheme e n a b l e s  reduce  calls.  stack  subprograms the  This  overflow  were  number  reduces  during  of the  program  execution.  Further graphics  improvements  l a n g u a g e and  (a)  system  are;  Investigate  the  center  of the  ordinate (b)  which  screen  can  be  made  possibility as  the  to  of  the  LIG  using  the  the  co-  origin  of  and  from  system.  Delete  the  symbol  the  HITOB  *  ;  the  LIG  statement. (c)  Modify  construct,  so  that  53 identification displayed (d)  inking (e)  graphical  Implement a  •a w r i t i n g  will  not  made  to  an  non-  variable.  graphical  t a b l e t as  be  an  input  input  statement,  device,  or  using  using  the  technigue. Include  graphical  graphical  function.  type  parameters  in  a  54  [1]  F . A y r e s , Theory, and P r o b l e m s  of  Matrices^  McGraw-Hill,  1967 [2]  T.S-Berk,  j.  TUNA  Lang.ua£e  x  Florida  International University,  [3]  Technical  Hiah-Leyel  A  A.T-Berztiss,  Data  Mathematical  S c i e n c e s Department, 1973  February  S t r u c t u r e , Theory  and  Practice^  1971  Academic P r e s s , [4]  Report,  G r a p h i c a l Programming  J . Ear l e y ,  Toward  an  Understanding of Data  C o m m u n i c a t i o n o f ACM, V o l . 14, No. 10, O c t o b e r  Structures.*  1971,  p-617-  627 [5]  1-Fox,  Oxford [6]  Introduction  University  A-J.Frank,  1968 F J C C , [7]  An  to  P r e s s , London  B-line  A  Bell  Numerical  Linear-- A l g e b r a ,  1964  Line  Drawing  Language^  AFIPS  p-179-191  J-C.Gray,  Compound  Desisai A Survey  x  Data  Proceedings  Structure ACM  of  Com£uter  National  Meeting,  Aided 1967,  p.355-365 [8]  D-Gries,  John  W i l e y and S o n s ,  [9]  H.Kanner, P - K o s i n s k i and C.L. R o b i n s o n ,  Yet  Comgiler  Another  2S  ALGOL  Cqmpilerj 1967,  N.Marovac, A S i n g l e lSi§£§Stil§  for Digital  Com£uterj,  1972  Languages, McGraw-Hill, £10]  Construction  Computer  The S t r u c t u r e  Programming  Systems  of and  p.228-252  Data-dis£lay_ S t r u c t u r e A New Graphics  in  CAD  A  The  View  Computer  55 Journal, [11]  V o l . 16, No. 2, June  1971, p.152-156  W.D.Maurer, T . G . l e w i s . Hash  S u r v e y s , V o l . 7, No- 1, March [12]  W.M.McKeeman,  Generator [13]  t  Table  Methods*.  Computing  1975, p.5-19 a n d D.B.Hortman, A C o m p i l e r  J.J.Horning  P r e n t i c e - H a l l , 1970  E.Morris, Scatter  Storage Technigues  t i  Communications o f  ACM, V o l . 11, No. 1, J a n u a r y 1968, p.38-44 [14]  W.Newman, D i s p l a y . P r o c e d u r e s  Oct.  Communications  t  o f ACM,  1971, V o l . 14, No. 10, p.651-660  [15]  W.M.Newman,  Computer [16]  E.F.Sproull,  Graphics*, M c G r a w - H i l l ,  B. P i e k e ,  Design  1§£9..§..S®  and  Ifit§£S£iive  U  Electrical  Engineering,  Principles  ox  Interactive  1973  Implementation Computer  of  a  Graphics,  The U n i v e r s i t y o f  Hxgh-Level  Department o f  British  Columbia,  J u l y 1973 [17]  B.Pieke,  G.F.Schrack, Implementation - o f an I n t e r a c t i v e •  GJElElliSs  Language*. P r o c .  Seminar  of  Third  the National  Man-Computer  Eesearch  Communications  Council,  O t t a w a , 1973,  p. 7. 1-9 [18]  S . f i o s e n , The ALGOL  Programming  Language*.  Programming  S y s t e m s and L a n g u a g e s , M c G r a w - H i l l 1976, p.48-78 [19]  J . E.Sammet,  Basic  Elements  of  COBOL 61*. Programming  S y s t e m s and L a n g u a g e s , M c G r a w - H i l l , 1967, p.119-159 [20] Ogg£s«  G.F.Schrack, L I G Manual*.  X  Language  Department  of  f o r Interactive Electrical  Graphic§i  E n g i n e e r i n g , The  U n i v e r s i t y of B r i t i s h Columbia, [21]  G.F.Schrack,  Design*.  1975  Implementation  and  'Experiences  with a H i g h - l e v e l Graphics Language f o r I n t e r a c t i v e Aided  Design  gugBQsesj,  1976,  p.10-17  [22]  D.M.Smith,  GPL^I  computer  -  A  Graphics, V o l . 10, S p r i n g  PL/I  Extension  Graphics,*. AFIPS 1971  SJCC, p.511-528  [23]  8.R.Mallgren,  C.N.Turriil,  XPLG  -  for  [24]  and  Graphics, V o l . 1, 19 75,  R . W i l l i a m s , A Survey  Graphics  Systems*.  of Data  Computing  in  Pro  p-55-63  Structures  Surveys,  Computer  Experiences  Implementing an Experimental I n t e r a c t i v e Graphics System* Comput.  Computer-  for  V o l . 3, No.  Computer 1, March  1971,  p.1-21  [25]  B.L.M.wyvill, GROAN*. U n i v e r s i t y of B r a d f o r d , June  1974  APPENDIX  A  LIG GRAMMAR IN BNE NOTATION  58  A u ts M  a  as  co  rt  OS (9 O CS CU  ca  S3 CO 55  A EH  M H  M •4  o  to  O  ca  CM  CO EH CO  A  rt  CO M CM M  la  V  0.  M  M  55 CO A « I S CO S s E-i M rt a H  53  rt  (u  o  M  n  '1  r-t  o  ra  55  « W M rt  CM V  H to >•  M .J  n  n to  A  V  o  SB rt  A  w ca JQ ca  W f«s - t «< 3d f - l (K  A CO EH  to u V o ca C-<  10  V  A O  to  A 10  X  o  «« H  * A «0 W  A  •4  EH  H H  W  V  co w  H M) En EH l O (A  rt  V V  CQ D  in cu  V  V  —  H  EH  EH  «c  T-  CM  to V ro  >•  ca  ca  rt fH  to Q 55  co  II  •• A  o  «: to S3  O O M 0.  V  rt H  M ca «:  55 55 55 55 tJ O U u ro M M M K 55  rt  fH  rt EH  co  EH  rt f-i CO  V  VO  A EH  to M •4 f55 M  •• A A A EH EH E H 55 5= 55  V  EH  A A EH EH O 55 n U  A M •J CO  55 CO  II  A COSH  to V  55 V  W •4  e-i EH  to  SC  «s  »: D  A  M W El H U  *  </> (a  ca ca ca  to V  A  rt ta  A  W H  H  A  H to  rt ca v. «:  A 19 Bs M O rt CO »  A  M  A  M fH  V  O  w to CO S  ca EH  A  EH  tO  W  55  EH  55 rt  O E-  CO E  —  A  EH  55  W  •* A  EH  2  A  EH  A  EH  A  U  O  M CO X W o. m rt EH CB EH  rt  M  EH  tO  EH  fH  EH  to to to « U >H CW co o w W a M rt M E H to to ^1 CC EH rt *Z Crl *Z rt M to CO OH 55 E H O 05 ca O rt K W M tO (J CO Va Du. V V 3 M Q V V 55 Q M V V V II  V  V  V  i  V  EH  to r : to 55 55 55 to 10 to to to ra o CM ra K CO Ul CO «« «: tO E H M t/l J H C J sz XZ rt •< H 55 rt E H CO ro CO En rt rt f-' rt E H E - E H •J ca rt EH •J CO O ra to E H rt rt rt  ca o  A EH  A  M  to  E-l  EH  rt  EH  rt  55 t3  to V  o  55  55 O Cvi  *•  O  O  Cn V  fM CM  —  O  O M  M V  55 OS  a  EH CO 05 II  at  ^)  3C  CO EH CO JC  ca is  ca  O  EH U 55  M EH O 55  CM  CM  V  o  A EH  to A  M CM M EH 55 CO  A 13 55 M £3. 55  55  CO  to V  o w V  55  CO  to V  II  CO  55  CO H  «:  O  EH  E> to  M EH  H  o  CO 55 M O CM M M EH EH U 55 55 CO D a CM M V V  rt 05 OH rt  to  H  rt ca A rt cv. <N ca  rt CO »  A EH 55 CO  ca  CO EH CO JC  ca  55 M 55  H  o  (K  CM  a  CO  CO  A  O  A  M EH  A Q rt  to tn  CM  «  Cv.  M EH U  A 55 O M  u  to  V  to  o  CO  V  V  v.  to CO ca  SS  D  ss to ca fH  rt  to  o n  EH  U  A 55 O W CO  EH  H ss  55 O  (-1  ca  cn  n «: ca  A EH M  A EH SS CO 9C CO fH  r>  W  rt  o ca a, CO  rt rt EH EH  to to 55 55  o o H EH O 55 O CM V  V  a in  VO CN  55 D CM V  ai A EH  to »-4 EH 55 CO CO EH  55  M EH U 55 Z3 Cu  M EH  II  55  V  fM IN  M A ^1 EH EH 55 55 CO CO 33 CO co EH * H  tz>  O  ta Cu K  to  rt EH  to  CO  A EH  to  O  M EH U 55 ZZt CM  CO FH 55 CO  .a o r-»  •»  A EH 55 CO  ro EH  rt EH to CO 55  ca  rt  V  A A  10  to CO  A  to tzt rt to •0 >rt >H •J CO  >• X  X X  V  rt t-  X X V  H  V a  V  E-i rt a . ca 3 1o cs rt EH o EH  II »• •t  A EH 55 CO 3C CO EH  rt EH to  55 O M EH  o  55  zz>  ca  to II  CM  _  to  A 55 O  W  to to  CO  ca cu X  EH 55  rt  to CO 55 M tO  A CO  o  rt tA  CU  CO  «  V  A CO •J  co  rt M ca  rt >• -1  rt  U 1-H ™  CU  rt CM O V H  CO  ca  rt V  EH  V  CO  ,  A EH 55 CO E CO EH  04 X CO  II  A EH 55 CO  5= 15 l-l  to in  rt A  to  H  u  fll  •«  >J  CO  "U  rt  A CO  ^4  a:  rt •o  E>  rt tX X  C^  rt ca  u  a. CO  V  V  V  V  V  ca V  r - co  <n  o ro ro ro  ro n  m  in ro  CN f H  CM  CM  o  36 . <ATTRIBUTE ASSIGNMENT  ::»  <ATTRIBOTB FONCIION> « ARITHMETIC EXPBESSION>  37 38  <NUMERICAL ASSIGNMENT  ::= |  <IDENTIFIER> = <ATTRIBUTE FUNCTION> <SUBSCRIPTED VARIABLE> = ATTRIBUTE FUNCTION>  39 t»0  <DISPL£Y STATEMENT>  42 43  <DISPLAY>  :!= | 1  :» 1  DISPLAY <DISPLAY> DISPLAY <DISPLAY> 3NT0 <ARGUMENTS>  <DISPLAY VARIABLE> <DJCSPLAY VARIABLE> <MODIFICATION> <DISPLAY VARIABLE> WITHIN <ARGUHSNTS> <IDENTIFICATION HEAD> : <STATEMENTLIST> <ENDING>  44  <IDENTIFICATION CONSTRUCT>  ::=  as  <IDENTIFICATION HEAD>  FOR HIT ON <IDENTIFIER>  46  <ENDING>  47  <STATE-TRANSFER  48 49  50  ::=  ::=  END STATEMENT I  <CURSOR STATEMENT  =  <ERASE STATEMENT>  GOTO STATE <VAHIABLE> GO TO STATE <VARIABLE>  CURSOR ON ERASE SCREEN  <DRAW STATEMENT  :  DRAW <MODIFICATION>  52 53.  <FILE STATEMENT>  :  STORE <ARGOMENTS> RESTORE <ARGUKENTS>  5i» 55 56  <READ STATEMENT>  !  READ CURSOR <IDENTIFIER4> <,3> <IDENTIFIES> READ KEY <IDENTIFIER> READ SUBSCRIPT <IDENTiFIER>  57 58 59  <EXPRESSION>  60 61  <PHIMAHY>  62 63 64  <DISPLAY VARIABLE>  65 66  <GRAPHICAL VARIABLE>  67  <SUBSCRIPTED VARIABLE>  51  I  <PRIKARY> <EXPRESSION> + <PRIMARY> <EXPRESSION> - <PRIMARY>  <DISPLAY VARIABLE> VARIABLE>  1 <DISPLAY  <MODIFICAriON>  <GRAPHICAL V A R I A B L E > <GRAPHICAL P R I B I T I V E > <LITERAL> <IDENTIFIER> <SUBSCRIPTED V A R I A B L E >  KO  68 69  <INDEX  OB PARABETERS>  70 71  <LITSRAL>  72  : : =<AEITHBETIC ! A R I T H M E T I C  EXPRESSIONS EXPRESSION^  : : = <STRING> 1 <CONVEESION  FUNCTIONHEAD>  CONVERSION  FUNCTIONHEAD>  : : =<CONVERSION  73  CONVERSION  FUNCTIONNAME>  : : = IVALUE  76  <VARIABLE>  ::=  7« 75  77  | |  79  <FUNCTIONHEAD>  : : =<FUNCTIONNAME>  80-  <FUNCTIONNAME>  ::=? XLOC  81 82 83 8U  I | I I  85  I  <HODIFIER>  89 90 91 92 93 9U 95 96 97  99 100 101 102 103 10H  : : «  )  FUNCTIONNAHE>  (  <FONCTIONHEAD>  O I S P L A Y  VARXABLE> )  (  YLOC XSCALE YSCALE ANGLE  SU3SCRIPT <MODIFIEll>  A T <ARGUttENTS>  t | | j I | I |  S C A L E <ARGUKEUTS> ANGLE <ARGUMENTS> ANGLE <ARGUMENTS> ANGLE <ARGUMENTS> FROM <ARGUMENTS> T O <ARGUMENTS> VSYH <ARGUHENTS> HSYM <A3GUM£NTS> <ARGU«ENT  |  <GRAPHICAL  : :=  : : = <MODIFIER> | <MODIFICATION>  <ARGUHENT5>  98  PAEAHETERS>  <NUMBER>  A T T R I B U T E FUNCTION>  88  OR  RVALUE TVALUE  78  <HODIFICATIO»>  r  <IDENTIFIER>  |  86 87  <ARGUMENTS>  < 2> < I N D E X  EXPRESSION>  <ARGUHENTS>  PRIMITIVE>  ' • RAD DEG  <.1> A R G U M E N T  EXPRESSION>  : : = BLANK I 1 I I 1  LINE SQUARE TRIANGLE CIRCLE SCIRCLE  <^ O  105 106  ARGUMENT  107 108 '109 110 111  A R I T H M E T I C  EXPRESSION>  ::= I | |  <TERM> <TERM> <TERM> <ARITH  <(2> A R I T H M E T I C ZXPRESSION> <VARIABLE>  : « |  EXPRESSION>  i I | I  A R I T H M E T I C EXPRESSION> A R I T H M E T I C EXPRESSI0N> <+2> <TERM> <-2> <TERM> • <TERM>  112 113 114 115  <TERM>  116 117 118  <ARITHMETIC  119 120  <SUBSCRIPT  HEAD>  121  <(1>  ::•  (  122  <(2>  ::=  (  123  <(3>  124  <IDENTIFIER1>  <IDENTIFIER>  125  <IDENTIFIER2>'  <IDENTIFIER>  126  <IDENTIPIER3>  <IDENTIFIER>  127  <IDENTIFIER4>  <IDENTIFIER>  128  <+1>  129  <*2>  130  <-1>  131  <-2>  ::=  -  132  <*1>  ::=  *  133  <*2>  ::=  *  134  <,1>  ::=  ,  )  <•!> <-1>  <IER8> <TERS>  * <ARITHMETIC PRIMARX> / <ARITHMETIC PRIMARY> < * 1 > <*2> A R I T H M E T I C P R I M A R X > METIC P R I M A R Y = | |  PRIMAR¥>  -  |  <(3> <ARITHMETIC EXPRESSION> ) <SUBSCRIPT HEAD> A R I T H M E T I C EXPRESSION> <VARIABLE>  <IDENTIFIER1> ( <SUBSCRIPT HEAD> <ARITHMETIC  „ „ „ , . „ „ v  EXPRESSION>  )  ,  (  ::=  + -  H  135  </2>  ,  136  <,3>  137  <ARITHMETIC  ::=  , EXPRESSIONS  A R I T H M E T I C  EXPRESSION>  1  APPENDIX  B  SYNATX SEMANTICS AND SKELETON  SYNTAX FOHTOUT: PROCEDURE(LINEP); DECLARE (LINEP,  /*  SEMANTICS  OUTPUT A FORTRAN  LINE1)  IF LENGTH (LINEP) < 67 DO; O U T P U T (2) = • END; ELSE DO; LINE1 = SUBSTR(LIN LINEP = SUBSTR(LIN O U T P U T (2) = • END; DO F O R E V E R ; • IF LENGTH (LINEP) < DO; OUTPUT(2) = » END; ELSE DO; LINE1 = SUBSTR(L OUTPUT(2) = « END; END; END FORTOUT; REMOVE DECIMAL: PROCEDUHE(SI) D E C L A R E S1  N U M -.=  LANGUAGE  STATEMENT  */  V  THEN 'IILINEP;  RETURN;  EP,0,66); EP,66); ']|LINE1; 67  THEN *« MLINEP;  RETURN;  INEP,0,66); LINEP * » | I L I N E 1 ;  K = LENGTH(S1)-1; IF BYTE (S1,K) = B Y T E ( « . » ) RETURN S1; END REMOVE_DECIMAL;  IF  L I G  CHARACTER;  /* REMOVE CHARACTER; CHARACTER;  ARG_CHECK: /* CHECK P R O C E D U R E (NUM) ; D E C L A R E NUM FIXED;  FOR THE  FOR  DECIMAL  THEN  S1  CORRECT  ARG COUNT THEN CALL ERROR(•NUMBER ARG_COU NT = 0 ; END ARG_CHECK;  «  POINT  SUBSTR(LINEP,66)  FROM  = SUBSTR  NUMBER  END  OF  NUMBER  */  (S1#0,K);  OF ARGUMENTS  OF ARGUMENTS  ;  */  I N C O R R E C T ' , 0) ;  Ch V>0  BESET:  / *  BESET  MODIFIERS  TO  DEFAULT  PROCEDURE;  •,  S C A L E « * 1. , 1 .* ; ANGLE - ' 0 .• ; S U B S C R I P T = «o*: PRCODE = 0; TRANSFORMATION_OBDER • FIRST ENCOUNTER = 1 ; P A R A M E T E R . ( I ) ='0': PARAMETER(2)=*0'; PARAMETER^) ='0'; PARAMETER(U) ='0 ' ; PARAMETER(5)='0« ; PARAMETER(6) ='0': PARAMETERCOUNT=0; END RESET; P R O C E D U R E (SI) DECLARE S1  * /  i .  L O C = '.5,.5';  PAD_8:  VALUES  •-•••< iI  >i• j• : ! • M»:  CHARACTER; CHARACTER;  S1 = SUBSTR ( S l i p RETURN S 1 ; END PAD_8;  '#0,8) ;  EXOUT: /* T O O U T P U T CALLS I N V O L V I N G EXPRESSIONS PROCEDURE(EXCODE,VARTYPE,PRCODE) ; DECLARE (EXCODE,VARTYPE,PRCODE) FIXED; K = EXCODE;  » /  IF PRCODE = 1 THEN DO; O U T P U T (2) " » CALL UNARY(•||UNABY_OP||•)•; K = -K; END; I = LENGTH (VAR(MP))-2; / * T H E M A X I M U M L E N G T H O F AN I N D I V I D U A L ' */ IF I>50 THEN /* STRING I S 50 CHARACTERS */ DO; VAR (MP) = SUBSTR (VAR (MP) ,0,U9) ; I = 5 0 ; END; • PARAMETERLINE=PARAMSTER(1) I!',«||PARAMETER(2)| | I | P A R A M E T E R ( 3 ) || ' . • I ! P A R A M E T E R ( U ) | | * , ' I I P A R A M E T E R ( 5 ) I | I | P A R A M E T E R (6);  DO C A S E I.-/* LINE I ',• LINE LINE LINE LINE EXD; CALL FO END EXOUT;  VARTYPE; C A S E 0: D U M M Y */ = 'CALL PRIMAC I I X N ' , 1SUBSCRIPT||',' | |LOC|I• 1 |TRANSFORMATION ORDER) = ' C A L L P R I M S ( ' 7 IK| I ' » = . ' - C A L L I V A L U E (* | I K I I ' = ' C A L L R V A L U E (• | | K | |• = ' C A L L T V A L U E ('I I K I I' 1  RTOUT (LINE).  CALL  I IVARNAKEI| ' |ISCALE||«,'|IAN3LEI | » , • | | P A R A M E T E R L I N E | |') » ; I I L O C 1 | ' ,' | | V A R ( M P ) | | » M i l l 'I I L O C | | ' I ! V A R ( M P ) | J ' ) ' 5 • | | L O C | | | | V A R (MP) I I ' ) ' ; ' | ! L O C | J ' , ' I I V A R ( M P ) 11 •) •;  ')  RESET;  SYNTHESIZE: PROCEDURE(PRODUCTION NUMBER); DECLARE PR0DUCTI0N_NUM3SR FIXED; DECLARE LABEL STACK(100) CHARACTER, PREVLOC CHARACTER, LP FIXED I N I T I A L (0); D E C L A R E CA RDIJO_ST ACK (100) FIXED; DECLARE STMTNO~FIXED INITIAL (1000); DECLARE (IM_VALUE,NUM_VALUE,VARTYPE,FTYPE) FIXED; DO C A S E /* /*  1:  PRODUCTICN_NUMBER; CASE 0 IS~A DUMMY <PROGRAM>  ::=  <STATES>  */ */  I F M P -.= 2 T H E N DO; CALL ERROR ('EOF AT INVALID POINT',1): CALL STACK_DUMP; END; ' ELSE DO; COMPILING = FALSE; DO; OUTPUT(2) = 'C — MAIN PROGRAM ('!I V E R S I O N t I ' ) ' I F C O N T R O L ( B Y T E {' D ' ) ) THEN V DO; /* 370-VERSION OUTPUT(2) = • INTEGER*2 MSG,IDUMMY'; OUTPUT(2) = ' COMMON MSG,IDUMMY(5147) END; ELSE DO; /* NOVA-VERSION S = «OVSYS»; DO I = 0 T O NO OF S T A T E S : S = S | | « , O V S ' l I S T A T E S ( I ) ; END; O U T P U T (2) = • EXTERNAL 'IIS; OUTPUT(2) = ' COMMON MSG,IDUMKY(5147) « ; OUTPUT(2) = « CALL OVOPN{5,"MAIN.OL",IERR)'; END;  O U T P U T (2)  s * ": DO  *> • TO  CALL  I  =  0  T  =  SUBSTR{'  NO  0?  SYSIN';  STATES; '» 0 , 5 - L E N G T H ( S T A T E S ( I ) ) ) 1 1 S T A T E S ( I ) ;  S a S| | S T A T E S ( I ) I j ' * ; I F C O N T R O L ( B Y T E ( ' D « ) ) *THEN t  0UTPUT(2)  =  T||'  CALL  0UTPUT(2)  =  T|| • C A L L  0DTPUT(2)  =  •  /*  370-VERSION  ELSE DO;  /*  END; OUTPUT END; /* OUTPUT(2) OUTPUT (2) O U T P U T (2) OUTPUT = END; END; /<• 2 : < S T A T E S > /*  3:  (2) OF = = = •*  =  CALL  */  S' | | S T A T E S ( I ) ;  V  <STATE> <STATES>  /«• 4 :  <STATE>  ::=  <STATE  /*  5:  <STATE>  ::=  <FUNCTION  /*  6:  <STATE  IF  LENGTH (VAR(SP))  HEAD>  NOVA-VERSION  OVLOD(5,OVS•|[STATES (I) ||',0,IERR)';  = ' GOTO 1 0 0 ' ; LOOP I */ ' 1 0 0 G O T O (• | | S | | • 1 0 1) . M S G • ; • 101 STOP 98'; • END'; • MAIN PROGRAM GENERATED  ::=•  <STATES>  */  S-\]STATES(I);  ::=  <STATE>  HEAD>  */  : <STATEHENTLIST>  SUBPROGRAM  HEAD>.:  <NUMBER>  */  STATE  < S T A T E ENDING>  <FUNCTION  ;  V  STATEMENTLIST> FUNCTION  DO; =  1 THEN  S='0•||VAR(SP);  E L S E S = VAR ( S P ) ; I P -CONTROL(BYTE(•D«) ) THEN OUTPUT(2) = ' OUTPUT(2) = ' SUBROUTINE S'||S; O U T P U T ( 2 ) = 'C S T A T E ' | | V AR (SP) 1J * I F  CONT R O L ( B Y T E ( ' D ' ) )  THEN  O U T P U T (2)  =  '  OVERLAY  OVS'JIS;  '; INTEGER*2  IDUHMY';  0UTPUT(2) = ' LOGICAL HITON'; I F C O N T R 0 L ( B Y T E ( ! D ' ) ) THEN 0UTPUT(2) = ' COMMON I D U M M Y ( 5 1 4 7 ) ' ; /* 3 7 0 - V E R S I O N ELSE OUTPUT(2) = » COMMON IDUMMY ( 5 1 4 7 ) »; / * N O V A - V E R S I O N STATE_N"JMBER = V A R ( S P ) ; NO O F _ S T A T E S = N O _ O F _ S T A T E S + 1 ; D O ~ I =• 0 T O N O _ O F I S T A T E S 1; I F S T A T E NUMBER = S T A T E S ( I ) THEN . CALL ERROR(•DUPLICATE STATE DECLARATION',1); E N D ; /* OF L O O P I * / S T A T E S ( N 0 _ 0 F S T A T E S ) = S; END; /*  7:  <STATEMENTLIST>  ::=  <STATEMENT>  V  /*  8:  <STATEMENTLIST>  ::=  <STATEMENTLIST>  <STATEMENT>  V  */ */  SUBPROGRAM  EBDING>  /* 9 : < S T A T E E K D I N O : : = E N D S T A T E < V A R I A B L E > */ DO; VAR(SP) = REMOVE DECIMAL (VAR(SP) ) i OUTPUT(2) = « END•; I F L P -.= 0 T H E N DO I = 1 T O L P ; C A L L EF.ROR (' U N M A T C H E D F O R - S T A T E M E N T , L I N E : * I I C A R D N 3 _ S T A C K ( L P ) , 1 ) ; END; IF STATE NUMBER V A R ( S P ) T H E N C A L L E R R O R (' S T A T E N U M B E R «|l STATE~NUMBEH||' AND END-STATE NUMBER •||VAS(SP)|I ' DO NOT M A T C H ' , 0 ) ; LP = 0; DOUBLE_SPACE; CARD COUNT = 0 ; END; := < G R A P H I C A L A S S I G N B E N T > ; */ /* 10: <STATEMENT> = <ATTRIBUTE ASSIGNMENT> ; */ * 11 <STATEMENT> /»  12  <STATEMEUT>  = <NUMERICAL  *  13  <STATEMENT>  =  <DISPLAY  *  14  <STATEMENT>  »  IDENTIFICATION  C O N S T R U C T  ;  V  *  15  <STATEMENT>  =  <STATE-TRANSFER  STATEHENT> J  */  *  16  <STATEMENT>  <CURS0R  /*  17  <STATEMENT>  <ERASE  /*  18  <STATEMENT>  <DRAW  STATEMENT>  ;.  */  *  19  <STATEMENT>  <FILE  STATEMENT>  ;  */  *  20  <STATEMENT>  <READ STATEMENT>  ;  */  /*  21  <STATEMENT>  :  /* OUT /* VAR  2 2 <FUNCTI0N PUT (2)=VAR (MP) 2 3 <FDNCTION SU (M?) = '  SUBPROGRAM  ASSIGNMENT> STATEMENT>  STATEMENT> STATEMENT>  ;  */  ;  */  ;  */  ;  */  */ HEAD>  :: = < F U N C T I 0 N  H E A D I N O  I I' (' I I V A R ( M P P 1 * 1 ) I I ) ' : HEADING> ::= FUNCTION <IDENTIFIER> BROUTINE '||VAR (SP) ;  ( <F0NCTI0N  1  */  PARAMETERLIST>  )  / *  2 4 :  <FUNCTION  PARAMETERLIST  : : » <FD"NCTION  PAEAHETERLIST>  VAR ( B P ) =VAR (MP) 1 | ' , ' J |V A R ( S P ) ; / * 25: <FUNCTION P A R A H E T E R L I S T  <IDENTIFIER2>  / *  ::=  26:  <FUNCTION  SUBPROGRAM ENDING>  RETURN  ,  <XDENTIFXER>  * /  * /  <IOENTIFIER>  * /  DO; O U T P U T (2) = »  RETURN';  O U T P U T (2) = *  . :  E N D ' ;  END;  .  / *  27:  <FUNCTION  STATEMENTLIST  : : =  <FUNCTION  STAIEMENT>  / *  28:  <FUNCTION  ST A T E M E N T L I S T >  ::=  <FUNCTION  S T A T E M E N T L I S T <PUNCTION  / *  29:  <PUNCTION  STATEMENT>  <LINE  / *  30:  <LINE  STATEMENT>  OUTPUT(2)=' / *  31:  CALL  <LINE  32:  CALL  <LINE  / *  33:  CALL  <XYVALUES>  VAR(MP)=VAR(MP) / *  34:  / *  35:  / *  36:  =  ::=  STOP  ARGUMENT  :  =  CALL  <ATTRIBUTE  V  * /  <XYVALUES>  V  <XYVALUES>  * /  ||',11)• ;  EXPRESSION>  ,  <ARGUMENT  EXPRESSI0N>  * /  ;  ASSIGNMENT> : : = <GRAPHICAL ::=  '  ;  | V A R ( S P ) | | ' , 1) • ;  P O I N T ( ' | |VAR(SP)  ::=  <REPLACE>  <XYVALUES>  FORWORD  | | ' , ' | IVAS(SP)  <GRAPHICAL  OUTPUT(2)  ::=.  POINT ('I  STATEMENT  OUTPUT(2) = ' •  START  STATEMENT  STATEMENT  P O I N T (' | | V A R ( S P ) 1 I ' » 0 ) • ;  STATEMENT>  OUTPUT(2) = ' / *  ::=  : :=  V  VARIABLE>  <3BPLACE>  <EXPRESSION>  * /  * / ASSIG ( ' | | V A R N A M E | ] ' , ' | I S U B S C R I P T I |  ASSIGNMENT  : :=  ATTRIBUTE  FUNCTION>  =  ')  ' ;  ARITHMETIC  EXPRESSION>  * /  DO; IF  FTYPE  =  6  THEN  VAR(MP)  =  * 6 , •) | V A R ( M P )  VAR(SP)  =  ' FLOAT C  DO; ;  | | VAR (SP) | |')  ' ;  END; LINE  =  CALL  F O R T O U T ( L I N E) ;  •CALL  CHCHOR ( ' | | L I N E ) | ' , ' I | V A R ( S P )  | | ' ) ' ;  END; / *  37:  <NUMERICAL  OUTPUT(2) / *  38:  =  39:  =  ASSIGNMENT  ::=  •||VAR(MP) | | '  <NUMERICAL  OUTPUT(2) / *  • '  ASSIGNMENT  ::=  • | |VAR(MP) | |'  <DISPLAY  STATSMENT>  : :=  <IDENTIFIER> =  =  A T T R I B U T E  C O R F 1 C M L I N E J I ') SUBSCRIPTED  =  VARIABLE>  C O R F 1 (• | | L I N E I I ' )  DISPLAY  <DISPLAY>  FUNCTION>  * /  ' ; ^ A T T R I B U T E  FUNCTION>  V  •; * /  DO; PARAMETSRLINE=PARAMETER{1) DO  CASE  IM  !|',•|I  PARAMETER(2)  || •,'||PARAMETER(3)  I |  | | P A R A M E T E R ( 4 ) | | | | P A R A M E T E R (5) | | ' , ' I ( P A R A M E T E R ( 6 ) VALUE;  ;  LINE = " C A L L D I S P L (•I I V A R N A M E I I • , ' I I S U B S C R I P T I I ' , ' I | L O C | I ' , • | | S C A L E l |• , • | | A N G L E | | • , « | | T R A N S F O R M A r l O N _ O R D E R | | • , ' | | P A R A M E T E R L I N E | | • ) * ;  DO;  LENGTH(VAR  IP  LINE  =  (SP))>50  'CALL  THEN  VAR ( S P ) » S U B S T R ( V A R ( S P ) , 0 , 5 0 )  JI  "  D I S P S ( ' | | V A R (SP) 1 I * , * I I L O C | | ' , '  | | L E N G T H (VAR  (SP))-2|I•)•;  END; END; CALL  FORTOUT(LINE);  CALL  RESET;  END; <DISPLAY  /«• «0: IF  IM_VALUE  =  STATEM£NT>  ::=  DISPLAY  <DISPLAY>  DO;  . OUTPUT LINE  (2)  «=  «  •  'CALL  CALL  <ARGUMENTS>  ONTO  ('IIVAR  (SP)  .  .  FOKTOUT(LINE);  .  11*) ';  D I S P L (* | | V A R N A M E J | ' , ' J I S U B S C R I P T )  |I S C A L E | | ' » ' | ) A N G L E | CALL  ONTO  THEN  0  I ' » * I I LOCI I ' , '  | ' ) ' ;  CALL  RESET;  END; «1:  <DISPLAY>  / *  HI:  /•  / *  ::=  <DISPLAY  VARIABLE>  * /  <DISPLAY>  ::=  <DISPLAY  VARIABLE>  <MODIFICAriON>  l»3: <DISPLAY>  ::=  <DISPLAY  VARIABLE>"  WITHIN  • */  <AE3UMENTS>  '  * /  DO; • LINE  =  'CALL  WITHIN ( ' | I V A R  (SP) ||')  •;  CALL  END; /*  FORTOUT (LINE) ; ,  IDENTIFICATION  lit:  CONSTSUCT>  <IDENTTFICATION  HEAD>  :  . LP  =  =  *0 ] 1  ' .  <STATEMENTLIST>  DO; OUTPUT(2)  .  • , •  =  |LABEL_STACK(LP) ||'  ,  <ENDING>  * /  .  CONTINUE';  LP-1;  END; / *  U5:  <IDENTIFICATION  DO; LP  =  HEAD>  ::=  =  STHTNOt1;  LABEL_STACK(LP) CARDNO_STACK(LP) VAR(SP)  =  =  STMTNO; =  CARD_COUNT;  PAD 8 ( V A R ( S P ) ) " ;  OUTPUT(2) = • I F (.NOT. LABEL_STACK(LP)! END; / * i » 6 : <E!1DING> : : = END * / <STATE-TRANSFER  HI:  H I T O N (' "  STATEHENT>  11 VAR ( S P ) I I • " ) )  GOTO  STATE  DO; T  =  REMOVE  D E C I M A L (VAR  OUTPUT(2)  =  OUTPUT(2)  =  END:  * /  LP+1;  STMTNO  /*  F O R H I T ON < I D S N I I F I E B >  1  '  CALL  (SP)); CHSTAT  RETURN';  ( ' | J T i I ' ) ';  GOTOO'K  <VARIABLE>  * /  /* 4 8 :  <STATE-TRANSFER  STATEHENT>  GO TO STATE <VABIABLE>  V  DO; T  =  REMOVE  DECIMAL (VAR(SP))  ;  OUTPUT(2)  =  '  CALL  C H S T A T ('  O U T P U T (2)  =  '  RETURN';  1 I T | | •)  ' J  END; / *  49:  <CURSOR  O U T P U T (2) / *  50:  =  / *  CALL  <ERASE  OUTPUT(2) 51:  STATEMENT>  •  =  STATEMENT>  '  CURSOR  ::=  CALL  <DRAW  ::=  ON  * /  •  CRSRON'; ERASE  SCREEN  * /  ERASE';  STATEMENT>  ::=  DRAW  <MODIFICATION>  * /  DO; OUTPUT(2) CALL  =  '  CALL  DRAW ( ' | J  LOC| | ' , • | I SCALE1  J')*;  RESET;  END; / *  52:  <FILE  STATEMENT>  ::=  STORE  <ARGUMENTS>  * /  DO; CALL  ARG  CHECK(2);  O U T P U T (2)  -  •  CALL  53:  STATEMENT>  S T O R E C | |VAR(SP)  | |')  •;  END; / *  <FILE  : :=  RESTORE  <ARGUMENTS>  V  DO; CALL  ARG_CHECK(2);  OUTPUT{2)  =  '  CALL  R E S T O R C | | VAR (SP)  11')  •;  END; / *  54:  <R2AD  OUTPUT(2) / *  55i  =  <READ  OUTPUT(2) / *  56:  =  '  57:  =  ::=  READ  CURSOR  C A L L .RDCRSR ( 1 , * | STATEMENT>  <READ  OUTPUT{2) / *  STATEMENT> '  CALL S T A T EM E N T >  •  CALL  <EXPRESSION>  ::=  : : -  READ  <IDENTIFIER4>  KE?  <IDENTIFIER>  RDCRSR(2,XDUM,YDUfl.•HVAR(SP) ::=  READ  <,3>  <IDENTIFIER>  |VAS (MP+2)| | ' , ' ) | V A R ( S P )  SUBSCRIPT V  * / f | ' ) ' ;  <IDENTIFIER>  R D C P . S H (3 , X D U M , YDUM , M I V AR ( S P ) <PRIMARY>  ||',KDUM)  * /  | | •) » ;  .  DO; CALL  EXOUT(1,V ARTYPE,PRCODE)  ;  END; / *  58:  <EXPRESSION>  ::=  <EXPRESSION>  •  <PRIMABY>  * /  -  <PRIMARY>  * /  DO; VAR  (MP)  CALL  =  VAR (SP)  ;  EXOUT(2,VARTYPE,PRCODE)  ;  END; / *  59:  <EXPRESSION>  ::=  <EXPRESSION>  DO; VAR  (MP)  CALL  =  VAR (SP)  ;  EXOUT(3,VARTYPE,PRCODE);  END; / *  60:  <PRIMARY>  ::=  <DISPLAY  YARIABLE>  / *  61:  <PRIMARY>  ::=  <DISPLAY  VARIADLE>  / *  62:  <DISPLAY  IM_VALUE  =0;  VASIABLE>  ::=  <GRAPUICAL  * /  <MODI7ICAriOX> VARIABLE>  */ * /  •;  /*~63:  O I S P L A Y VARIABLE> : : = <GRAPHICAL PRZMITIVB>  V  DO; VARTYPE «  1;  •IM_VALUE  *  = PAD_8 ( V A R ( B P ) ) ;  VAR(MP)  0;  PARAMETER(1) = ' 0 •;  VARNAH2  SUBSCRIPT  =  »'•*•J|VAR(RP)||; ' 0 ' ;  END; / *  6U:  IB  VALUE  <DISPLAY  / *  65:  VARIABLE>  ::=  <LITERAL>  * /  1;  =i  <GRAPHICAL  VARIABLE>  ::=  <IDENTIFIER>  * /  DO; VARTYPE  =  1;  SUBSCRIPT  =  V A R (MP) ' 0 ' ;  =  P A D _ 8 ( V A R (MP)  ) ; V A R N A M E • ' * • • | | V A R ( H P ) ||* " •J  PARAMETER ( 1 ) = ' 0 ' ;  END; / »  66:  <GRAPHICAL  VARIABLE>  ::=  <SUBSCRIPTED VARIABLE>  * /  VARTYPE=1; /*  67:  <S03SCRIPTED  VARIABLE>  DO; TEMPCH=PAD_8(VAR(MP) ) ; V A R N A M E = • I j T E M P C H I |•« " VAR(MP)=VAR  ( M P ) 1|•  SUBSCRIPTS'  (' I I V A R ( M P P 1 * 1 )  END; /<• 6 8 : DO;  <INDEX  OR  ::=  <IDENTIFIER3>  <(1>  <INDEX  O RPARAMETERS> )  ;  ( ' | | V A R (MPP1*1) ||')  PARAMETERS>  |I•)  •;  't  : : *  ARITHMETIC  EXPRESSIONS  <INDEX OR PARAHETERS>  <,2>  PARA M E T E R C O U N T = P A R A M E T E R C O U N T + 1 ; PARAMETER(PARAMETERCODNT)=VAR(MP) ; END; / * 69: DO;  <INDEX  OS  PARAMETERS>  ::=  <ARITHMETIC  EXPRESSION>  V  PARAMETERCOUNT=PARABETERCO.UNT+1j • PARAMETER(PARAMETERCOUNT)=VAR(MP); END; / *  70:  CLITEBAL>  ::=  <STRING>  V  DO; VARTYPE  "  2;  VAR(MP)  =  " " l | V A R ( M P )  END; / * DO;  71:  E N D CASE ; DO V A R (MP)  END:  | | " " ;  CALL ARG_CHECK(1) ? : =C K (CONVERSION C<ALLILT EAEKAGL_>C H: E 2) ; CALL  ARG_CHECK(2)  ;  VARTYPE; =• V A R ( M P P 1 )  ;  */  FUNCTIONHEAO <ARGUMENTS> )  */  /*  72:  CONVERSION  FUNCTIONHEAD>  : : »  :  CONVERSION  FUNCTIONNAHE>  (  '  /* 7 3 : C O N V E R S I O N F U N C T I O N N A M E > : : » I V A L U E */ VARTYPE = 3 ; /* 7 « : C O N V E R S I O N F U N C T I O N N A N E > : : = R V A L U E */ . V A R T Y P E . = 4; /* 7 5 : C O N V E R S I O N F U N C T I O N N A « E > : : = T V A L U E + / VARTYPE = 5 ; /* 7 6 : < V A R I A B L E > : : = < I D E N T I F I E R > */ /* 7 7 : < V A R I A B L E > : : = < N U M B E R > */ •/* C O N C A T E N A T E A D E C I M A L P O I N T T O N U M B E R */ DO;  K = 0; DO  I = 0 TO  L E N G T H (VAR  (SP))-1;'  I F B Y T E ( V A R ( S P ) , I ) = B Y T E ( ' . * ) T H E N K • 1j END; I F K = 0 T H E N V A R ( S P ) = V A R ( S P ) | |' . * ; END; /* 7 8 : A T T R I B U T E F U N C T I O N > : : = < F U N C T I O N H E A D > < D I S P L A Y LINE = F T Y P E | | ' | | V A R N A M E | | | ] S U B S C R I P T ; /* 7 9 : < F U N C T I O N H E A D > : : = < F U N C T I O N N A M E > ( V / « 8.0: < F U N C T I O N N A M E > ::= X L O C */ FTYPE = 1 ; /* 8 1 : < F U N C T I O N N A M E > : : = Y L O C */ FTYPE = 2 ; /* 8 2 : < F U N C T I O N N A M E > : : = X S C A L E V FTYPE = 3 ; /• 8 3 : < F U N C T I O N N A H E > : : = Y S C A L E */ F T Y P E =U ; /* 8 4 : - < F U N C T I O N N A M E > : : = A N G L E */ F T Y P E = 5; /* 3 5 : < F U N C T I O N N A M E > : : = S U B S C R I P T */ FTYPE = 6 ; /* 8 6 : < M O D I F I C A T I O N > ::= <MODIFIER> V /* 87: <MODIFICATION> : : = < M O D I F I C A T I O N > <MODIFIER> /* 8 8 : < M O D I F I E R > : : = A T < A R G U M E N T S > V DO; C A L L A R G _ C H E C K (2) ; L O C = V A R (SP) ; END; /* 8 9 : < M O D I F I E R > : : = S C A L E < A R G U M E N T S > */  VARIABLE>  * /  )  DO;  IF  ARG COUNT » 1 THEN SCALE » VAR(SP)11'#'1fYAR(SP) ;  ELSE DO; CALL  ARG_CHECK(2);  SCALE  «  YAR(SP);  END; A RG_COUNT =0; IF FIRST_ENCOUNTER THEN T R A N S F O R M A T I O N _ O S D E R » FIRST_ENCOUNTER = 0; END; / * 90: <MODIFIER> ::= ANGLE <ARGUMENTS> V DO; IF F I R S T ENCOUNTER THEN TRANSFORMATION_ORDER » FIRST_ENCOUNTER= 0; A N G L E = VAR (SP) ; END; • /* 91: <MODIFIER> ::= A N G L E < A R G U M E N T S > RAD DO; IF FIRST_ENCOUNTER THEN TRANSFORMATION.ORDEB FIHST_ENCOUNTER ANGLE  =  =  *1• ;  *2';  V «  '2';  0;  VAR(MPP1);  . END; /*  92:  <MODIFIER>  1.7U5329E-2  IS  : : *  ANGLE  <ARGUMENTS>  T H E CONVERSION  DEG;  FACTOR  FROM  THE DEGREES  TO  IBER LDIANS  V  DO; IF  FIRST_ENCOUNTER  FIRST_ENCOUNTER ANGLE  =  THEN  TRANSFORMATION_ORDER  *  ' 2 ' ;  =0;  V A R (MPP.1) ) | * * 1 . 7 4 5 3 2 9 E - 2  1  ;  END; / *  93:  <MODIFIER>  ::=  FROM  <ARGUMENTS>  * /  DO; CALL •  A R G C H E C K (2)  PREVLOC  =  ;  VAR (SP) ;  END; / *  94:  <MODIFIER>  : :=*  T O <ARGUMENTS>  V  DO; CALL  ARG C H E C K ( 2 ) ;  SCALE  =  ANGLE  =  VAR(SP);  LOC =  PREVLOC;  PREVLOC  =  SCALE;  ' - 9 9 9 . ' ;  END; / *  95:  <MODIFIER>  ::=  VSYM  <ARGUMENTS>  * /  DO; UNARY  OP =  '1,'||VAR  (SP);  PRCODE  =  1;  END; / *  96:  <MODIFIER>  ::=  HSYM  <ARGUMENTS>  * /  DO; UNARY  OP =  ' 2 , • | | 7 A R (SP) ;  PRCODE  —0 =1;  END; /*  97:  <ARGUMENTS>  ARG_COUNT  =  1;  ::=  <ARGUMENT  EXPRESSION>  <•/  / *  98:  <A3GUHENTSS  ::=  <ARGUMENTSS  <,1S  <&B60HESI  EXPRESSIONS  * /  DO; ARG_COUNT  =  ARG_COUNT*1;  YAR (UP)  =  VAR(HP)| |«,•||VAR  (SP);  END; / *  99:  <GRAPHICAL  PRIMITIVES  / *  100J  <GRAPHICAL  PRIMITIVES  / *  .101:  <GRAPHICAL  / *  102r  / *  ::=  BLANK  * /  ::'=  LINE  * /  PRIMITIVES  ::=  SQUARE  <GRAPHICAL  PRI«ITIVS>  ::=  TRIANGLE  103:  <GRAPHICAL  PRIMITIVES  ::=  CIRCLE  / *  10t»:  <GRAPHICAL  PRIHITIVE>  ::=  SCIRCLE  / *  105:  <ARGUMENT  EXPRESSIONS  ::=  <(2>  ::='  <VARIABLES  V A R ( K P ) = ' ( ' I | V A R ( M P P 1 ) | I ') ' ; / * 106: <AEGDMENT E X P R E S S I O N S / *  107:  ARITHMETIC  V A R ( M P ) = V A R (MP) / •  108: 109:  * / * /  <ARITHMETIC  EXPRESSION>  )  *>  * /  A R I T H M E T I C EXPRESSION>  <+1S  <TERB>  * /  ::=  <AHITHMETIC  <-1>  <TERH>  V  EXPRESSIONS  ::='  <+2S  <TERMS  * /  EXPRESSIONS  ::=  <-2>  <TERU>  * /  ::=  <TEHM>  ;  EXPRESSION>  | | ' - ' I I V A R ( S P )  <ARITHMETIC  * /  ::=  | | » + ' | | VAR (SP)  <ARITHMETIC  VAR(KP) = V A R ( M P ) / *  EXPRESSION>  * /  EXPRESSIONS  ;  VAR(KP)=•••|IVAH(SP); / *  110:  <ARITHMETIC  V A R ( M P ) = ' - ' | | VAR (SP)  ;  / *  111:  <ARITHMETIC  EXPRESSIONS  / *  112:  <TERM>  ::=  <TERMS  VAR(MP)=VAR(MP)  | I'*  / *  ::=  113:  <TERM>  <TERM>  V A R (MP) = V A R (MP)  | |' / '  / *  ::=  114:  <TERBS  *  <ARITHMETIC  I tVAR(SP)  1  /  <ARITHMETIC  | | **'|IVAR(SP)  / *  115:  <TERM>  ::=  / *  116:  <ARITHMETIC  /+  117:  ('|  VAR ( H P ) = V A R (KP) / *  118:  <*2S  <ARITHMETIC  PRIMARYS  ::=  PRIMARY>  119:  SUBSCRIPT  V A R (MP) = V A R (MP) / *  120:  HEADS  | | ' (*  <SUBSCRIPT  Y A H (MP) = VAR (KP) 121:  <(1>  ::=  '/"  122:  <(2>  ::= (  (  * /  < (3S  . * /  <ARITHBETIC  EXPRESSIONS  )  * /  <SUBSCRIPT  HEAD>  <ARITHBETIC  EXPRESSIONS.)  <VARIABLES  V  ;  ::=  <IDENTIPIER1S  : : =  <SUBSCRIPT  (  * /  ;  HEAD>  | | VAR (MPP1) | | ' , » ;  / *  PRIMARYS  ' ; ::=  V A R ( M P ) = R E M O V E _ D E C I M A L (VAR (MP)) / *  <ARITHMETIC  ||•)';  * / | | VAR (MPP1) | | ')  ARITHMETIC  * /  PRIMARYS  P R I M A R Y S : : *  <ARITHMETIC  PRIMARYS  ;  1  IVAR(MPP1)  * /  ;  <*1S  VAR(MP)=VAR(MP)  VAR(MP)='  PRIBARYS  ;  I |VAR(SP)  <TERM>  * /  * /  V  HEADS  ARITHMETIC  EXPRESSIONS  ,  * /  123:  <(3>  /»  124:  <ID'ENTIPI ER1>  :: =  <IDENTIFIER>  */  /*  125:  <IDENTIFIER2>  :: =  <IDENTIFIER>  */  /*  126:  <IDENTIFIER3>  ::=  <IDENTIFIER>  */  /*  127:  <IDENTIFIER4>  :=  <IDENTIFIER>  V  /*  128:  <*1>  : : = •f  */  /*  129:  <*2>  ::=  */  130:  <-1>  ::=  /*  131:  <-2>  :  :=  -  */  /*  132:  <*1>  J J B  *  */  /*  133:  <*2>  • ; 2  *  V  /*  134:  < , 1>  : :=  *»  */  /*  135:  <,2>  • • B  »•  */  /*  136:  <,3>  J JB  /*  137:  <ARITHHETXC  END; END  {  /*  SYNTHESIZE;  :  */  V EXPRESSIONS  : :«  <ARITHHEriC  APPENDIX  C  LISTING OF TRAMA  77  C C C C C  SUBROUTINE TRAMA[TVAL,1TRANS) T O B U I L D T H E RHANS FORMATION MATRICES I T R A N S = 1 , TO PERFORM S C A L I N G , R O T A T I O N A N D AND TRANSLATION I T R A N S = 2 , TO PEBFORM ROTATION, SCALING AND TRANSLATION R E A L T V A I (6) ,SX ( 2 ) , S Y ( 2 )  C  INITIALIZALLY,  C  VAL (2)= YLOC  TVAI (3)=XSCALE  C C C C  TVAL(1)=XLOC  T V A L (4) = Y S C A L E T V A L (5)= ANGLE IN 5ADINAS TO T E S T I F X S C A L E OR YSCALE I S T O O SMALL IF(TVA1{3).LT0.001,OR.TVAL(4).LT.O.001)STOP S I N A = S I N ( T V A L (5) ) C O S A = C O S ( T V A L (5) ) X L O C - T V A . L (1) Y L O C = T V A L (2)  SX (1)=TVAL (3)  S X (2) =TVA.L ( 4 ) SY ( 1 ) = T V A L ( 4 ) S Y (2) = T V A L ( 3 ) T V A L (1) = C O S A * S X ( 1 ) TVA'L (2) =S.'INA*SX ( I T B A N S ) TVAL(3) =-SINA*SY (ITBANS) T V A L (4) = C O S A * S Y ( 1 ) T V A L (5) = X L O C - 0 . 5 * ( T V A L ( 1 ) +T V A L ( 3 ) ) T V A L {6} = Y L O C - 0 . 5 * ( T V A L ( 2 ) + T V A L ( 4 ) ) RETURN END  15  

Cite

Citation Scheme:

    

Usage Statistics

Country Views Downloads
China 10 19
United States 8 0
France 1 0
Japan 1 0
City Views Downloads
Beijing 9 0
Ashburn 7 0
Shenzhen 1 19
Latham 1 0
Unknown 1 10
Tokyo 1 0

{[{ mDataHeader[type] }]} {[{ month[type] }]} {[{ tData[type] }]}
Download Stats

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0065568/manifest

Comment

Related Items