UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Design and implementation of a high-level language for interactive computer graphics Pieké, Albertus Jacobus 1973

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-UBC_1973_A7 P53_5.pdf [ 3.55MB ]
Metadata
JSON: 831-1.0101250.json
JSON-LD: 831-1.0101250-ld.json
RDF/XML (Pretty): 831-1.0101250-rdf.xml
RDF/JSON: 831-1.0101250-rdf.json
Turtle: 831-1.0101250-turtle.txt
N-Triples: 831-1.0101250-rdf-ntriples.txt
Original Record: 831-1.0101250-source.json
Full Text
831-1.0101250-fulltext.txt
Citation
831-1.0101250.ris

Full Text

DESIGN AND IMPLEMENTATION OF A HIGH-LEVEL LANGUAGE FOR INTERACTIVE COMPUTER GRAPHICS  by  Albertus Jacobus (Bert) Pieke* Diplom i n E.E., ETH-Ziirich 1969  A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE  i n the Department of E l e c t r i c a l Engineering  We accept this thesis as conforming to the required standard  THE UNIVERSITY OF BRITISH COLUMBIA  July 1973  In p r e s e n t i n g an the  in partial  advanced degree a t t h e U n i v e r s i t y Library  I further for  this thesis  shall  f u l f i l m e n t o f the requirements f o r of British  make i t f r e e l y a v a i l a b l e  agree that  permission  Columbia,  f o rreference  I agree  that  and s t u d y .  f o r extensive copying of t h i s  thesis  s c h o l a r l y p u r p o s e s may b e g r a n t e d b y t h e Head o f my D e p a r t m e n t o r  by  h i s representatives.  of  this thesis  written  I t i s understood that  f o r f i n a n c i a l gain  shall  copying or p u b l i c a t i o n  n o t be a l l o w e d w i t h o u t  permission.  Department o f  ^L€y>.  The U n i v e r s i t y o f B r i t i s h Vancouver 8, Canada  C A L Columbia  /€AJ<S-IM^B^T/iC-  my  ABSTRACT  The design and implementation language IGL i s described.  of the i n t e r a c t i v e graphics  This language not only allows the d e f i n i t i o n  and display of l i n e drawings but also has f u l l f a c i l i t i e s f o r manipulating, naming, i d e n t i f y i n g and i n t e r a c t i n g with such drawings.  The l a n -  guage has been implemented as an extension to Fortran IV using the XPL compiler generator system.  The experience gained so f a r i n the use of  the language has already proven a number of advantages over present-day graphics systems. high-level  The language i s r e a d i l y learned by users with previous  language experience.  As no extensive t e s t i n g and documenta-  tion i s necessary due to the r e a d a b i l i t y of the program, the time r e quired f o r the completion of a project i s greatly  i  reduced.  TABLE OF CONTENTS Page  ABSTRACT  i  TABLE OF CONTENTS  i i  LIST OF FIGURES  i i i  ACKNOWLEDGEMENT  iv  1.  INTRODUCTION  1  2.  COMPUTER GRAPHICS, A SHORT SURVEY  3  3.  GRAPHIC LANGUAGES  6  4.  THE LANGUAGE IGL  10  5.  IGLCOM, AN IGL COMPILER  19  6.  IGLRUNLIB, AN IGL RUNTIME LIBRARY  21  7.  IMPLEMENTATION OF IGL ON A DATA GENERAL  SUPERNOVA  MINI COMPUTER  29  8.  EXPERIENCE WITH THE IMPLEMENTED IGL SYSTEM  35  9.  BIBLIOGRAPHY  36  REFERENCES  37  APPENDICES: A  IGL u s e r s ' guide  40  B  Illustrations  58  C  Listings:  D  Device Dependent Support R o u t i n e s  from IGL programs  IGL-Syntax,  ii  IGLCOM  . .  62 73  LIST OF FIGURES  Page  1  Sample IGL program.  16  2  Display algorithm  26  iii  ACKNOWLEDGEMENT  The and  a l s o Dr.  a u t h o r wishes to thank h i s s u p e r v i s o r , Dr.  G.F.  Schrack  F. Nake ( f o r m e r l y of the Dept. of Computer S c i e n c e ,  for their interest, this research.  a d v i c e , and  encouragement throughout the p e r i o d  Thanks are a l s o due  the p e o p l e i n t h i s department who i n i t i a l stages  and  U.B.C.)  f o r the many h e l p f u l s u g g e s t i o n s  have used the IGL  by  language i n i t s  to Miss Norma Duggan f o r t y p i n g the t h e s i s .  F i n a n c i a l support  f o r t h i s r e s e a r c h was  p r o v i d e d by  the  N a t i o n a l Research C o u n c i l of Canada as a Research A s s i s t a n t s h i p and B u r s a r y to the  of  author.  iv  a  1.  INTRODUCTION  Over the l a s t y e a r s , an i n c r e a s i n g need has been f e l t  i n the  E l e c t r i c a l E n g i n e e r i n g Department at t h i s U n i v e r s i t y f o r a computer facility  t o permit A first  w r i t t e n to enable  computer a i d e d d e s i g n . attempt was  made i n the summer o f 1970.  A program  a user to e n t e r the t o p o l o g y of an e l e c t r o n i c  diagram t o a PDP-9 computer, u s i n g a d i s p l a y s c r e e n and l i g h t communication i n t e r f a c e  [19].  T h i s program had  f e a t u r e s such  as an e l e g a n t windowing f a c i l i t y  of  I t was  elements.  proved  circuit  pen  as  a number of  remarkable  and automatic  labelling  r e a s o n a b l y w e l l documented and  t e s t e d and y e t  to be l e s s u s e f u l than hoped f o r . The  reason was  simple.  some i n c o n s i s t e n c i e s s t i l l  Some a d d i t i o n a l  e x i s t e d and  l y s i s program had not been i n c l u d e d . program and in  was  assembler  the a u t h o r was and was  no  the i n t e r f a c i n g t o a c i r c u i t So changes had  longer a v a i l a b l e .  q u i t e complex.  f e a t u r e s were needed,  The  to be made to the  The program was  the programming t e c h n i q u e s used  c o n s i d e r a b l e and  never  T h i s example shows c l e a r l y  written  e f f o r t needed f o r somebody  e l s e to f a m i l i a r i z e h i m s e l f w i t h the p r o j e c t was  ana-  was  completed.  t h a t the d e s i g n of complex  software  systems s h o u l d o c c u r on a more g e n e r a l l e v e l i f the systems are t o be used by many d i f f e r e n t users and i f they are to be expandable to f u t u r e needs.  T h i s i s p a r t i c u a r l y t r u e i n a u n i v e r s i t y environment where a 1  r e g u l a r t u r n o v e r of s t u d e n t s u s i n g and u p d a t i n g an e x i s t i n g system  takes  place. T h i s t h e s i s d e s c r i b e s , a f t e r an i n t r o d u c t i o n to the f i e l d computer g r a p h i c s , the d e s i g n and  implementation  1  of a h i g h - l e v e l  of  2  language for i n t e r a c t i v e graphics, the r e s u l t i n g graphics system, and the experience gained with i t .  3  2.  COMPUTER GRAPHICS, A SHORT SURVEY  Interactive computers.  techniques  a r e w i d e l y used i n problem s o l v i n g by  The purpose o f these t e c h n i q u e s i s t o make e f f i c i e n t use  o f b o t h man and machine.  The computer i s used  t o c a r r y o u t those a c t i o n s  t h a t can be s p e c i f i e d i n advance and human r e a s o n i n g i s c a l l e d upon t o direct  the course o f those a c t i o n s .  have a c l e a r u n d e r s t a n d i n g  To be a b l e t o do t h i s ,  o f the s t a t e o f h i s computations  the u s e r must and he  must have a means o f i n d i c a t i n g h i s commands t o the computer.  A graphics  d i s p l a y p r o v i d e s a n a t u r a l way o f communicating i n f o r m a t i o n t o the u s e r . Lihe  :  drawings and graphs are much e a s i e r understood  bers.  A l s o a g r a p h i c a l i n p u t d e v i c e such  than t a b l e s o f num-  as a l i g h t pen o r j o y s t i c k  a l l o w s the user t o t r a n s m i t h i s wishes w i t h a maximum of c o n v e n i e n c e . T h i s k i n d o f i n t e r a c t i v e computing i s c a l l e d i n t e r a c t i v e computer g r a phics. The e a r l i e s t attempt  a t computer g r a p h i c s was made i n 1962  when Ivan S u t h e r l a n d implemented the now famous "Sketchpad" the TX-2 computer a t L i n c o l n L a b o r a t o r y  a t MIT [20].  system on  The p u b l i c a t i o n  of h i s work t r i g g e r e d r e s e a r c h i n t h i s f i e l d by many o t h e r s and l e d companies•like  G e n e r a l Motors, Boeing  and Lockheed t o s e t up g r a p h i c s  systems f o r computer a i d e d d e s i g n (CAD) All  [18].  these systems used e x p e n s i v e  the IBM 2250) and r e q u i r e d a  huge  d i s p l a y t e r m i n a l s (such as  computer t o monitor  the i n t e r a c t i o n .  T h e i r c o s t e f f e c t i v e n e s s has been h i g h l y d i s p u t e d and the economic dec l i n e i n the aerospace  i n d u s t r y has caused  the development o f many new  CAD p r o j e c t s t o be abandoned. In the meantime, a new g e n e r a t i o n o f computer hardware has  A  appeared  and w i t h i t many new concepts  i n computer s o f t w a r e  h i g h c o s t o f computer g r a p h i c s had been determined  [2].  The  by two f a c t o r s :  - the h i g h c o s t o f the t e r m i n a l and main computer hardware - the h i g h c o s t o f d e v e l o p i n g the n e c e s s a r y programs. The  c o s t o f computer hardware has d e c r e a s e d s h a r p l y o v e r the l a s t  and  the a v a i l a b i l i t y o f m i n i computers and t i m e - s h a r i n g systems has  f u r t h e r reduced  the c o s t o f i n t e r a c t i v e computing.  p l a y s have e l i m i n a t e d the n e c e s s i t y o f c o n t i n u o u s d i s p l a y s c r e e n and thereby made e c o n o m i c a l  Storage  tube  decade  dis-  r e f r e s h i n g o f the  t e r m i n a l s f o r computer  graphics a r e a l i t y . A g r e a t e f f o r t has been made t o match t h i s p r o g r e s s i n h a r d ware w i t h a s i m i l a r c o s t c u t t i n g p r o g r e s s i n s o f t w a r e .  As the hardware  gets l e s s e x p e n s i v e , the software development c o s t s a r e becoming an e v e r more dominating  f a c t o r i n any v e r s a t i l e  computer system.  p r e v i o u s approach where a l l s o f t w a r e was w r i t t e n i n assembly f o r maximum runtime  that  t o w r i t e h i s programs w i t h a maximum o f programming time  A number o f s p e c i a l purpose literature as easy  language  e f f i c i e n c y i s now b e i n g o v e r t a k e n by an e f f o r t t o  p r o v i d e the programmer w i t h easy t o use computer languages him  The  t h a t attempt  languages  have r e c e n t l y appeared  enable  efficiency. i n the  to make the programming o f g r a p h i c s a p p l i c a t i o n s  f o r the programmer as programming n u m e r i c a l programs i n con-  v e n t i o n a l a l g o r i t h m i c languages  such as F o r t r a n and A l g o l .  The f i r s t  " G r a p h i c Languages" were p u b l i s h e d i n 1968 [5,10,13] and the development of such languages  has s i n c e been the s u b j e c t o f a s p e c i a l  conference  [8]. The  advantage o f a p o w e r f u l g r a p h i c language  a l l o w s the u s e r o f a g r a p h i c s system  i s obvious.  It  t o w r i t e the programs n e c e s s a r y  5  for h i s s p e c i a l application himself.  He  can experiment  w i t h i d e a s and  make changes t o h i s programs w i t h o u t h a v i n g to r e l y on a programmer t o do t h i s work f o r him. sible  f o r h i s own  Thus he has  c o n t r o l over and can be made r e s p o n -  g r a p h i c s programs.  What i s e q u a l l y i m p o r t a n t i s the  r e a d a b i l i t y o f programs w r i t t e n i n g r a p h i c languages. duces the t e s t i n g and  documentation  time c o n s i d e r a b l y , b u t (as most  programs u s u a l l y end up w i t h inadequate  documentation)  to be made to the program by c o n s u l t i n g j u s t a program The n e x t c h a p t e r w i l l and attempt  I t not o n l y r e -  i t a l l o w s changes listing.  d e s c r i b e the n a t u r e o f g r a p h i c  languages  to i d e n t i f y some o f the p o i n t s t h a t are important t o a p p l i -  c a t i o n s i n computer a i d e d d e s i g n .  6  3.  The pictures,  GRAPHIC LANGUAGES  v a r i a b l e s i n g r a p h i c languages t h a t are m a n i p u l a t e d  two-dimensional s t r u c t u r e s .  One  are  of the most d i f f i c u l t  pro-  blems i n computer g r a p h i c s i s to f i n d a c o n c i s e d e s c r i p t i o n f o r such pictures.  Even the s i m p l e s t o f two-dimensional drawings c o n t a i n s  g r e a t amount of i m p l i c i t i n f o r m a t i o n . of o n l y two and  lines  For example, a drawing c o n s i s t i n g  c o n t a i n s i n f o r m a t i o n about the l e n g t h s , the p o s i t i o n s ,  the angles o f the l i n e s r e l a t i v e t o a frame of r e f e r e n c e and  to each o t h e r ; a l s o whether they are s o l i d , etc.  The  more c o m p l i c a t e d  p i c t u r e s are c o n s i d e r e d  d o t t e d , dashed,  to i n c l u d e g r e y - l e v e l s and  will  3.1  for processing.  To  simplify  r e c o g n i t i o n , of  l i n e drawings c o n s i s t i n g o f  thickness.  Primitives The  p r i m i t i v e s o f a language are  language t h a t can be broken down no real,  raster sizes,  l o o k at o n l y g e n e r a t i o n , not  c o n s i d e r a l l p i c t u r e s to be  s o l i d l i n e s of equal  intersecting,  Even more c o n f u s i n g i s the case where  common f a c t o r s where p i c t u r e s are d i g i t i z e d the d e s c r i p t i o n , we  relative  the drawing, the g r e a t e r the amount of such  i m p l i c i t i n f o r m a t i o n becomes.  p i c t u r e s and  a  i n t e g e r , and l o g i c a l  the c o n s t a n t s  further.  d e f i n e d i n the  In F o r t r a n these  are  the  c o n s t a n t s , i n a g r a p h i c language they a r e  b a s i c p i c t u r e constants.  L i n e drawings c o n s i s t of l i n e s , o r r a t h e r  segments.  t r e a t e d e i t h e r as a l i n e segment o f l e n g t h  The  dot  can be  zero o r as a s p e c i a l  the line  symbol.  D e f i n i n g o n l y DOT language i s s u f f i c i e n t , but  and LINE as  the p r i m i t i v e s o f a g r a p h i c  t r e a t i n g p i c t u r e s d i r e c t l y at t h i s p r i m i t i v e  l e v e l i s r a t h e r bothersome and  so u s u a l l y some a d d i t i o n a l p r i m i t i v e s  7  are d e f i n e d i n the language as a h e l p f o r the programmer. c o n s i s t of elementary  geometric  CIRCLE, TRIANGLE, ARC,  etc.  The  symbols l i k e :  DOT,  A set could  LINE, SQUARE,  r e p r e s e n t a t i o n of the numbers and  the  c h a r a c t e r s o f the a l p h a b e t are a l s o o f t e n d e f i n e d i n the language as picture primitives. may  be i n c l u d e d .  3.2  Operators The  manipulations  Depending on the d i s p l a y hardware o t h e r c h a r a c t e r s  o p e r a t o r s o f a language are the symbols t h a t s t a n d f o r to be performed  complete u n d e r s t a n d i n g  t r o u b l e , as we  constants.  o f p i c t u r e s becomes e v i d e n t .  d e f i n e b a s i c mathematical without  on v a r i a b l e s and  o p e r a t o r s l i k e +,  We  Here our i n -  are a b l e to  -, * f o r m a n i p u l a t i n g numbers  are so f a m i l i a r w i t h u s i n g these symbols i n c a l -  c u l u s where they are w e l l d e f i n e d .  A b a s i c s e t of o p e r a t o r s f o r p i c t u r e s ,  however, i s not as e a s i l y e x t r a c t e d from geometry, the d i s c i p l i n e which s t u d i e s m a n i p u l a t i o n o f two  mathematical  dimensional  structures.  Even i n c l u d i n g o t h e r r e l e v a n t d i s c i p l i n e s , as Graph Theory and Theory, does n o t b r i n g us much c l o s e r t o u n d e r s t a n d i n g Research  Set  pictures yet.  i s b e i n g done i n t h i s d i r e c t i o n , however [ 8 ] . The e a s i e s t way  o f f i n d i n g a u s e f u l s e t of o p e r a t o r s i s by  comparing e x i s t i n g g r a p h i c languages desirable.  As an example  we  and p i c k i n g out  f e a t u r e s t h a t seem  s h a l l c o n s i d e r the p r o c e s s o f b u i l d i n g  up  pictures: One  o p e r a t o r s h o u l d a l l o w us to add subimages t o g e t h e r to form a  picture.  T h i s o p e r a t i o n can be  done as a s u p e r p o s i t i o n of  p i c t u r e s o r as a c o n c a t e n a t i o n o f two (a)  two  pictures.  In the case of s u p e r p o s i t i o n some c o o r d i n a t e system must be known  8  f o r both s u b p i c t u r e s . to be  In the  and  involves  the p i c t u r e s must c o n t a i n some s p e c i a l l y  p o i n t s a t which they can be  to c o n s i d e r i n g each s u b p i c t u r e  "tail"  subpicture  frames,  case o f c o n c a t e n a t i o n ,  designated leads  to c o n s i d e r i n g each  d e f i n e d i n a "frame" [10],and s u p e r p o s i t i o n  s u p e r i m p o s i n g the two b)  This leads  concatenating  j o i n e d together.  as h a v i n g  p i c t u r e s head to t a i l  This  a "head" and only  a  [13].  Both approaches have t h e i r l i m i t a t i o n s , i n (a) i t i s d i f f i c u l t t o keep t r a c k o f what i s now is  l i m i t e d to one  head and  Further  connected to what and  one  operators  i n (b) each  subpicture  tail.  should  a l l o w us  to d e l e t e p i c t u r e s o r  parts  o f p i c t u r e s , t o move p i c t u r e s , to s c a l e p i c t u r e s and maybe to d i s p l a y pictures. for  As no  arithmetic operators,  d e l e t i n g , seem to apply  forms of m a n i p u l a t i o n  apart  from + f o r a d d i n g and  to p i c t u r e s i n a n a t u r a l manner, most  are d e s c r i b e d  as  functions.  G i v i n g these  other  func-  t i o n s mnemonic names makes them easy to remember. Examples: SCALE, MOVE TO, or b u i l t  ROTATE, WINDOW, DISPLAY  i n constraints l i k e : PARALLEL, VERTICAL, POINT ON  3.3  ...  LINE  ...  Assignments In b u i l d i n g p i c t u r e s i t must be p o s s i b l e to g i v e names to  subpictures,  i n order  cated p i c t u r e s . one way  these names f o r b u i l d i n g up more  compli-  Most languages i n c l u d e the assignment statement i n  or another.  ments (=,  to use  : = , •«-) .  o r i e n t e d approach.  The  symbol used i s the same as i n a r i t h m e t i c  Some p u b l i s h e d Instead  languages use  assign-  i n s t e a d a procedure  of a s s i g n i n g a p i c t o r i a l  expression  9  to a v a r i a b l e ,  they a s s i g n a procedure  to a v a r i a b l e .  This  procedure  i s executed whenever the v a r i a b l e i s r e f e r e n c e d i n the program and causes  the c o r r e s p o n d i n g p i c t u r e  to be drawn.  The d e c i s i o n f o r o r  a g a i n s t d i s p l a y p r o c e d u r e s w i l l most l i k e l y be i n f l u e n c e d s t r o n g l y by programming language  a v a i l a b l e f o r the i m p l e m e n t a t i o n .  languages such as E u l e r have been used s u c c e s f u l l y languages  Procedure  [4,6],  The  reason t h a t  oriented  for designing graphic  [16] and s i m i l a r r e s u l t s have been a c h i e v e d u s i n g APL  APL-like structures  the  and  the language used f o r the  im-  p l e m e n t a t i o n shows through so s t r o n g l y i n the d e s i g n o f a g r a p h i c language is  the  following. The  c r e a t i o n o f a complete, v e r s a t i l e  be a huge t a s k i f c a r r i e d out from b a s i c s . language  computer language  can  However, i f the g r a p h i c  i s d e f i n e d as an e x t e n t i o n o f an e x i s t i n g a l g o r i t h m i c  language,  o n l y those c o n s t a n t s , o p e r a t o r s , and f u n c t i o n s t h a t are n o t a l r e a d y a v a i l a b l e need  to be i n c l u d e d .  F e a t u r e s such as, e.g. b r a n c h i n g , c o n d i t i o n a l  and a r i t h m e t i c statements and  the complete  I/O h a n d l i n g f a c i l i t y  be used d i r e c t l y as d e f i n e d i n the a l g o r i t h m i c language which now the p l a c e o f " h o s t - l a n g u a g e " f o r the g r a p h i c s language. program i s r e a l l y  can takes  Thus a g r a p h i c s  a mixture o f g r a p h i c s s t a t e m e n t s and h o s t - l a n g u a g e  statements, and the d e s i g n e r o f such a language w i l l graphics syntax d e f i n i t i o n s of the h o s t - l a n g u a g e .  u s u a l l y choose h i s  to f i t i n w i t h the o v e r a l l s y n t a x s t r u c t u r e  10  4.  The  THE LANGUAGE IGL  acronym IGL stands f o r I n t e r a c t i v e G r a p h i c s Language,  a computer language  f o r h a n d l i n g l i n e drawings.  a l l o w s the d e f i n i t i o n and d i s p l a y o f l i n e facilities  drawings  b u t a l s o has f u l l  f o r m a n i p u l a t i n g , naming, i d e n t i f y i n g and i n t e r a c t i n g w i t h  such drawings. drawing  T h i s language n o t o n l y  Through  the use o f windowing t e c h n i q u e s , p a r t s o f the  can be m a g n i f i e d f o r c l o s e r i n s p e c t i o n o r s c a l e d down f o r  greater display density. r e s t o r i n g drawings  Commands a r e f u r t h e r p r o v i d e d f o r s a v i n g and  on secondary s t o r a g e .  An a p p l i c a t i o n s program w r i t t e n i n IGL appears of  statements  t o be a m i x t u r e  f o r g r a p h i c a l m a n i p u l a t i o n s and h o s t - l a n g u a g e  statements.  The d i s t i n c t i o n between the two i s made on a c a r d - b y - c a r d b a s i s , the g r a p h i c a l statements h a v i n g a s p e c i a l c h a r a c t e r (*) i n the f i r s t  column  of  a  each  card.  The c o m p i l a t i o n i s executed i n two s t a g e s :  first  c o m p i l a t i o n from IGL i n t o h o s t - l a n g u a g e , s e c o n d l y a c o m p i l a t i o n o f the h o s t - l a n g u a g e i n t o machine  language.  Because o f i t s widespread use and s u p p o r t , F o r t r a n IV was chosen b o t h as h o s t - l a n g u a g e the  f o r IGL and as programming language f o r  r o u t i n e s i n the IGL runtime l i b r a r y .  p r o v i d e s almost complete p o r t a b i l i t y to 4.1  T h i s one-language  from one computer  approach  installation  another. Syntax The  g r a p h i c a l a s p e c t s o f the s y n t a x o f IGL a r e based on the  work o f F. Nake [14].  In a d d i t i o n t o e x i s t i n g  v a r i a b l e s i n the host-language IMAGE i s i n t r o d u c e d .  types o f c o n s t a n t s and  (e.g. i n t e g e r , r e a l , e t c . ) ,  Image c o n s t a n t s a r e e i t h e r elements  t h e new type from the s e t  11  {BLANK, DOT, LINE, SQUARE, TRIANGLE, CIRCLE, HALFCIRCLE} o r s t r i n g s o f literals aid  (keyboard c h a r a c t e r s ) .  Image v a r i a b l e s a r e d e f i n e d w i t h t h e  o f the image assignment o p e r a t i o n  (:=) by image e x p r e s s i o n s which  are s t r i n g s o f image constants and/or v a r i a b l e s j o i n e d by d i a d i c image operators.  Image c o n s t a n t s and v a r i a b l e s a r e i n i t i a l l y  u n i t square.as  BLANK  defined  on t h e  follows:  LINE  DOT  SQUARE TRIANGLE CIRCLE HCIRCLE  For each use o f an image v a r i a b l e , a set. o f a t t r i b u t e s i s a t t a c h e d defining  coordinates,  s c a l e , and angle o f r o t a t i o n o f t h e p i c t u r e w h i c h  the v a r i a b l e r e p r e s e n t s . use  These a t t r i b u t e s can be r e d e f i n e d w i t h the  o f unary image o p e r a t o r s ,  hence a f f i n e t r a n s f o r m a t i o n s  t r a n s l a t i o n , s c a l i n g , r o t a t i o n and m i r r o r i n g For i l l u s t r a t i o n , define *  HR:= LINE FROM 0,.5  *  + LINE FROM .425,1 TO .5,0;  *  R:= HR + HR VSYM .5;  + (superposition).  can be a p p l i e d .  the f o l l o w i n g image assignment statements  an image v a r i a b l e to r e p r e s e n t  The r i g h t hand s i d e s  the symbol " r e s i s t o r " .  TO .4,.5 + LINE FROM .4,.5 TO  with  .425,1  o f both statements employ the d i a d i c image o p e r a t o r The f i r s t , statement d e f i n e s  a temporary image v a r i a b l e  HR by superimposing the image c o n s t a n t LINE t h r e e modified  such as  t i m e s , each  time  the image o p e r a t o r FROM ... TO ... i n the d e s i r e d  manner.  12  R  HR  The  second statement  and  the r e f l e c t i o n  the symbol  d e f i n e s the v a r i a b l e R as a s u p e r p o s i t i o n of  of HR  on the v e r t i c a l a t x =  .5, thus  numeric c o n s t a n t s but Therefore,  ment statements i n loops.  completing  "resistor". The numeric operands o f image o p e r a t o r s may  well.  be n o t  only  can be n u m e r i c a l v a r i a b l e s of the h o s t - l a n g u a g e  c o m p l i c a t e d p i c t u r e s can be  imbedded i n statements  o f the h o s t language,  e.g.  F o r example, the f o l l o w i n g program p o r t i o n :  SC =  2.*S  ALPHA =  PI/A.  BRIDGE:= BLANK; DO  100  I = 1, A  XI = .5 + S * SIN(ALPHA) Yl =  .5 - S * COS(ALPHA)  *  BRIDGE:= BRIDGE + R AT X I , Y l SCALE S C , . l ANGLE ALPHA;  100  ALPHA = ALPHA +  *  DISPLAY BRIDGE;  would d i s p l a y a r e s i s t o r  PI/2.  bridge:  as  d e f i n e d w i t h image a s s i g n -  S = .25*SQRT(2.)  *  HR  13  The of  facilities  d e s c r i b e d above a l l o w the  items c a l l e d image v a r i a b l e s .  additional  facility  that do not circuit set of  most a p p l i c a t i o n s ,  i s needed to group i n t o  necessarily  diagram.  For  At  look a l i k e .  first  i d e n t i c a l symbols.  creation  As  glance i t may  an example c o n s i d e r an seem to be  A closer  e x a m i n a t i o n , however, shows t h a t the. l e a d s o f  from one  another.  are  p r o p e r t i e s of  and  must be  scripted  taken i n t o  names are  f o r m a t i o n s of one set.  account.  as  the the  natively, be  of  second and length of  another, but  the  first  t h a t are  the  l e a d s and  individual  the  whether they are  not  syntax.  necessarily  thus be  resistors,  named RESISTOR (I) r e g a r d l e s s o f  the  Subscripted  affine the  capacitors etc.  l e n g t h of  label  sub-  in a  trans-  same  named, e.g.,  i f t h i s d i s t i n c t i o n i s important, a l l r e s i s t o r s  differ  resistors  l o g i c a l l y members o f can  a  have  labels  A second c a t e g o r y of v a r i a b l e s ,  items that are  limited  places i n  t h a t the  i s t h e r e f o r e d e f i n e d i n the  names o f  a  d u p l i c a t e s o f each o t h e r .  r e p r e s e n t i n g the  A l l network elements i n a c i r c u i t  regardless  can  pictures  image v a r i a b l e s ,  variables  l e a d s of  Such d e t a i l s the  seem to be  electronic  composed o f  two  l e n g t h s than the  an  l o g i c a l g r o u p i n g s , items  circuit,  different  may  naming  however,  A p a r t from b e i n g i n d i f f e r e n t  r e s i s t o r s , e.g.,  and  ELEMENT(I) Altercircuit  t h e i r leads  or  14  the  letters in their label.  Example: *  RESISTOR ( 3 ) : = R AT  *  LEAD FROM X3,Y3  *  CIRCUIT:=  The  X,Y  TO  SCALE S l +.LEAD FROM X I , Y l  . X4 ,Y4  +  function  containing For  the  AT  X2,Y2 +  X5,Y5 + VALUE(3) AT  X6,Y6;  CIRCUIT + RESISTOR(3);  VALUE, used i n t h i s example, a l l o w s the  of an i n t e g e r v a l u e to an image v a l u e . a variable  'R'  TO  A similar function,  conversion  TEXT, a c c e p t s  a text s t r i n g for conversion.  a more d e t a i l e d d e s c r i p t i o n of the  r e a d e r i s r e f e r r e d to the  IGL  IGL  s y n t a x and  Users' Guide i n Appendix A o f  semantics, this  thesis. 4.2  Interaction Describing  o f the  i n t e r a c t i v e p r o c e s s means d e f i n i n g  system to each i n p u t .  type o f i n p u t , but occurred. state  the  W.H.  a l s o on  The  the  s t a t e of the  Newman [15] has  automaton where the  program as w e l l as by  the  response i s not  only  response i s determined by action.  The  actions  are  The  i n t e r a c t i o n i s then b e s t d e s c r i b e d  diagram, which i s used as a guide when w r i t i n g tate  t h i s p r o c e s s , the  tween the This [1].  state  diagram n o t a t i o n  a s p e c t of the The  s y n t a x of IGL and  IGL-system i s b a s e d on  program i s d i v i d e d  s t a t e of  inputs are  i n the  the  formulation  input finite-  auto-  outputs.  form o f a To  state  facili-  correspondence i n the  the  the  to the  the program.  allows a close the  time the  system as a  the  maton, which cause i t to change i t s s t a t e ; r e a c t i o n s  response  dependent on  system at the  p r o p o s e d to t r e a t the  the  be-  program.  the work o f P. B o u l l i e r e t a l .  i n t o s t a t e s which c o r r e s p o n d t o the  states  15  i n the diagram.  For each i n p u t  a d e c i s i o n i s made w i t h i n the s t a t e i s to be The  For an i l l u s t r a t i o n ,  d i v i s i o n into states also provides  i n s t a l l a t i o n s with  see  Figure  core s t o r a g e  i n g r e a t e r d e t a i l i n Chapter 7.  t i o n e d by  to t u r n on the  the user w i t h  the u s e r , variable:  signalling  Control state-  of some g r a p h i c a l i n p u t  o r l i g h t pen)  t h a t he has  and  chosen an i t e m on  screen.  the s c r e e n .  This s u b s c r i p t allows at by  with  sequence:  the program.  For example the  DISPLAY 'IDENTIFY RESISTOR TO . CURSOR ON;  *  device  posi-  such  FOR  HIT  ON  would prompt the user  WAIT FOR RESISTOR:  as  to d e t e c t an i n t e r r u p t from  to r e f e r to items t h a t are p o i n t e d  *  displayed  A special  IHIT i s used i n the program to i n d i c a t e the s u b s c r i p t o f  i t e m l a s t i d e n t i f i e d on the  *  computer  c u r s o r or c r o s s - h a i r s (which can be  the h e l p  a j o y - s t i c k , tracker b a l l  1.  f o r the e n t i r e program,  ments are d e f i n e d i n the language to a l l o w v a r i a b l e s to be on the s c r e e n ,  screen)  a p h y s i c a l segmentation  used f o r p a g i n g or o v e r l a y i n g a t  insufficient  discussed  the  c u r r e n t s t a t e of the program as t o which  executed n e x t .  of the program which can be  t h i s w i l l be  (e.g. a h i t on a menu symbol on  the u s e r when he  BE DELETED' AT  the  the programmer is interacting  .2,.9;  INTERRUPT; CIRCUIT:= CIRCUIT - RESISTOR  to s e l e c t the r e s i s t o r to be  d e l e t e d and  (IHIT); would  execute the d e l e t i o n . 4.3  Semantics and The  library  Data  Structure  semantics are d e f i n e d i n the  r o u t i n e s i n the  t h a t p e r f o r m the a c t i o n s s p e c i f i e d by  the program.  The  o f the e x e c u t i o n  c o n t r o l and and  the  the statements w r i t t e n i n  i n t e r a c t i o n routines affect  communication w i t h  runtime  the g r a p h i c s  the  sequence  terminal,  16  Fig. 1  Sample IGL program  * STATE 15 C C — » DEFINE ELEMENTS AND MENUSYMBQLS C * ?«  C f»«'cAPACITOR * HALFC LEAD t LINE FROM , 4 , 0 TO , 4 , t ? * C »s HALFC + HALFC VSYM , 5 • MARKER? 9 * «  ?9 U  C *  MENUC0MMAND3 DELETE? = 'DELETE'? SAVE:='SAVE'J  ROTATE: = 'ROT ATEt5  t t t  * *  GOTO STATE 2; END STATE If  * STATE 38 C C • STATE 3 8 PICKING FROM THE MENU C * DISPLAY 'CHOOSE FROM MENU' AT « l r „ 9 ; * CURSOR ON? WAIT FOR INTERRUPT? *  * * *  FOR  HIT  ON  MENUS  FOR HIT ON DELETE! GOTO STATE. 4? END; FOR HIT ON ROTATE: GOTO STATE 5 ; END? FOR HIT ON SAVE; GOTO STATE 6? END? R « 8 fi « S  *  END f 111 9 9  *  t  END STATE 3 ?  * STATE 51 C C STATE 5 I ROTATING AN ELEMENT C * DISPLAY 'PICK ELEMENT TO BE REVERSED' AT * CURSOR ON? WAIT FOR INTERRUPT? * FOR HIT ON MENU! GOTO STATE 3 ? END? * FOR HIT OM ELEMENT: * AN s ANGLE (ELEMENT U H I T ) ) ? PI = 3 , 1 M 5 9 3  * * * *  AN=AN+PI ANGLFCELEMENTCIHIT)) = AN? ERASE SCREEN? DISPLAY CIRCUIT? END? GOTO STATE 3 ? END STATE 5 ?  ,1,,2|  17  whereas  the assignment  r o u t i n e s o p e r a t e on a d a t a s t r u c t u r e  r e p r e s e n t s the c u r r e n t s t a t e o f the p i c t o r i a l is  derived algorithmically  file the  i s needed.  The  display  from t h i s s t r u c t u r e and no s e p a r a t e d i s p l a y  correspondence between the v a r i a b l e names used i n  program and the l o c a t i o n s i n the d a t a s t r u c t u r e i s k e p t  a hash-coded to  The  information.  that  through  d i r e c t o r y where a l l names are s t o r e d t o g e t h e r w i t h p o i n t e r s  the s t r u c t u r e .  (For a d e s c r i p t i o n o f h a s h - c o d i n g see  d a t a s t r u c t u r e i s implemented p o i n t e r s l i n k i n g items  as a l i n k e d l i s t  t h a t are connected by  [11]).  The  [9,21] w i t h " b r o t h e r " the (+) o p e r a t o r and  " s o n " - p o i n t e r s l i n k i n g downwards through the s t r u c t u r e t o subitems primitives are  t h a t are used i n the d e f i n i t i o n o f i t e m s .  to say e.g. i n which  items the p r i m i t i v e LINE i s r e f e r e n c e d .  T h i s means t h a t the c u r s o r i d e n t i f i c a t i o n  of  u s u a l p a t t e r n of d e t e r m i n i n g which  on the s c r e e n does n o t  the c u r s o r and then d e t e r m i n i n g to which  <variablename>:  to  name <variablename>, which  item this l i n e belongs. FOR HIT  ON  a l l o w s a scan o f a l l items w i t h  are l i n k e d by a d d i t i o n a l " b u d d y " - p o i n t e r s ,  determine whether any o f those items were w i t h i n a t o l e r a n c e  ( s p e c i f i e d by 4.4  < s t a t e m e n t l i s t > END;  follow  l i n e i s c l o s e s t to the l o c a t i o n  I n s t e a d , the s y n t a x of the i d e n t i f i c a t i o n s t a t e m e n t :  the  "father"-pointers  k e p t l i n k i n g upwards through the s t r u c t u r e , so i t would not be  possible  the  No  and  the x and y - s c a l e of the item) around  region  the c u r s o r l o c a t i o n .  System C o n f i g u r a t i o n Two  under the MTS  implementations are used a t t h i s u n i v e r s i t y . t i m e s h a r i n g system on an IBM  programs.  runs  360/67 w i t h an Adage/10  g r a p h i c s t e r m i n a l , Calcomp and l i n e - p r i n t e r p l o t t e r s . used m a i n l y f o r debugging new  One  The  T h i s system i s  o t h e r system  runs  under  18  .DOS  on a Data G e n e r a l 20k  terminal. fication.  Supernova w i t h a T e k t r o n i x 4010  graphics  G r a p h i c s programs can be run on e i t h e r system w i t h o u t  mo  19  5.  IGLCOM, AN  IGLCOM, the IGL w r i t t e n u s i n g the XPL  IGL  COMPILER  c o m p i l e r used i n t h i s implementation  c o m p i l e r w r i t i n g system  T h i s i s a w e l l documented and easy t e n i n the XPL  d i a l e c t of PL/I.  [12]. t o use program package w r i t -  To b u i l d a c o m p i l e r u s i n g the XPL  the language syntax i n Backus Naur n o t a t i o n (BNF) semantics  i n XPL must be s u p p l i e d .  c e s s e d as f o l l o w s .  The  p a r s e r i s punched out by  These two  SKELETON. one  The produced  attempt  and has  When these two the XPL  two  check  the grammar  p a r s e r i s i n a format  i s w r i t t e n i n XPL  a  ANALYZER w i l l  d i r e c t l y i n s e r t e d i n t o a c o m p i l e r framework  SKELETON i t s e l f  compiled by  corresponding  t o modify  f o r a c c e p t i n g the p a r s e r from ANALYZER and one  mantics.  the  that called  open  slots,  f o r a c e p t i n g the  components have been added, SKELETON can  compiler producing  system,  u s e r components are p r o -  the XPL program ANALYZER.  t h a t i s not the case.  a l l o w s i t to be  and  syntax i s read i n , p r i n t e d , a n a l y z e d and  t h a t the grammar i s unambiguous and w i l l if  was  f o r the i n p u t grammar a  se-  be  compiler  i n o b j e c t code. The T h i s procedure by  semantics  are w r i t t e n as an XPL  c u l a r r u l e a p p l i e d i s passed o u t p u t language i s g e n e r a t e d . statements  I f the output directly.  named SYNTHESIZE.  i s c a l l e d i n SKELETON each time a grammar r u l e i s a p p l i e d  the p a r s e r f o r r e d u c i n g the i n p u t s t r i n g .  the output  procedure  will  The number o f the  a l o n g as an argument. I f the output  language,  to semantic r o u t i n e s .  the a c t i o n s can be  generated  F o r p a s s i n g names from, the i n p u t t o the output  language,  SYNTHESIZE has  i s i n assembly language,  In SYNTHESIZE the  i s i n a high l e v e l  usually consist of c a l l s  parti-  access  to the c o n t e n t s o f the p a r s i n g s t a c k s .  Pointers  20  are kept by SKELETON to show the c u r r e n t s t a t e o f these s t a c k s . T h i s automation to the language  of the c o m p i l e r - w r i t i n g p r o c e s s a l l o w s changes  t o be c a r r i e d out e a s i l y when needed.  the c o r r e s p o n d i n g semantics Compilers generated by t i e s and have proven  can be updated  the XPL  s y n t a x and  i n d e p e n d e n t l y o f one  another.  system p r o v i d e good e r r o r c h e c k i n g  to be q u i t e  Complete l i s t i n g s  The  facili-  efficient.  o f the IGL s y n t a x d e s c r i p t i o n i n BNF  o f the SYNTHESIZE r o u t i n e s can be found i n Appendix C o f t h i s  and  thesis.  21  6.  The ting  IGLRUNLIB, AN  IGL  RUNTIME LIBRARY  r o u t i n e s i n IGLRUNLIB m a i n t a i n  the p i c t o r i a l i n f o r m a t i o n c r e a t e d by  and handle the communication w i t h 6.1  a datastructure,  the e x e c u t i n g IGL  the g r a p h i c s  represen-  program,  terminal.  Datastructure The  overall  d a t a s t r u c t u r e has  been i n t r o d u c e d i n Chapter  I t consists of a l i n k e d l i s t of datablocks, addressable coded d i r e c t o r y . first  The  d i r e c t o r y contains  d e f i n i t i o n datablock  references that d e f i n i t i o n  and  through a h a s h -  the name, the l o c a t i o n of  the l o c a t i o n of the f i r s t  f o r every named i t e m .  The  datablock  the that  p r i m i t i v e s , de-  f i n e d i n the language, are f l a g g e d i n the d i r e c t o r y to p r e v e n t a l t e r a t i o n by  4.  their  the program. Datablocks  The  datablocks  c o n t a i n the l o c a t i o n  yscale), rotation  ( a n g l e ) , and  t h r e e p o i n t e r s as l i n k s  (xloc, yloc), s c a l i n g (xscale,  s u b s c r i p t (tag) o f a p i c t u r e i t e m ,  to o t h e r  items.  aid  22  xloc, yloc xscale,yscale angle, t a g A datablock  BROTHER BUDDY SON  The  son-pointer  links  the d a t a b l o c k t o i t s d e f i n i t i o n b l o c k ( s )  i n the  structure.  I t i s a one-way p o i n t e r ; no p o i n t e r s l i n k " s o n s " back to  "fathers".  The d a t a b l o c k s  point  f o r the p r i m i t i v e s have s o n - p o i n t e r s  to t h e i r g r a p h i c a l d e s c r i p t i o n i n an a r r a y o f ( x , y , i p e n )  To  distinguish this pointer  is  added to i t s c o r r e c t  from normal s o n - p o i n t e r s ,  a value  that triples.  o f 10,000  value.  Example: *  A:= SQUARE SCALE .1; B:= A ANGLE 45;  A  X  SQUARE  B  / 0 X Y i  SQUARE i s here a son o f A, who i s i n t u r n a son o f B.  23  The b r o t h e r p o i n t e r l i n k s cally  together datablocks  connected by the (+) o p e r a t o r .  by a zero e n t r y .  that are l o g i -  The end o f the l i n k i s i n d i c a t e d  B r o t h e r p o i n t e r s e x i s t on two l e v e l s :  "stronger"  l i n k s w i t h i n the d e f i n i t i o n o f s u b s c r i p t e d v a r i a b l e s and "weaker" w i t h i n the d e f i n i t i o n o f u n s u b s c r i p t e d v a r i a b l e s . l e v e l hierarchy within a linear  links  T h i s a l l o w s a two  list.  Example: *  E(2):= A + B; C:= E(2) + A;  C  The s t a t e m e n t : o f the f i r s t  *  C:= C - E ( 2 ) ;  would now cause the d e l e t i o n o f b o t h  two b l o c k s i n C, as they a r e l i n k e d by the s t r o n g e r  links.  The t h i r d b l o c k , however, w i l l be r e t a i n e d as i t i s l i n k e d by a weaker l i n k , meaning t h a t a l t h o u g h  i t i s p a r t o f C, i t i s n o t a p a r t o f E ( 2 ) .  The buddy p o i n t e r l i n k s same name.  together datablocks  They are e s s e n t i a l f o r a c c e s s  t h a t have the  to any i t e m g i v e n by name and  24  subscript.  T h i s a c c e s s i s accomplished  as f o l l o w s :  up i n the d i r e c t o r y , where the l o c a t i o n o f the f i r s t e n c i n g b l o c k i s found.  definition  and r e f e r -  A s e q u e n t i a l search o f a l l blocks with  name i s made by f o l l o w i n g the buddy p o i n t e r s . s t o r e d " t a g " i n the d a t a b l o c k to be i d e n t i f i e d .  The name i s l o o k e d  that  A comparison between t h e  and the s u b s c r i p t g i v e n  allows  the i t e m  As the buddy p o i n t e r s are l i n k e d i n a c l o s e d r i n g ,  the end o f an u n s u c c e s s f u l s e a r c h i s determined when r e t u r n i n g t o the first  block.  Example: *  C:= E ( l )  + E(2) ;  D:= E ( 3 ) ;  C  1  E(2)  brother  \ son son  \  D  '  / buddy  son 6.2  Display Algorithm F o r d i s p l a y i n g a p i c t u r e , the i n f o r m a t i o n i n the d a t a  t u r e has to be transformed  struc-  i n t o a l i n e a r sequence o f beam o r pen move-  ments on the d i s p l a y d e v i c e .  *  In the f o l l o w i n g the terms f a t h e r , son and b r o t h e r a r e def i n e d as shown:  25  A ^  A  x  B 1  •B  /  i  i s t h e f a t h e r o f B and C i s the f i r s t son o f A  \ C  1  The a l g o r i t h m i s t h e f o l l o w i n g :  i s B's b r o t h e r  S t a r t i n g a t t h e image t o be d i s p l a y e d ,  the f i r s t son (subimage) i s t a k e n and the v a l u a t i o n o f t h e f a t h e r applied.  The v a l u a t i o n i s the s e t o f a t t r i b u t e s :  YSCALE, ANGLE). i s encountered,  (XLOC, YLOC, XSCALE,  This i s c a r r i e d out r e p e t i t i v e l y u n t i l a p r i m i t i v e t h e i n t e r m e d i a t e s t e p s b e i n g saved i n a push-down s t a c k .  Then the p r i m i t i v e i s d i s p l a y e d u s i n g the a c c u m u l a t e d t r a n s f o r m a t i o n s . A f t e r t h i s , the top i t e m i n t h e push-down s t a c k i s popped up and i t i s t r e a t e d as a new s t a r t i n g image.  This process  i s stopped  when t h e s t a c k i s empty and a l l b r o t h e r s o f t h e o r i g i n a l f a t h e r have been c o n s i d e r e d . In  The p r o c e s s i s i l l u s t r a t e d by t h e f l o w c h a r t i n F i g . 2.  o r d e r t o be a b l e t o a p p l y a f a t h e r ' s v a l u a t i o n t o h i s  son we must c o n s i d e r the f o l l o w i n g : The v a l u a t i o n i n v o l v e s a SCALING, ROTATION and TRANSLATION o f some p o i n t P (X,Y) i n a c o o r d i n a t e system.  The e q u a t i o n s  for this  transformation  are: X = (X - 0.5) XSCALE ' COSa - (Y - 0.5) YSCALE • ' SINct + XLOC or:  Y = (X - 0.5) XSCALE • SINa + (Y - 0.5) YSCALE * COSa + YLOC P = [A] ' P + [B]  where:  XSCALE • COSa  -YSCALE • SINa  XSCALE ' SINa  YSCALE * COSa  [A] =  DISPLAY 'NAME'  Get pointer to 'NAME*'  Push down into stack  Get  first son  Figure 2:  DISPLAY algorithm  27  vrnr  J.  YSCALE • SINa - XSCALE • COSa  [B] = XSCALE • SINa + YSCALE • COSa  S t o r i n g the v a l u a t i o n as YSCALE, a) a l l o w s  us  ( [ A ] , [B]) r a t h e r than as  to apply  P = A, P + B. = A„ (A f f f s v  one  valuation  P + B ) + s  (XLOC, YLOC, XSCALE,  (A^, B^)  to another  (A , g  B ). g  B.. f  = A. A P + A. B + B = A P + B f s f s f ->- A = A B = A For t h i s is  £  f  • A B  s  s  +  B f £  reason the i n t e r n a l r e p r e s e n t a t i o n  a s e x t u p l e t (A^^, A^^,  used i n the 6.3  f  £  A^>  -^22'  B  l '  B  2^  r  o f the v a l u a t i o n components a  t  n  e  r  t  n  a  n  the  quintuplet  IGL-syntax.  Terminal The  Interface communication w i t h  the g r a p h i c s  a l o g i c a l l e v e l , using a coordinate i n the language.  t e r m i n a l takes p l a c e  system o f 1.0  by  1.0  as  Keeping t h i s i n t e r f a c e on a l o g i c a l l e v e l ,  on  defined rather  than on a p h y s i c a l l e v e l , makes i t r e l a t i v e l y easy to i n t e r f a c e to different  terminals. The  - erase  l o g i c a l t e r m i n a l i s assumed to be the  c a p a b l e of f o u r  things:  screen  - move the beam o r draw a v e c t o r to l o c a t i o n  from the c u r r e n t beam p o s i t i o n  X,Y  - d i s p l a y a t e x t s t r i n g of n c h a r a c t e r s , s t a r t i n g at l o c a t i o n - d i s p l a y a c u r s o r on the s c r e e n , w a i t the  c u r s o r , r e t u r n the X,Y  f o r the u s e r  coordinates  o f the  X,Y  to p o s i t i o n  c u r s o r , and  the  28  c h a r a c t e r c o d e o f the b u t t o n pushed by t h e user to i n d i c a t e his  interrupt.  The c a l l i n g sequences a r e : CALL ERASE  IPEN = 0:  move beam  CALL VECTOR (X,Y,IPEN)  IPEN = 1:  draw v e c t o r  CALL DISPS  (ITEXT, X.Y.N)  CALL WAITIN COMMON/CURSOR/IDUMMY, X,Y, KEYHIT Any o t h e r i n p u t / o u t p u t can be programmed WRITE and READ statements.  using conventional Fortran  29  7.  IMPLEMENTATION OF IGL ON  A DATA GENERAL SUPERNOVA MINICOMPUTER Although, during the implementation phase, every e f f o r t was made to keep the programs hardware independent, i t was unavoidable that the p a r t i c u l a r computer system used had some influence on the decisions that were made. The most far-reaching decision was made i n choosing as programming language for the runtime l i b r a r y .  Fortran  Although the language  Fortran IV was standardized by ASA i n 1964 [7], a combination of p r a c t i c a l considerations and the ambiguities  i n the published description of the  language have l e d to the present s i t u a t i o n , where the Fortran  compilers  supplied by computer manufacturers include most ( i f not a l l ) features of ASA Fortran and, to make up for any d e f i c i e n c i e s , usually o f f e r added on s p e c i a l features not found i n ASA Fortran.  The average user  of such a compiler w i l l tend to regard his p a r t i c u l a r expanded subset of ASA Fortran as the "only Fortran" and d i s t r u s t any other implementations of the language.  This i s p a r t i c u l a r l y the case i f the implementa-  t i o n used i s the IBM Fortran IV G-level compiler,  regarded by many as  the ultimate d e f i n i t i o n of the Fortran language. The runtime l i b r a r y was written i n a subset of Fortran common to the IBM and Data General compilers.  These routines can thus be executed on  either computer without modification.  This fact does not insure,  however, that these routines w i l l execute on any computer due to the above reasons. Only the routines that communicate with the graphics  terminal  d i f f e r i n the two implementations.  The routines for the Tektronix 4010  terminal are written i n assembler.  They were supplied with the terminal  30  and  are documented by T e k t r o n i x .  The  are w r i t t e n i n F o r t r a n u s i n g the UBC be  found  i n Appendix D o f t h i s The  to any  AGT:BASIC s u p p o r t package and  same r e s t r i c t i o n s  360 may  not  can  thesis. that a p p l y  user program w r i t t e n i n IGL.  on the IBM  r o u t i n e s f o r the Adage/10 t e r m i n a l  to the runtime l i b r a r y  A program t h a t w i l l  do so on the Supernova.  The  execute  Users'  apply correctly  Guide  lists  some of the p o i n t s to be watched when w r i t i n g a program, most o f which need not  concern  us h e r e .  There are a few p o i n t s , though, t h a t are o f  more g e n e r a l i n t e r e s t and may  apply  Wordlength - Many t h i r d g e n e r a t i o n o f the IBM  360  to a number o f  computers.  computers have f o l l o w e d the example  system, u s i n g a w o r d l e n g t h o f 32 b i t s  i n t o 2 halfwords  of 16 b i t s  (2 b y t e s ) .  (4 b y t e s ) , d i v i d e d  Fortran compilers  on  these  machines t y p i c a l l y a l l o w i n t e g e r w o r d l e n g t h s of one word (INTEGER*4) o r o f one i s o f no  halfword  (INTEGERS) .  For n u m e r i c a l  algorithms  g r e a t s i g n i f i c a n c e as l o n g as i t i s kept  i n mind t h a t  l a r g e s t a l l o w a b l e INTEGER*2 v a l u e i s 32767, which may many problems.  Many minicomputers are o r g a n i z e d  The  o n l y 16 b i t i n t e g e r s s h o u l d be  be q u i t e low  for  to the i n t e g e r w o r d l e n g t h .  around a w o r d l e n g t h o f 16 b i t s ,  To be  compatible  which  the p o r t a b i l i t y o f any  computer i n s t a l l a t i o n  to another,  but  are dependent on c h a r a c t e r h a n d l i n g user.  between  the two  machines,  used f o r c h a r a c t e r m a n i p u l a t i o n .  facts naturally l i m i t  the  the  the r e s t r i c t i o n of a l l o w i n g o n l y INTEGER*2 v a l u e s .  Supernova i s an example.  typed i n by  fact  More n o t i c e a b l e i s the e f f e c t on the c h a r a c t e r h a n d l i n g  c a p a b i l i t i e s , which i n F o r t r a n are l i n k e d  l e a v e s them w i t h  this  F o r t r a n program from  These one  i n t e r a c t i v e programs e s p e c i a l l y  f o r e v a l u a t i n g r e s p o n s e s and  values  31  Storage - 16 b i t machines are designed s t o r i n g a f l o a t i n g point value. accuracy.  One  to use  two  computer words f o r  word would not permit  T h i s means that the s t o r a g e  of REAL v a l u e s  sufficient  uses twice  the  amount of space needed f o r s t o r i n g the same number of INTEGER v a l u e s . this  reason,  a l l arrays representing  integer values.  the  IGL  d a t a s t r u c t u r e are s t o r e d  T h i s i s at a c o s t i n a c c u r a c y  p l a c e s ) , a cost i n conversion r i s k of i n t e g e r overflow  (4-5  versus  7  Another problem i n s t o r a g e f i n i t e s i z e of the main memory.  should  of operating  programmers o f l a r g e programs have r e s o r t e d to v a r i o u s using a v a i l a b l e e x t e r n a l storage  at  very  systems  and  technique  time i t i s to be  keep p a r t of the program to be  of  space ( f i x e d or moving head d i s k )  used.  to  The  i s to keep p a r t of the d a t a used on e x t e r n a l  read i t i n every  and  techniques  augment the power o f the main (core o r semiconductor) memory. simplest  the  occur.  on a minicomputer i s the  Designers  as  decimal  f o r a r i t h m e t i c o p e r a t i o n s , and  i f unexpected l a r g e v a l u e s  For  storage  Another p o s s i b i l i t y i s to  e x e c u t e d on e x t e r n a l s t o r a g e  and  read i t  i n t o the main memory when needed; t h i s scheme i s g e n e r a l l y r e f e r r e d t o as o v e r l a y i n g . The  Data G e n e r a l  o f o v e r l a y s and  d i s k o p e r a t i n g system a l l o w s  i n a d d i t i o n allows  the d i f f e r e n c e between these example.  two  c h a i n i n g o f segments.  methods, we  consider  up  to 6 l e v e l s To  understand  the f o l l o w i n g  32  1) Routine A -T-  2) Routine A  A  A  CALL B CALL C  CALL B B END  END  Routine B  B  __ C  CALL C END  C  We assume t h a t any o f the r o u t i n e s A-D w i l l s e p a r a t e l y , b u t no two r o u t i n e s w i l l i s now c o n s i d e r e d  a separate  f i t i n t o the main memory  f i t i n together.  program segment.  Each  routine  In case 1 ) , the e x e c u t i o n  of segment A must be suspended f o r segment B to be brought i n t o When B has f i n i s h e d , A can c o n t i n u e .  core.  As A, however, would be o v e r -  w r i t t e n by B, i t must f i r s t be saved. An o v e r l a y  thus i n v o l v e s :  - saving  the c u r r e n t  segment A  - l o a d i n g the needed segment B - starting  the e x e c u t i o n  A r e t u r n from o v e r l a y  involves:  - r e l o a d i n g the p r e v i o u s - restarting execution  segment A  the e x e c u t i o n  o f A a t the l o c a t i o n where the  was suspended.  In case 2 ) , the e x e c u t i o n needed.  o f B.  o f segment A i s f i n i s h e d when segment B i s  There i s thus no need t o save A, and B can be l o a d e d  This process A chaining  i s called  chaining.  involves:  - l o a d i n g the needed segment B  directly.  33  - s t a r t i n g the e x e c u t i o n  o f B.  A r e t u r n from c h a i n i n g does n o t e x i s t . The  communication between segments i s o n l y p o s s i b l e  the BLANK COMMON a r e a ,  through  the o n l y p a r t o f core t h a t i s n e i t h e r s a v e d n o r  r e s t o r e d when e x e c u t i n g  an o v e r l a y .  d a t a on e x t e r n a l s t o r a g e  (Communication by s a v i n g  i s o f c o u r s e always p o s s i b l e ) .  relevant  The p r e s e n t  v e r s i o n o f DOS ( r e l e a s e 5) w i l l , however ( c o n t r a r y t o i t s d e s c r i p t i o n ) , s t o r e and l o a d a l l o f c o r e , i n c l u d i n g b l a n k common.  T h i s can be p r e -  v e n t e d by c a l l i n g the i n i t i a l i z a t i o n r o u t i n e INCOM, d e s c r i b e d  i n Ap-  p e n d i x D. T h e . d i v i s i o n o f an IGL program i n t o s t a t e s makes an a u t o m a t i c o v e r l a y i n g scheme f e a s i b l e . o v e r l a y segment. the IGL s y n t a x , (chaining:  As no r e t u r n t o a p r e v i o u s segments can be c h a i n e d .  3 sec,  the e x e c u t i o n  Each s t a t e c o r r e s p o n d s t o a s e p a r a t e  overlay:  state i s provided  A p a r t from s a v i n g  for i n  time  7 s e c . i n o u r s y s t e m ) , the c h a i n i n g  allows  t o p r o c e e d a t the same l e v e l i n DOS, thus s e t t i n g no  l i m i t t o the number o f s t a t e s t o be e x e c u t e d .  The IGL c o m p i l e r  l a t e s t h e goto s t a t e m e n t :  CALL CHAIN ('STAT n.SV'),  GOTO STATE n i n t o :  where n i s t h e number o f the s t a t e t o be e x e c u t e d .  ii =  trans-  (n = n f o r n > 9,  0 n f o r n $ 9) .  Because o f t h e l i m i t e d s t o r a g e i t was i n i t i a l l y  s i z e o f 20k words main memory,  found t h a t t h e r u n t i m e l i b r a r y was t a k i n g up t o o much  space, l e a v i n g only a m i n i s c u l e  amount f o r the u s e r program.  The s o l u -  t i o n has been t o move t h e d i s p l a y and e r r o r r o u t i n e s t o s e p a r a t e segments.  overlay  T h i s i s r e g r e t t a b l e , as the d i s p l a y r o u t i n e s a r e c a l l e d o f t e n ,  and e x e c u t i n g  an o v e r l a y  f o r each d i s p l a y command causes a v e r y  pause i n t h e i n t e r a c t i o n .  noticeable  34  For  an a n a l y s i s  of t h i s situation., i t i s useful  the s t o r a g e a l l o c a t i o n w i t h i n can be v a r i e d . of  and see which parameters  With an IGL program e x e c u t i n g , the main memory  the computer i s r o u g h l y d i v i d e d up as f o l l o w s :  Page zero and F o r t r a n IGL  the main memory  addresses  .5 k  user program  1.5 k *  IGLRUNLIB  4.5k(*)  Fortran  4  k  DOS s t a c k s  1  k  BLANK COMMON  2.5 k *  DOS SYSTEM  6  runtime l i b r a r y  20 Of -are  these s e c t i o n s ,  only  f i x e d , regardless  k k  the s t a r r e d v a l u e s are v a r i a b l e ,  4k t o 24 k words?  current  a l l others  o f program s i z e .  What would now be the e f f e c t o f i n c r e a s i n g by  t o examine  The f o l l o w i n g  the memory s i z e  changes c o u l d be made t o t h e  implementation:  - The d i s p l a y  routines  a r e added t o the main segment (1.5 k)  - The BLANK COMMON a r e a and u s e r program a r e a l l o w e d an a d d i t i o n a l 2.5 k. T h i s would mean i n s t a n t response t o a d i s p l a y command, more d a t a s t o r a g e and l a r g e r The proves t h a t small  (and h o p e f u l l y  more i n t e r e s t i n g )  p r e s e n t implementation i s s u c c e s s f u l ,  applications.  i n as f a r as i t  an IGL system can be implemented and used on a m o d e r a t e l y  machine.  F o r the system t o be t r u l y c o n v e n i e n t and s u f f i c i e n t l y  p o w e r f u l f o r r e a l w o r l d a p p l i c a t i o n s , however, a minimum s t o r a g e s i z e o f 24 k words i s a b s o l u t e l y  necessary.  35  8.  EXPERIENCE WITH USING IMPLEMENTED IGL  The for  flexibility  SYSTEM  and ease of use make the language IGL  e x p e r i m e n t i n g w i t h new  perience with  THE  g r a p h i c s t e c h n i q u e s and i d e a s .  To  gain  the system, s e v e r a l a p p l i c a t i o n s were programmed by  ferent users.  (See Appendix B ) .  drawing e l e c t r o n i c  circuits  [3].  and  a l o a d flow program f o r the  of  f o u r t h y e a r s t u d e n t s i n t h i s department implemented complete  12 week systems l a b p r o j e c t s ,  analysis,  run on a minicomputer i n t h i s department and 360  grade d a t a l i n k i s used another.  The  experience  a l r e a d y proven Due of  the language.  [17].  interface  f o r t r a n s m i t t i n g d a t a from one  methods  to a n a l y s i s A voice  computer to  gained so f a r i n the use o f the language has  to the d e f i n i t i o n o f the syntax and  The  inter-  Both systems  i n s t a l l a t i o n i n the Computer C e n t r e .  a number o f advantages o v e r present-day  these are e a s i l y  groups  f o r i n t e r a c t i v e p r o j e c t s c h e d u l i n g u s i n g CPM  for interactive nonlinear c i r c u i t  programs on the IBM  dif-  analysis  power systems  a c t i v e systems; one  In two  ex-  F i r s t p r o j e c t s were a program f o r  of  and one  ideal  i n c o r p o r a t e d as e x p e r i e n c e system has been found  g r a p h i c s systems.  the s e m a n t i c s ,  changes  i s g a i n e d i n the use  f a r e a s i e r t o use  than  of  the  g r a p h i c a l s u b r o u t i n e packages found on most computer i n s t a l l a t i o n s . language i s r e a d i l y l e a r n e d by u s e r s w i t h p r e v i o u s h i g h - l e v e l experience.  the r e a d a b i l i t y o f the program, the time r e q u i r e d f o r the  of  a p r o j e c t i s g r e a t l y reduced. powerful  language  As no e x t e n s i v e t e s t i n g and.documentation i s n e c e s s a r y  to  new  The  Furthermore,  completion  the a v a i l a b i l i t y o f a  t o o l s t i m u l a t e s the i m a g i n a t i o n of the u s e r to t a c k l e  blems p r e v i o u s l y c o n s i d e r e d out of r e a c h .  due  pro-  36  9.  BIBLIOGRAPHY  U n t i l recently, l i t t l e d i f f e r e n t workers i n the f i e l d  i n t e r a c t i o n has taken p l a c e between the  o f Computer G r a p h i c s .  t e d on g r a p h i c s and a r t i c l e s were s c a t t e r e d t i o n s such as Communications o f the ACM,  No textbooks  exis-  throughout v a r i o u s p u b l i c a -  Computing S u r v e y s , AFIPS con-  ference proceedings e t c . However, i n 1970 a f i r s t Graphics at Brunei U n i v e r s i t y . and Image P r o c e s s i n g " appeared  c o n f e r e n c e was h e l d on Computer  In 19 72,  the j o u r n a l "Computer G r a p h i c s  and a working  Languages was h e l d by IFIPS a t the U n i v e r s i t y excellent  textbook has appeared  Computer G r a p h i c s " , by W.H. way o f t h i n k i n g about last  10 y e a r s .  c o n f e r e n c e on G r a p h i c of B.C.  Finally,  an  i n 1973, " P r i n c i p l e s o f I n t e r a c t i v e  Newman, t h a t c o n t a i n s the essence o f a  computer g r a p h i c s t h a t was  developed o v e r the  37  REFERENCES  1.  P. B o u l l i e r e t a l . , "METAVISU, A g e n e r a l purpose g r a p h i c system", i n F. Nake,. A. R o s e n f e l d , Eds., G r a p h i c Languages, Amsterdam: NorthH o l l a n d P u b l . Co., 1972.  2.  I.W. Cotton, R.S. Greatorex, "Data s t r u c t u r e s and t e c h n i q u e s f o r r e mote computer g r a p h i c s " , AFIPS P r o c . FJCC, 1968.  3.  B.A. Dixon, " I n t e r a c t i v e G r a p h i c a l Load Flow", s u b m i t t e d t o : Intern a t i o n a l E l e c t r i c a l , E l e c t r o n i c s Conference and E x p o s i t i o n , T o r o n t o , Oct. 1973.  4.  J.D. D u f f i n , "A language f o r l i n e drawing", Sc. Dept., U. o f Toronto, May 1970.  5.  A . J . Frank, 1968.  6.  "Grapple - G r a p h i c a l Programming Language R e f e r e n c e Manual", N o r t h e r n Research, Feb. 19 72.  7.  " H i s t o r y and Summary o f FORTRAN s t a n d a r d i z a t i o n development f o r the ASA". Comm. ACM, O c t . 1964.  8.  IFIP Working Conference on G r a p h i c Languages, i n F. Nake, A. Rosenf e l d Eds., G r a p h i c Languages, Amsterdam: N o r t h - H o l l a n d P u b l . Co., 1972.  9.  D.E. Knuth, The A r t o f Computer Programming, V o l . 1, Addison-Wesley, 1969.  Tech. Rep. #20, Comp.  " B - l i n e , B e l l l i n e draining language",  AFIPS P r o c . FJCC,  Bell-  10.  H.E. K u l s r u d , "A g e n e r a l purpose 1968.  G r a p h i c Language", Comm. ACM, A p r i l  11.  W.D. Maurer, "An improved January 1968.  12.  W.M. McKeeman e t a l . ,  13.  W.F. M i l l e r , A.C. Shaw, " L i n g u i s t i c methods i n p i c t u r e p r o c e s s i n g A s u r v e y " , AFIPS P r o c . FJCC, 1968. *•  14.  F. Nake, "A proposed language f o r the d e f i n i t i o n o f a r b i t r a r y twod i m e n s i o n a l s i g n s " i n 0.1. G r u s s e r , R. K l i n k e , Eds., Zeichenerkennung i n b i o l o g i s c h e n und t e c h n i s c h e n Systemen. B e r l i n : S p r i n g e r , 19 71.  15.  W.M. Newman, "A system P r o c . SJCC, 1968.  16.  W.M. Newman, R.F. S p r o u l l , P r i n c i p l e s o f I n t e r a c t i v e Computer G r a p h i c s , M c G r a w - H i l l , 19 73.  Hash Code f o r s c a t t e r s t o r a g e " , Comm. ACM,  A Compiler Generator,  forinteractive  P r e n t i c e - H a l l , 1970.  g r a p h i c a l programming", AFIPS  38  17.  B. P i e k e , G.F. Schrack, " I n t e r a c t i v e c i r c u i t a n a l y s i s u s i n g a h i g h l e v e l g r a p h i c s language", 16th Midwest Symposium on C i r c u i t Theory, Waterloo, 1973.  18.  M.D. P r i n c e , I n t e r a c t i v e G r a p h i c s for_Computer-Aided Wesley, 1971.  19.  S. Semrau, "PDP-9 c i r c u i t Columbia, 19 71.  i n p u t program", E.E. Dept.,  U. o f B r i t i s h  20.  I.E. S u t h e r l a n d , "SKETCHPAD - A man-machine g r a p h i c a l system", AFIPS P r o c . SJCC, 1963.  communication  21.  R. W i l l i a m s , " A s u r v e y o f d a t a s t r u c t u r e s Computing Surveys, March 1971.  Design, Addison-  f o r computer g r a p h i c s systems",  APPENDICES  40  APPENDIX A: IGL USERS' GUIDE  1.  Introduction IGL  puter  i s an acronym f o r  language f o r w r i t i n g programs f o r h a n d l i n g l i n e  language n o t only a l l o w s but  I n t e r a c t i v e Graphics  a l s o has f u l l  Language, a comdrawings.  the d e f i n i t i o n and d i s p l a y o f l i n e  facilities  f o r manipulating,  This  drawings,  naming, i d e n t i f y i n g and  i n t e r a c t i n g w i t h such drawings. The  IGL system c o n s i s t s o f IGLCOM, the IGL c o m p i l e r , and  IGLRUNLIB, the IGL runtime  2.  The IGL Language The  in  library.  d e f i n i t i o n o f the IGL language has been f o r m a l l y  given  BNF n o t a t i o n , b u t t h i s d e f i n i t i o n s h o u l d n o t be r e q u i r e d r e a d i n g f o r  the average user.  Instead,  t h i s u s e r s ' guide w i l l  attempt t o i n t r o d u c e  the language i n a l e s s f o r m a l manner, u s i n g examples t o e x p l a i n the use o f IGL  statements.  IGL has been implemented as an e x t e n s i o n  t o F o r t r a n IV, a l l o w -  ing  the user  IGL  statements are r e c o g n i z e d by t h e IGL c o m p i l e r by examining the  first  to mix F o r t r a n IV and IGL statements i n the same program.  column o f each l i n e .  The c h a r a c t e r s . {_, 0, 1...9, C, A, X} i n d i -  cate a F o r t r a n statement, any o t h e r c h a r a c t e r an IGL s t a t e m e n t .  In a l l  examples i n t h i s manual, the c h a r a c t e r * w i l l be used to i n d i c a t e IGL statements. The  r u l e s f o r the coding o f IGL statements do n o t f o l l o w t h e  F o r t r a n convention. no  IGL statements can be w r i t t e n i n f r e e format,  regard f o r card boundaries.  with  One r u l e s h o u l d be f o l l o w e d , however.  Keywords i n e i t h e r F o r t r a n o r IGL a r e c o n s i d e r e d  t o be r e s e r v e d words.  41  They cannot be used as v a r i a b l e names and must be w r i t t e n w i t h o u t imbedded b l a n k s . Example:  by a t l e a s t one b l a n k .  RE~AD, which i s l e g a l i n IBM F o r t r a n IV i s n o t l e g a l i n an IGL  3.  Keywords s h o u l d be s e p a r a t e d  program.  W r i t i n g an IGL Program An  IGL program i s d i v i d e d up i n t o s t a t e s , each s t a t e  corres-  ponds t o a l o g i c a l s t a t e i n the i n t e r a c t i o n . Consider  the f o l l o w i n g example:  A 'rubber-band' l i n e  can be c r e a t e d by means o f a j o y -  s t i c k and a push-button i n a sequence o f f i v e  operations.  1)  press button  t o t u r n on c u r s o r ; .  2)  move c u r s o r , u s i n g j o y s t i c k , t o s t a r t i n g p o i n t o f l i n e ;  3)  press button  4)  move c u r s o r t o end p o i n t o f l i n e ;  5)  press button  to f i x s t a r t i n g  point;  t o f i x end p o i n t .  A s t a t e diagram might look as seen on t h e next page. Here a f e a t u r e i s added to a l l o w continue  drawing l i n e s  shown r e p r e s e n t s  d e l e t i o n o f l i n e s and t o  from the l a s t e n d p o i n t .  a different  Each o f the 5 s t a t e s  stage i n the i n t e r a c t i o n .  This  can be  seen by the meaning o f the push-button i n each s t a t e .  i n s t a t e 2 i t means:  F i x the s t a r t i n g p o i n t o f a new and the end p o i n t  An  :  Execute a command from t h e menu  in state 5  :  Delete  IGL program that  follows:  o f the l i n e  in state 4  the l i n e  line,  that i s pointed to  corresponds t o t h i s s t a t e diagram would l o o k as  42  STATE DIAGRAM (creating  f  a 'rubber-band' drawing)  INITIALISATIONS  I press  button  for  deletion  43  * STATE H C C — INITIALISATIONS ' C Xi,X?,Yl,Y2,I * NEWLINE J = 'Nf;w L I N E > ; D E L E T E J = I D E L E T E I ; * DRAWING»=NEWLINE SCALE , 1 , , 1 AT 1 , 1 5 , , 8 + D E L E T E 1=0 X1 = 0 , Y1 = 0 , PAUSE ' P R E S S BUTTON I * ERASE SCREEN? DISPLAY DRAWING; GOTO S T A T E 2 ; END  COMMON  * S T A T E 2J C C —«» STORING C *  * *  *  STARTING  AND  ENDING POINT  OF  A LINE  COMMON  X1,X2,Y1,Y2,I CURSOR ON; WAIT FOR I N T E R R U P T ; X1=XHIT Y1=YHIT D I S P L A Y DOT AT X I , Y l ; CURSOR ON; WAIT FOR I N T E R R U P T ; X2=XHIT Y2=YHIT GOTO S T A T E 3 ; END STATE 2 ;  * STATE 3j C . . . . . . . . . C - ~ * ADDING L I N E TO DRAWING C COMMON X l , X 2 , Y i , Y 2 , I 1=1 + 1 * L C I ) : = L I N b FROM X I , Y l TO X 2 , Y 2 ; DISPLAY * DRAWING:=DRAWING + LCI); * GOTO S T A T E 4 ; ENU S T A T E 3 ;  .  .  LU);  * STATE 4: C C — CHOOSING FROM MENU C COMMON X 1 , X 2 , Y 1 , Y 2 , I * CURSOR ON; WAIT FOR I N T E R R U P T ; * FOR HIT ON NEWLINE: GOTO S T A T E 2 ; END; * FOR HIT ON D E L E T E : GOTO S T A T E 5 ; END; X1=X2 Y1=Y2 X2=XHIT Y2=YHIT * GOTO S T A T E 3 ; END S T A T E 4 ; * STATE 5: C C — - DELETING A LINE C COMMON XI , X 2 , Y 1 , Y 2 , I * DISPLAY 'CHOOSE L I N E S TO BE D E L E T E D ' AT 1 CONTINUE * CURSOR ON; WAIT FOR I N T E R R U P T ; * FOR HIT ON L l DRAWING f= DRAW1NG-L(I H I T ) GOTO 1  * END;  * * *  ERASE S C R E E N ; END S T A T E 5 ; EOF EOF EOF  DISPLAY  DRAWING;  GOTO  ,2,  ,9;  ;  STATE  2>  SCALE  , 1 # , 1 AT  STATE  1;  1,15,,6;  44  T h i s example shows how the i n t e r a c t i o n can be programmed i n IGL and already  uses most o f the statement types  number o f p o i n t s s h o u l d be n o t e d here,  to be d e s c r i b e d below.  A  however.  - The program i s d i v i d e d i n t o s t a t e s o f which the f i r s t e x e c u t e d must be STATE  t o be  1.  - F o r t r a n v a r i a b l e s can be passed between s t a t e s u s i n g BLANK COMMON o n l y .  The l e n g t h o f BLANK COMMON areas  must be d e c l a r e d  equal  in a l l states. - F o r t r a n statement numbers  are l o c a l t o s t a t e s .  - A l l statements i n IGL a r e t e r m i n a t e d  u s i n g a semicolon (;).  There are.two types o f image c o n s t a n t s  i n IGL:  Cons t a n t s  s t a n t s and l i t e r a l  constants.  P i c t u r e constants  LINE, DOT, SQUARE, TRIANGLE, CIRCLE,  p i c t u r e con-  form the s e t {BLANK,  HCIRCLE} and a r e d e f i n e d as  shown below.  BLANK  LINE  L i t e r a l constants  DOT  SQUARE  TRIANGLE CIRCLE HCIRCLE  a r e t e x t s t r i n g s , d e l i m i t e d by quotemarks.  They can  have a maximum l e n g t h o f 10 c h a r a c t e r s . Functions ponding IGL image  are p r o v i d e d  values.  t o convert  Fortran values  to c o r r e s -  45  VALUE c o n v e r t s  an i n t e g e r  TEXT  an i n t e g e r v a r i a b l e c o n t a i n i n g  converts (The  value a textstring.  s t r i n g i s assumed t o be 10 c h a r a c t e r s  long).  Example: 'DELETE', 'HI, THERE', VALUE  (3) o r TEXT (ITEXT) a r e l i t e r a l  constants. Variables Image v a r i a b l e s s t a n d be  assigned  image v a l u e s .  f o r p i c t u r e s and/or l i t e r a l s  They a r e named a c c o r d i n g  and can  to the F o r t r a n  r u l e s f o r v a r i a b l e names, but can have up t o 8 c h a r a c t e r s . Example: DELETE o r RESISTOR are l e g a l v a r i a b l e names. Assignments Image v a r i a b l e s are a s s i g n e d  ]  ment.  The image assignment o p e r a t o r  values  using  i s the (:=).  an assignment s t a t e A l l values  r i g h t hand s i d e o f the assignment must have been p r e v i o u s l y  on the defined.  Example: * DELETE:=  'DELETE'; A:= SQUARE;  B:= VALUE ( 1 3 ) ;  Modifiers Constants and v a r i a b l e s can be m o d i f i e d , modifiers.  A l laffine  transformations  using  can be a p p l i e d .  are: -  translation:  - scaling: - rotation: - mirroring:  AT  x,y  SCALE xs , ys o r SCALE ANGLE  s  alpha  VSYM a x i s o r HSYM a x i s  (the lower case names s t a n d  f o r F o r t r a n REAL v a l u e s )  valuation The  modifiers  46  Any combination o f these can be s p e c i f i e d and w i l l be a p p l i e d i n the following order: Scaling, rotation,  translation,  mirroring  As a l l p i c t u r e v a r i a b l e s are d e f i n e d w i t h i n a u n i t s q u a r e , i t h e l p s to v i s u a l i s e what happens  to t h i s square when the m o d i f i e r s a r e a p p l i e d .  Example: * A:= TRIANGLE SCALE dx, dy ANGLE a l p h a AT x,y; * B:= A VSYM ax; I  ax  Pi*  TRIANGLE  B  F o r l i n e segments, the m o d i f i e r s as g i v e n a r e akward t o u s e . i n g can be used: -FROM x l , x l  TO y 2 , y2  T h i s corresponds t o : SCALE xs , y s where:  XS = SQRT ( ( X 2 - X 1 )  2  ANGLE a l p h a AT x,y + (Y2 - Y l ) ) 2  YS = .1 * XS ALPHA = ARCTAN ((Y2 - Y1)/(X2-X1)) * 180/ir X = ( X I + X2)/2 Y = ( Y l + Y2)/2 Example: * HORIZON:= LINE FROM 0,.3 TO 1,.3;  The f o l l o w -  LINE Note: than  A trailing  HORIZON decimal p o i n t need n o t be w r i t t e n .  3.0 s h o u l d be used.  at r u n t i m e ) .  No v a l u e  larger  ( L a r g e r v a l u e s may produce i n t e g e r o v e r f l o w  I f the s c a l i n g f a c t o r s f o r X and Y a r e i d e n t i c a l ,  o n l y one  v a l u e need be g i v e n . Example: * SUN: = CIRCLE SCALE .1;  CIRCLE  SUN  D e f a u l t v a l u e s are a s s i g n e d f o r any m o d i f i e r s t h a t are n o t s p e c i f i e d . The d e f a u l t v a l u e s a r e : SCALE 1,1  ANGLE 0 AT .5,.5  Expressions The r i g h t hand s i d e o f an assignment can be an image e x p r e s s i o n . The o p e r a t o r s are (+) f o r s u p e r p o s i t i o n and (—) f o r d e l e t i o n . Example: •* SUNSET:= HORIZON + SUN AT .6,.6; * M00N:= HCIRCLE  SCALE  .1 + HCIRCLE  SCALE  * NIGHT:= SUNSET - SUN + MOON AT . A , . 8 ;  .05,.1;  48  0 SUNSET  Subscripted  MOON  NIGHT  variables  I t may be u s e f u l to a s s i g n that  are n o t a f f i n e t r a n s f o r m a t i o n s  C are defined  the same v a r i a b l e name to p i c t u r e s o f one a n o t h e r .  Assume  that R and  as f o l l o w s :  R  C  Both may be r e f e r r e d to as ELEMENTS ( E ) : * E ( l ) : = R; E(2):= C; * DIAGRAM: = E ( l ) SCALE dx, dy AT x l . ' y l + E(2) SCALE dx,dy AT x2, y2; or a l t e r n a t i v e l y : * E ( l ) : = R SCALE dx, dy AT x l , y l ; * E(2):= C SCALE dx, dy AT x2, y l ;  '•  * DIAGRAM:= E ( l ) + E ( 2 ) ; I d e n t i f i c a t i o n and H i t a r e a An important f e a t u r e  o f each p i c t u r e i t e m i s the s i z e o f the  a r e a s u r r o u n d i n g i t which i s i d e n t i f i e d on the s c r e e n as b e i n g p a r t o f the item.  This  area i s c a l l e d the h i t a r e a o f the i t e m .  The s i z e o f  4 9  the h i t a r e a i s d e f i n e d by the XSCALE and YSCALE a t t r i b u t e s o f the item. T h i s means t h a t the h i t a r e a corresponds i n which the i t e m was d e f i n e d . item d e f i n i t i o n s  to the o r i g i n a l u n i t  square  A d i s t i n c t i o n must be made between  and uses o f i t e m s :  A definition: P:= TRIANGLE SCALE .5; d e f i n e s the i t e m P. o t h e r items,  Every  time  the i t e m p i s r e f e r e n c e d i n d e f i n i n g  a use o f the i t e m P i s c r e a t e d .  o f the u n i t square  I t s h i t a r e a i s the s i z e  o f P, m o d i f i e d a c c o r d i n g . t o the a t t r i b u t e s o f t h i s  use o f P. Example: * PICTURE:= P  SCALE .2,.6  TRIANGLE The  d o t t e d square  of s i z e  AT  .7,.6;  P  .2 by .6 i s the h i t a r e a o f P.  d e f i n e d as a t r i a n g l e , s c a l e d by a f a c t o r - j , P w i l l be r e c t a n g l e s double Note:  For h i t a r e a s i z e ,  PICTURE Because P was  the h i t a r e a o f a l l uses o f  the s i z e o f the t r i a n g l e d i s p l a y e d .  the m o d i f i e r s a p p l i e d t o s u b s c r i p t e d v a r i a b l e s  are c u m u l a t i v e .  5  •  Example: * Q ( 3 ) : = SQUARE SCALE .5; PICTURE:= Q(3) SCALE .2,.6; The h i t a r e a f o r Q ( 3 )  i s .5'(.2 by .6) = . 1 by .3.  f o r t h i s i s t h a t t h e r e i s o n l y one i t e m Q ( 3 ) . a t t r i b u t e s are changed.  The reason  I f i t i s modified, i t s  In c o n s t r a s t , t h e r e may appear, many uses o f P,  50  each w i t h i t s own h i t a r e a . Interaction Identification The  statements:  (crosshairs) wait  on the s c r e e n i s accomplished  as f o l l o w s :  CURSOR ON; WAIT FOR INTERRUPT; cause the c u r s o r  t o be d i s p l a y e d on the s c r e e n and cause t h e program t o  f o r a key to-be p r e s s e d  on the k e y b o a r d .  When a key i s p r e s s e d ,  the X and Y c o o r d i n a t e s o f the c u r s o r  are s t o r e d i n the g l o b a l F o r t r a n v a r i a b l e s XHIT and YHIT and the l i t e r a l code o f the key i n KEYHIT.  (On t h e Nova:  r i g h t b y t e = n u l l j o n the 360:  ASCII code o f key i n l e f t  EBCDIC code o f key i s l e f t  byte,  byte,  r i g h t bytes = b l a n k s ) . The  statement: FOR  HIT ON <variable>:  <statement l i s t >  END;  a l l o w s the user t o determine whether t h e c u r s o r was w i t h i n t h e h i t a r e a of  any i t e m named <variable>.  <statement l i s t >  a r e executed  Is this  t o t h e statement  the statements i n  and the s u b s c r i p t o f the i t e m h i t i s s t o r e d  i n the F o r t r a n v a r i a b l e IHIT. branch  the case,  I f t h e r e was no h i t , t h e program w i l l  f o l l o w i n g the END.  For-statements  b u t the n e s t i n g has to c l o s e w i t h i n each s t a t e .  can be n e s t e d  I f an u n s u b s c r i p t e d  v a r i a b l e i s i d e n t i f i e d on the s c r e e n , t h e v a r i a b l e IHIT c o n t a i n s the v a l u e 0. Example:  •* * FOR HIT ON MENUAREA: * FOR HIT ON DELETE: GOTO STATE 5; END: * FOR HIT ON ROTATE: GOTO STATE 4; END; «  * END;  51  *-'-FOR HIT ON E: * CIRCUIT:= CIRCUIT - E ( I H I T ) ;  * END  * CURSOR ON; WAIT FOR INTERRUPT; * CIRCUIT:= CIRCUIT + NODE SCALE .03 AT XHIT, YHIT; Attribute functions The access  f u n c t i o n s XLOC, YLOC, XSCALE, YSCALE, ANGLE and TAG a l l o w  to t h e a t t r i b u t e s  g i v e n t o any p i c t u r e i t e m .  Note the use o f  the e q u a l s i g n (=). Example: * X I = XLOC (ELEMENT ( I H I T ) ) ; * ANGLE ( E ( I H I T ) ) = ALPHA2; * TAG (Q(3)) = 4; The  last  statement  to be renamed Q ( 4 ) .  will  cause the i t e m p r e v i o u s l y c a l l e d Q(3)  Q(3) now no l o n g e r e x i s t s .  Jumps The  GOTO STATE n statement  b e g i n n i n g o f another  state.  i s used t o t r a n s f e r c o n t r o l t o t h e  W i t h i n a s t a t e , Fortran.GOTO's and l a b e l s  (statement numbers) s h o u l d be used. Example: * GOTO STATE 2; o r GOTO STATE 2;  52  Display  Statements A number o f commands a l l o w the u s e r c o n t r o l over  the graphics  terminal. A d i s p l a y statement  causes an i t e m t o be d i s p l a y e d on the s c r e e n .  Example: * DISPLAY CIRCUIT; DISPLAY R AT XI, Y l ; * DISPLAY 'GOOD MORNING' AT .7,-8; The  e r a s e statement:  ERASE SCREEN w i l l  cause t h e s c r e e n t o be e r a s e d .  P a r t i a l e r a s u r e o f the s c r e e n i s n o t p o s s i b l e . The T e k t r o n i x 4010 The  screen  u n i t square  i s mapped onto the r e c t a n g u l a r s c r e e n as f o l -  lows : 1.3,1  T I I I  1.3,0  The  screen i s p h y s i c a l l y  to a 1 x 1.3 r a t i o . 14 x 22 p o i n t s ) .  a d d r e s s a b l e by 781 x 1024 p o i n t s ,  corresponding  The c h a r a c t e r s i z e on the s c r e e n i s f i x e d  T e x t s t r i n g s are n e i t h e r s c a l e d n o r r o t a t e d .  values, i f given, are ignored f o r d i s p l a y  (approx. Such  purposes.  W r i t i n g t o and r e a d i n g from the t e r m i n a l can f u r t h e r be p r o grammed i n F o r t r a n . WRITE ( 1 0 ) , i n p u t :  The t e r m i n a l i s addressed READ ( 1 1 ) ) .  u s i n g the IGL statement:  Vectors  as. a t e l e t y p e  (output:  can be drawn on the s c r e e n  DRAW FROM x l , y l t o x2, y2. Such v e c t o r s a r e  not s t o r e d i n the data s t r u c t u r e .  53  Example:  C  DRAW A GRID, RASTER SIZE = .05 .. DO 1 I = 1, 21 V = 0.5 * (1-1)  * DRAW FROM 0, V t o 1, V; DRAW FROM V,0 TO V , l ; 1  CONTINUE  Windowing The  display  command a l l o w s a window t o be s e t t o show o n l y  p a r t o f a p i c t u r e on the s c r e e n . Example: * DISPLAY CIRCUIT WITHIN XI, Y l D X l , DY1 ONTO X2, Y2 DX2, DY2;  (virtual picture) Y2  Yl (screen)  DXl Saving and r e s t o r i n g on secondary The  storage  statement:  * STORE nm,n; will  cause the complete IGL d a t a s t r u c t u r e and i n a d d i t i o n a f o l l o w i n g  blank  common a r e a o f n words t o be s t o r e d on a d i s k f i l e w i t h the name  as s p e c i f i e d i n the v a r i a b l e nm. not  T h i s f i l e w i l l be c r e a t e d i f i t does  already e x i s t . The  corresponding  statement:  * RESTORE nm,n; will  cause the f i l e  as s p e c i f i e d i n nm t o be read n and used as the  current data s t r u c t u r e .  54  D i f f e r e n c e s between the IBM  360 v e r s i o n and the Data G e n e r a l  Supernova  v e r s i o n of IGL The d i f f e r e n c e s between the two implementations are t w o f o l d :  1)  The procedure f o r c o m p i l i n g and r u n n i n g IGL i s d i f f e r e n t ,  2)  The two F o r t r a n implementations are  different.  Procedures f o r c o m p i l i n g and e x e c u t i n g IGL programs IBM  360  Datagen First  Supernova  c a r d i n program:  * 360 VERSION  * NOVA VERSION Compiling program:  $R ELEC:XPL  0 = ELEC:.IGLCOM  2 = -OUT  SCARDS = i g l - s o u r c e  SPRINT = i g l - l i s t i n g ' Compiling i n t e r m e d i a t e F o r t r a n $R * FORTRAN SCARDS =  program T r a n s f e r -OUT  -OUT  split  SPUNCH = i g l - o b j e c t  up  programs,  to  X into one  Supernova, individual  f o r each  state,  named STAT01...STATn  or  FORT STAT01; FORT STAT02  $R*'WATFIV PAR=SIZE=40  RLDR STAT01 IGLRUNLIB;  SCARDS= -OUT+ELEC:IGLRUNLIB.S  ...  Execute Program $R igl-object+ELEC:IGLRUNLIB  9=plotfile  ( p l o t s go to p l o t f i l e ) or $R  igl-object+ELEC:IGLAGTLIB ( i n t e r a c t i o n through Adage t e r m i n a l )  IGLGO^ (interaction t r o n i x 4010  through Tekterminal).  ...  55  D i f f e r e n c e s i n the F o r t r a n implementation on the IBM 360 and the D a t a gen  Supernova Below, a l i s t  i s g i v e n o f the major v a r i a t i o n s o f Datagen;.For-  t r a n from the IBM F o r t r a n IV d e f i n i t i o n .  - A l l v a r i a b l e s n o t s t o r e d i n COMMON a r e p l a c e d on a run-time stack.  Any program t h a t does n o t a l t e r COMMON s t o r a g e i s t h e r e f o r e a  r e e n t r a n t program.  ( V a r i a b l e s i n s u b r o u t i n e s ( o r s t a t e s ) a r e n o t saved  from one c a l l t o the next!) - Program u n i t s must be o r d e r e d as f o l l o w s : FUNCTION, SUBROUTINE s t a t e m e n t . - D e c l a r a t i o n statements.  These b e g i n w i t h the keywords COMMON,  COMPLEX, DIMENSION, DOUBLE, EQUIVALENCE, EXTERNAL, INTEGER, LOGICAL o r REAL. .- Statement  f u n c t i o n s and i n t e r n a l  subprograms (FORMAT  statements  .and DATA i n i t i a l i z a t i o n statements may be g i v e n i n t h i s - Executable statements.  (FORMAT statements and DATA  z a t i o n s may be g i v e n i n t h i s  initiali-  area).  - Imbedded b l a n k s a r e s i g n i f i c a n t the  area).  except when they appear i n  name o f a program v a r i a b l e o r i n the statement i d e n t i f i e r GOTO (GO  TO) . - Statement  i d e n t i f i e r s , o p e r a t o r names, and names o f l i b r a r y  f u n c t i o n s a r e r e s e r v e d and cannot be used as program v a r i a b l e s . r e s e r v e d names a r e :  The  56  . AND.  ASSIGN  DATAN  DREAL  LOGICAL  . EOT.  ATAN  DATAN2  DSIGN  MAX0  . EQ.  ATAN2  DATN2  DSIN  MAX1  DSQRT  MIN0  DTAN  MINI  . FALSE.  BACKSPACE  DBLE  . GE.  BINARY  D C ABS  . GT. .LE.  BLOCK  DCCOS  DTANH  MOD  DABS  DCEXP  ENDFILE  PARAMETER  .LT.  CALL  PAUSE  CCOS  DCLOG DCMPLX  ENTRY  .NE.  EQUIVALENCE  READ  . NOT.  CEXP  DCOS  EXP  REAL  . OR.  CLOG  DCSIN  EXTERNAL  RETURN  .TRUE.  CMPLX  DCSQRT  FLOAT  REWIND  ABS  COMMON  DEXP  FORMAT  SIGN  ACCEPT  COMPILER  D EX OAT  FUNCTION  SIN  AIMAG  COMPLEX  DIM  GOTO  SINH  A INT  •  DATA  CONjG  IABS  SNGL  DLOG  IDIM  SQRT  D L O G 10 DMAX1  IDINT  STOP  CSIN CSQRT DABS  D M INI DMOD  IF IFIX  SUBROUTINE  INT  T A N I-1 TYPE WRITE  ALOG  CONTINUE  ALOG10  COS  AMAX0 AMAX1 AMINO AMIN1 AMOD  -  .  DA IMAG  DO  INTEGER  DATA  D O U B L E PRECISION  ISIGN  - Names i d e n t i c a l  TAN  t o DGC extended assembler mnemonics a r e n o t  a v a i l a b l e f o r use as subprogram names. - DATA i n i t i a l i z a t i o n  i s provided  f o r l a b e l e d COMMON o n l y .  - Only COMMON v a r i a b l e s can be EQUIVALENCed. - DATA i n i t i a l i z a t i o n  o f l a b e l e d COMMON i s p o s s i b l e i n any  F o r t r a n program o r subprogram. - Subprogram names must be unique w i t h i n the f i r s t cters  (ANSI s t a n d a r d  five  chara-  issix).  - The c h a r a c t e r s  > and < cannot be used i n H o l l e r i t h . . s t r i n g s .  57  - A l l i n t e g e r s are of length 2 bytes - A l l r e a l s are l e n g t h 4 b y t e s - Data i n i t i a l i z a t i o n statements use the n u l l character.  S Format uses  the n u l l  character  as f i l l  c h a r a c t e r as f i l l  character  (A Format  uses the b l a n k c h a r a c t e r , as on the IBM 360) - Read and w r i t e statements use u n i t numbers 11 and 10. Example: DATA IA/'A'/  AO  DATA IA/'A '/  A^  FORMAT ( A l )  A_  FORMAT(SI)  AO  For complete  information  on IBM F o r t r a n ,  consult:  IBM System/360 FORTRAN IV Language, document For Data G e n e r a l F o r t r a n : DGC FORTRAN IV USER'S MANUAL,  #093-000053.  //C28-6515-7  APPENDIX B  ILLUSTRATIONS FROM IGL PROGRAMS:  NETWORK ANALYSIS, CPM, LOAD FLOW  ROTATE PICK TWO NODES AND AN E L E M E N T ,  L A S T NODE I S  SftUEO  DELETE LABEL UALUES SAME REDRAW ANALYZE PLOT RESTART  Rl<>  ©  r Cl  INSERT DELETE ACTIVITY RELATION REDRAW  MOVE  20 3 12C 52"  DELETE ROTATE KEY  MORO h-  1  62  APPENDIX C  LISTINGS:  (Only r o u t i n e s published  IGL-SYNTAX, IGLCOM  that d i f f e r  from the  XPL d e s c r i p t i o n [12] are shown).  63  P R O D U C T I O N S  1  <PROGRAM>  2  <STATES>  :1=  ESTATES*  !!=  3  <STATE> I  <STATES>  U  <STATE>  ! :=  5  <STATE HEAD>  6 7 8  <STATEMENTL1ST*  <STATE*  <STATE HEAD> :!=  STATE ::= I  <STATE ENDING> . S:= ::=  <STATEMENT>  20  <PICTORIAl  21  N U M E R I C A L ASSIGNMENT*  22  <REPLACE>  23 24  <DISPLAY  25 26  <VIRTUAL  27 28  < IM A G E *  ASSIGNMENT*  t  <NUMBER>  J'.=  <VARIABLE*  ::=  <F0RTRAN  !:= I  29  ::= I I  >  <REPLACE*  VARIABLE*  <EXPRESSION*  = <FORTRANVARIABLE*  =  STATEMENT*  IMAGE*  <STATE ENDING*  <PICTORIAL ASSIGNMENT> j <NUMER 1 CAL ASSIGNMENT> f <0ISPLAY S T A T E M E N T * J <F0R CONSTRUCT* f <GOTO S T A T E M E N T * J <WAIT S T A T E M E N T * J <TRACKING S T A T E M E N T * f <ERASE S T A T E M E N T * ; <HUOT S T A T E M E N T * ) <FILE STATEMENT* J 1  I I I I I I I I I I  tt =  <STATEMENTLIST>  STATEMENT* <STATEMENTLIST> <STATEMENT> END S.TATE <NUHBER*  9 10 11 12 13 1« 15 16 17 IB 19  "  :  ::s I  DISPLAY DISPLAY  <VIRTUAL <VIRTUAL  IMAGE* IMAGE* ONTO <VALUEPAIR>  <VALUEPAIR>  <IMAGE* < I M A G E > EVALUATION*  <VAR I A B L E * <VARIABLE> WITHIN  <VALUEPAIR*  <VALUEPAIR*  <STRING*  30  <FOR  CONSTRUCT*  l?=  <F0R S T A T E M E N T *  31  <F0R  STATEMENT*  ::=  FOR HIT  32  <END S T A T E M E N T *  ::=  END  :  < S T A T E H E N T L I S T * <END  ON < V A R I A B L E *  STATEMENT*  64  33 31  <GOTO 3 T A T E M E N T >  ::= GOTO S T A T E <NUMBER> I GO TO STATE <NUMBER>  35  <WAIT  36 37 38  <TRACKING ST.ATEMENT>  39  <ERASF S T A T E M E N T *  AO  <PLOT  STATEMENT >  :;=  PLOT  11 12  <FILE  ST ATEMENT>  It-  STORE <FORTRAN VARIABLE> RESTORE <FORTRAN V A R I A B L E *  13 11  <EXPRESSION>  15 16  <DIADIC  17 18  <PRIMARY>  19 50  <UNARY  51 52  <VALUATED VARIABLE>  53 51 55 56  <ITEM* •  57  <VARIABLE>  11 =  STATEHENT>  WAIT I I-  CURSOR ON READ CURSOR <VALUEPAIR> READ KEY F O R T R A N VARIABLF.>  I I ::=  ERASE  .1 :;=  OPERATOR>  :j=  <COMPONENTPAIR>  <OIADIC  <VALUATP.D VARIABLE> <VALUATED V A R I A B L E *  I OPERATOR*  ::=  :!=  <ITEM> <ITEM>  I  ::=  <VALUATION>  <IDENTIFIER> <TAGGEO VARIABLE>  59  <TAGGED VARIABLE>  60 61  <FORTRAN VARIABLE>  ti~  <I DENT I F I E R >  t: = I  62  I  <COORDINATE  C O O R D I N A T E FUNCTION>  61  <FUNCTIONHEAD>  ::=  <FUNCTIONNAME>  65  <FUNCTIONNAME>  ::=  XLOC  <COKPONENTS>  ::=  I  :;s  (  <FORTRAN V A R I A B L E *  <IDENTIFIER> <NUMBER*  63  73  <UNARY OPERATOR>  <VARI A B L E * <STRING> VALUE ( <F0RTRAN VARIABLE> ) TEXT ( <FORTRAN VARIABLE> )  I  <VALUATION>  <PRIMARY>  VSYH < F 0 R T R A N VARI ABl,E> • HSYM <F0RTRAN VARIABLE>  I  58  66 67 68 69 70 71 72  OPERATOR>  + -  I  :'. = I I I  SCREEN  <PRIMARY> <EXPRESSION>  I  ::=  FOR INTERRUPT  »: =  FUNCTION>  <FUNCTIONHEAD>  I YLOC I XSCALE t YSCALE I ANGLE I TAG COMPONENTS* <COMPONENTPAIR> <COMPONENT>  (  <VARIABLE>.)  )  65  I  71 75 76 77 78 79  <COMPONENT>  ::=  80  <COMPONENTPAIR>  81  <VALUEPAIR>  I I I I  t:=  <C0MP0NENT3>  <COHPONENT>  AT <VALUEPAIR> SCALE <VALtJEPAIR> SCALE <FORTRAN VARIABLE> ANGLE <FORTRAN VARIABLE> TAG <EORTRAN VARI ABIE> ll~  FROM <VALUEPAIR> TO <VALUEPAIR>  <FORTRAN VARIABLE> ,  <FORTRAN VARIABLE>  66  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47  /ft  CARD  IMAGE  HANDLING  PROCEDURE  $L  GET_CARD V PROCEDURE? /* DOES A L L CARD R E A D I N G AND L I S T I N G DECLARE I F I X E D , (TEMP, TEMPO, R E S T ) CHARACTER, READING B I T ( l ) ; DECLARE FIRST-CARD BIT CI) I N I T I A L (TRUE)) READ! BUFFER = INPUT; I F L E N G T H ( B U F F E R ) = 0 THEN DO; /* S I G N A L FOR E O F * / C A L L ERROR C E O F M I S S I N G OR COMMENT S T A R T I N G I N C O L U M N B U F F E R = P A D ('* / * • ' / * */ E O F ; E N D ; E O F ', 8 0 ) ; END; 1  *,  */  1,1,1)  E L S E C A R D _ C O U N T = CARD_COIJNT + 1) / * U S E D TO P R I N T ON L I S T I N G * / / * O U T P U T F I R S T L I N E B E F O R E F I R S T CARD * / I F F I R S T _ C A R D = T R U E T H E N DO; F I.RST_C AR D = F A L 5 E ; E N D ; /* E L I M I N A T E F O R T R A N C A R D S */ DO J = 0 TO 1 3 ; I F BYTE ( B U F F E R , 0 ) = B Y T E ( C 0 1 2 3 4 5 6 7 8 9 X A I , J ) THEN DO; I F C O N T R O L ( B Y T E ( ' M l ) ) THEN O U T P U T = B U F F E R ; E L S E I F C O N T R O L ( B Y T E ( * L ' ) ) THEN OUTPUT = I _ F 0 R M A T ( C A R D — C O U N T , 4 ) 1 I f I I |BUFFER; • OUTPUT(2)=BUFFER; GOTO R E A D ; END; END; ' I F M A R G I N „ C H O P > 0 THEN DO; / * THE M A R G I N C O N T R O L FROM D O L L A R | */ I = L E N G T H ( B U F F E R ) * MARGIN_CHOP; REST = S U B S T R ( B U F F E R , I ) ; B U F F E R = S U B S T R ( B U F F E R , 0, I ) ; END; E L S E REST = " ; S=SUBSTR(BUFFER,0,1); BUFFER=SUBSTR(BUFFER,1); TEXT = B U F F E R ; TEXT_LIM1T = LENGTH(TEXT) - 1 ; . I F C O N 1 R O L C B Y T E C » M ) ) THEN OUTPUT = S I I B U F F E R ) E L S E I F C O N T R O L ( B Y T E ( ' L ) ) THEN OUTPUT = I — F ORMAT ( C A R D „ C O U N T , 4 ) l l » ' l | S II B U F F E R II REST; C P = 0; END G E T . C A R D ; 1  1  1  67  1 2 3 1 5 6 7 8 9 10 11 12 13 11 15 16 17 18  19 20 21 22 23 21 25 26 27 28 29 30 31 32 33 31 35 36 37 38 39 10 11 12 13 11 15 16 17 18 19 50 51 52 53 51 55  ADD_FORTRAN_VAR s PROCEDURE; /* KEEP A L I S T  OF FORTRAN  V A R I A B L E S USEO */  END ADD_FORTRAN_VAR; RESET: PROCEDURE? /* RESET VALUATION TO DEFAULT VALUES */ L0C=',5,,5i; SCALES'1,, 1 , l » ANGLE='0 !j T AG= ' 0 ' ? RETURN; END RESET; PAD_8S PROCEDURE; /* PAD VARIABLENAME WITH BLANKS */ I = LENGTH(VAR(MP) ) ; I F I>8 THEN VAR(MP)=SUBSTR(VARCMP ) , 0,8) ; I F I<8 THEN DO; S =SU8STRP »,I)> VAR(MP)=VAR(MP) I I S ; END; ' RETURN; END PAD-.8; EXOUTt PROCEDURE(VARTYPE , PRCODE,EXCODE ) ; DECLARE (VARTYPE,PRCODE,EXCODE) F I X E D ; DECLARE F I L E O U T L I T E R A L L Y ' OUTPUT(2) CALL ' M l ' j DECLARE CONTINUATION L I T E R A L L Y 'OUTPUT(2) = " *M||»; IF EXC0DE=3 THEN FILEOUT 'ASS I G ( M I V A R ( M P - 2 ) I I ' ) I ; DO CASE V A R T Y P E ; ; F I L E O U T < PRIMA ( ' I IPRCODE I I ' , M IEXCODEI I ', ' I IVAR (MP) | I ' , ' I I LOC ! I ' / M l SCALE I I ' , • I I ANGLE I I ' , M | TAG I I ' ) ' ; F I L E O U T 'PRIMS( ' I I PRCODE I M , ' I IEXCODEI I ' /M I LOCI I I,' '»I I V A R ( M P ) I I I ' < ) FILEOUT 'PR I M C ( I IPRCODEI I ',' I I EXCODE I I ' , ' I ILOC I I ' , < I I V A R ( M P ) | | • ) FILEOUT ' PR I MS ( ' I I PRC ODE I I ' , ' I I EXCODEI I ', • I ILOC I I , ' I I VAR(MP ) | | ' ) END; CALL RESET; RETURN; END EXOUT; SYNTHESIZE: PROCEDURE(PRODUCT ION_NUMBER); DECLARE PRODUCTION_NUMBER F I X E D ; DECLARE L A B E L — S T ACK ( 1 0 0 ) CHARACTER , LP F I X E D I N I T I A L ( 0 ) ; DECLARE CARDNO.STACK (1 00 ) F I X E D ; DECLARE STMTNO F I X E D I N I T I A L ( 1 0 0 0 ) ; DECLARE UNARY_OP CHARACTER; DECLARE (NUM„VALUE,VARTYPE,FTYPE) F I X E D ) DECLARE I K _ V A L U E F I X E D ; DECLARE (EXCODE, PRCODE ) F I X E D ; DECLARE (FNAME,VARNAME,VART AG) CHARACTER; DO CA5E PRODUCTION_NUMBER; ; /* CASE 0 I S A DUMMY */ /* <PROGRAM> ::= <STATES> */ I F MP-» = 2 THEN o  -  1  1  68  56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 9U 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110  Hi  112 113 114 115  DO; C A L L ERROR ( EOF AT I N V A L I D P O I N T ' , 1 ) ; C A L L S T A C K „ DUMP; END; E L S E DO; I F L P - i = 0 T H E N DO 1 = 1 TO L P ; C A L L E R R O R ( 'UNMATCHED F O R " S T A T E M E N T , L I N E : ' 1 1CARDNO -STACK(LP) END; COMPILING=FALSE; END; < S T A T E S > :s= < S T A T E > */ 1  /* ?  /*  ;  <STATES>  I!=  <STATES>  <STATE>  */  EE NDING* <STATE> <ST ATE HEAD> t < S T A T E M E N T t-I S T >,' < S T A T VAR C M P ) T . V A R ( M P P 1 + 2 ) THEN C A L L ERROR ( ' L A B E L '1 1 V A R ( M P ) | | 'AND V A R C M P P 1 + 2 ) 1 1 ' DON ' ' T M A T C H . ' , 0 ) ; /* < S T A T E HEAD> : := S T A T E <NUMBER> */ DO; I F L E N G T H ( V A R ( S P ) ) = 1 T H E N S= • 0' 1 1 V A R ( S P ) ) ELSE S=VAR(SP); I F C O N T R O L ( B Y T E ( ' D ' ) ) THEN OUTPUT(2)=' SUBROUTINE STAT M I S ; — I; ----- S T A T E 1 1 I V A R ( M P P l ) 1 1 0UTPUT(2)='C OUTPUT(2)=» LOGICAL HIT0N'; OUTPUT(2)=' COMMON 1 D U M M Y ( 3 3 7 6 ) « ; VAR(MP)=VAR(MPP1); END; /* < S T A T E M E N T L I S T > ::= < S T A T E M E N T * */ /*  IF  /*  ;  •  <STATEMENTLIST>  ::=  <STATEMENTLIST>  <STATEMENT>  END  */  */ i < S T A T E E N D I N G * 5J= END S T A T E <NUMBER> DO; VAR(MP)=VAR(SP); 0UTPUT(2)='C END S T A T E > 1 1 V A R ( S P ) I I ' - — f<mm 1 J I F C O N T R O L C B Y T E ( ' D ' ) ) THEN RETURN'; 0UTPUT(2)=< OUTPUT(2)=' END'; EJECT-PAGE; OUTPUT=' INTERACTIVE GRAPHICS COMPILER (FEB 73 V E R S I O N ) ' ; DOUBLE-SPACE; CARD_COUNT=0; END; /* <STATEMENT> = <PICTORIAL ASSIGNMENT* ; */ /*  /* /* ,  /* /* /* /* /*  ;  ; ;  ; ; ; ;  <STATEMENT*  ::= N U M E R I C A L  <STATEMENT>  :; = < D I S P L A Y  <STATEMENT> <STATEMENT> <STATEMENT> <STATEMENT> <STATEMENT*  ::= <FOR  STATEMENT*  CONSTRUCT*  ;  <GOTO S T A T E M E N T * 1!= <K A I T  STATEMENT*  <TRACKING ::= < E R A S E  */  ASSIGNMENT* ; */ */ ;  */  ;  */  STATEMENT*  STATEMENT*  ;  J  ;  */ */  '  69  116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166  /*  <STATEMENT>  : !=  <PLOT  STATEMENT*  t  <STATEMENT>  t»=  <FILE  STATEMENT*  ;  /ft | /*  OTATEMENT*  .•:=  ;  */  ; /*  <PICT0R1AL  ASSIGNMENT* '.'.=  <VARI A B L E *  <REPLACE*  <EXPRESSION*  */  t  /*  <NUMERICAL ASSIGNMENT* !:= <F0RTRAN V A R I A B L E * = <F0RTRAN V A R I A B L E * */ B Y T E C V A R ( M P ) ) = BYT E C ' ' ) THEN DO; K=LENGTH(VAR(MP))»9; VAR(MP)=SUBSTR(VAR(MP),8,K); F I L E O U T ' CHCHOR(I I IVAR(MP)I I I,' I I V A R ( S P ) I I ' ) ; END; ELSE 0UTPUT(2) = t ' I IVAR(MP) | I I = M I V A R ( S P ) ; /* <REPLACE> : J = : = */ ; /* <DISPLAY S T A T E M E N T * t:DISPLAY <VIRTUAL IMAGE* */ DO; DO CASE I M _ V A L U E ; F I L E O U T ' D I S P L ( ' I IVAR ( S P ) I I » , M I LOC I M , I ISCALE I I I, I | | ANGLE I I') ; DO; IF L E N G T H ( V A R ( S P ) ) > 5 0 THEN V A R C S P ) = S U B S T R ( V A R ( S P ) , 0 , 5 0 ) ; F I L E O U T » D I S P S ( « • I I VAR(SP ) I | I M , I ; CONTINUATION LOCI I l , I ILENGTHCVAR ( S P ) ) I M ) ' ; END; END; CALL R E S E T ; END; / * <DISPLAY S T A T E M E N T * J!= D I S P L A Y <VIRTUAL IMAGE* ONTO <VALUEPAIR> <VALUEPAIR: */ IF IM_VALUE = 0 THEN DO; F I L E O U T ' D I S P O ( M I V A R ( M P ) | I • , M IVAR(MP + 2)I I ' , M I V A R ( S P ) I I I ) I ; END; /* <VIRTUAL IMAGE* :J = <IMAGE* */ ; /* <VIRTUAL IMAGE* ::= <IMAGE> <VALUATION* */ ; /* <IM A G E * ;:= <VARI A B L E * */ IM„VALUE=0; /* <IMAGE> » ; = <VARI A B L E * WITHIN <VALUEPAIR> < V A L U E P A I R * */ DO; S = V A R ( S P - 1 ) I I ' , I I IVAR (SP) ; F I L E O U T ' W I T H I N ( 1 I 131 I < ) I > IM_VALUfc'=0; END; /* <IM A G E > ::= <STRING* */ IM_VALUE=1; /* <FOR S T A T E M E N T * t:= FOR HIT ON <VARI A B L E * */ DO; OUTPUT(2) = ' 0 I I I L A B E L - S T A C K ( L P ) I I I C O N T I N U E ' ; . IF  1  1  1  1  1  167  LP=LP-l; END; /* <FOR CONSTRUCT* DO; LP = LP + H  172  */ .  168 169 170 171 173 174 175  */  >  ::=  <FOR  STATEMENT*  t  <STATEMENTLIST>  <END  STATEMENT*  STMTNOsSTMTNO + 1;  LABEL—STACK(LP)-STMTNO; CARDNO_3TACK(LP)=CARD-COUNT; OUTPUT(2) = " I F ( , N Q T , HITON("  I IVAR (MPP 1+2)11  I))  GOTO 0•I  I  *,  70  176 177 178 179 180 181 182 183 184 185 186 167 188 189 190 191 192 193 191 195 196 197 198 199 200 201 202 203 204 205 -206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235  LABEL-STACK(LP)J END; /* <END STATEMENT* 51= END ft/ ; /* <G0T0 STATEMENT* :s= GOTO STATE <NL)MBER* */ DO; I F L E N G T H U A R ( S P ) ) = 1 THEN V A R ( S P ) = 0 ' I I V A R ( S P ) ; I F C O N T R O L ( B Y T E ( t D ' ) ) THEN 0UTPUT(2)=' CALL ST AT I IVAR (SP ) | ELSE FILEOUT ' C H A I N ( S T A T I I V A R ( S P ) I I I ,SV) ' ; END; /* <GOTO STATEMENT* t:= GO TO STATE <NUMBER* */ DO; IF L E N G T H ( V A R ( S P ) ) = 1 THEN V A R ( S P ) = »0 I I |VAR(SP ) J I F C0NTROL(BYTE(»D') ) THEN 0UTPUT(2) = I CALL STAT I IVAR (SP ) J ELSE FILEOUT 'CHAIN(STAT ' I I V A R ( S P ) I I l ,SV) ' ; END; /* <WAIT STATEMENT* :s= WAIT FOR INTERRUPT */ FILEOUT M v A I T I N l ; /* <TRACKING STATEMENT* !:= CURSOR ON */ FILEOUT 'CURSOR'; /* <TRACKING STATEMENT* ::= READ CURSOR <FDRTRAN P A I R * */ FILEOUT 'RDCUR( ' I I V A R ( S P ) I I ' ) ' ; /* <TRACKING STATEMENT* ::= READ KEY <FORTRAN V A R I A B L E * */ FILEOUT ' RDKEY ( I I VAR ( S P ) I I ' ) ' ; /* <ERASE STATEMENT* :;= ERASE SCREEN */ FILEOUT 'ERASE'; /* <PLOT STATEMENT* ::= PLOT <COMPOMENTPAIR* */ FILEOUT l DRA*K U ILOCI I <, ' I I SCALE I I ' , U I ANGLE I I ') ' ? /* < F11. E STATEMENT* ::= STORE <FORTR AN V A R I A B L E * */ FILEOUT ' SAVE ( M I VAR (SP ) I M ) ' ; /* <F1LE STATEMFNT* :: = RESTORE <FORTRAN V A R I A B L E * */ FILEOUT 'RESTOR ( M IVAR ( S P ) I I ' ) ' ; /* <EXPRESSION* :s= <PRIMARY* */ DO; EXC0DE=3; CALL EXOUT(VARTYPE,PRCODE,EXCODE)> END J /* E X P R E S S I O N * ::= E X P R E S S I O N * <DIADIC OPERATOR* <PR1MARY> DO; VAR(MP)=VAR(3P) ; CALL EXOUT(VARTYPE,PRCODE,EXCODE); END; /* <DIADIC OPERATOR* t;= + */ ' EXCODE=l; /* <DIADIC OPERATOR* ; j = * */ EXCODE=2; /* <PRIMARY> ::= <VALUATED V A R I A B L E * */ PRCODF=0; /* <PRIMARY* ;:= <VALUATED V A R I A B L E * <UNARY OPERATOR* */ DO; FILEOUT ' UNARY ('I I UNARY-OP I H ) ' ; PRCODE=l; END; /* <UNARY OPERATOR* ::= VSYM <FOKTRAN V A R I A B L E * */ UNARY—OP='l, ' I I V A R ( S P ) ; /* <UNARY OPERATOR* ::= HSYM <FORTRAN V A R I A B L E * */ 1  1  1  1  1  */  71  236 237 238 239 24 0 241 242 243 244 245 246 247 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 268 289 290 291 292 293 294 295  UfsiARY„OP= 1 2 , M I VAR ( S P ) <VALUATfO V A R I A B L E * ; /* <VALUATE0 V A R I A B L E * /*  ; : : =  <ITEM*  =  <ITEM>  <VALUATION>  */  */  ;  /* /*  /*  /*  /*  • /* /*  /* /*  /*  < I T E M * :?= ^VARIABLE* */ VARTYPE=1 ; <ITEM> S 5 = <STRING> */ DO; I ~L E NGT H(VAR(MP ) ) ; I F I >16 THEN V A R ( M P ) = S U B S T R ( V A R ( M P ) , 0 , 1 6 ) | IF K 1 6 THEN D O ; S=SUB9TR(( VAR(MP)uVAR(MP) I IS; END J VARTYPE=2; END; <ITEM> ::= VALUE ( <FORTRAN V A R I A B L E * ) */ DO; VARTYPE"3; VAR(MP)=VAR(MPP1+1); END; < I T E M * JS= TEXT ( <F0RTRAN V A R I A B L E * ) */ DO; VARTYPE=4; V A R ( M P ) = V A R ( M P P 1 + 1) ; END; <VARIABLE> ; : = <IDENTIFIER> */ DO; CALL PAD-.8J VARNAME--VAR (MP) ; VARTAG-'O'; V A R ( M P ) = » 1 1 • I I V A R N A M E I M ' ',' M V A R T A G ; END; <VARIABLE* « : = <TAGGED V A R I A B L E * */ ; <TAGGED V A R I A B L E * : : = < I O E N T I F I E R > ( <FORTRAN V A R I A B L E * DO; CALL PAD_8; VARNAME = V A R ( M P ) ; V A R T A G = V A R ( M P P 1 + 1) ; K= LENGTH(VARTAG)-1 ; IF B Y T E ( V A R T A G , K ) = R Y T E ( ' . ' ) THEN VARTAG = S U B S T R ( V A R T A G , 0 , K ) ; V A R ( M P ) - ' 1 ' t | IVARNAMEI I 1 ' ' / 1 I I V A R T A G ; END; <FORTRAN V A R I A B L E * : : = <I DENT I F I E R * */ CALL ADD-FORTRAN„VAR; <FORTRAN V A R I A B L E * ! « = <NUMBER* */ / * C H E C K FOR D E C I M A L DOT I N NUMBER */ DO; K=0; DO 1=0 TO L E N G T H ( V A R ( S P ) ) - l j I F B Y T E ( V A R ( S P ) , I ) = B Y T E ( ' , ' ) THEN K = l ; END; IF K = 0 THEN V A R ( S P ) = V A R ( S P ) I I 1 , ' ; END; <F0RTRAN V A R I A B L E * t ! " COORDINATE FUNCTION* */ I F F T Y P E = 6 THEN V A R ( M P ) = ' I T A G F N ( M I VAR (MP ) I I ' ) « ; ELSE  )  */  72  296 297 298 299 300 301 302 303 304 30b 306 307 306 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346  /* /* /* /* /* /* /* /* /* /* /*  VAR(MP)-! CORFUN(I | I VAR (MP) I I I ) I j COORDINATE FUNCTION* ::= < F U N C T I 0 N H C A D > <VARI ABLE* II- FTYPE = 6 THEN VAR(MP)=VAR(Mpp i ) j ELSE VAR(MP)=FTYPEIM,'IIVAR(MPP1); <FUNCIIONHEAD* ::= < F U N C TI 0 N N A M E > ( */ ; < F U N C TI 0 N N A M E * ::= XLOC */ FTYPE =1; <FUNcT 10NN A(•'E* : : = YLOC */ FTYPE = 2 ; <FUNCTTONNAME* : ! = XSCALE */ FTYPE = 3; < F U N C 1IONNAME* : ; = YSCALE */ FTYPE = 4; <FUNCTIONNAME> ::= ANGLE */ FTYPE = 5 ; <FUNCTIONNAME* :s= TAG */ FTYPE=6; <VALUATION* :J= <C0MP0NENT3* */ ; <VALUATION* : i = COMPONENTPAIR* */  1  COMPONENTS*  ll"  COMPONENT*  /*  COMPONENTS*  ::=  COMPONENTS*  /*  COMPONENT* LOC=VAR(SP); COMPONENT* SCALE--VAR(SP) ; COMPONENT* 3CALt = VAR(SP)I COMPONENT* ANGLEsVAR(SP) ; COMPONENT*  )  */  */  ;  /* /* /* /*  DO;  t : = AT <VALUEPAIR* ::=  END >  CQMPONENTPAIR*  DO;  */  SCALE <FORTRAN VARIABLE* I • , • I IVAR(Sp); llANGLE <F ORTRAN VARIABLE* ::=  TAG <FORTRAN  tl-  */  */  SCALE <VALUEPAIR>  TAG=VAR(SP)f K = l.ENGTH(TAG)-l ; IF BYTE(TAGfK) = BYTE(' , ') TAG=SUBSTR(TAG,0,K);  /*  COMPONENT*  VARIABLE*  */ */ */  THEN  FROM <VALUEPA1R> TO  <VALUEPAIR*  */  L0C = VAR(MPP1) ; SCALE=VAR(SP); ANGtE='-999, « ;  END; /*  END  <VALUEPAIR* = <FORTRAN VARIABLE* VAR(MP)=VAR(MP)IM,M|VAR(SP); END J SYNTHESIZE;  ,  <FOR TRAN VARIABLE*  */  73  APPENDIX D  Device Dependent Support  Routines:  Supernova:  INCOM, RETUR, OVERL, CHAIN.  Adage /10:  AGTLIB  (programmed by H. R y d z i k ) .  ;P/R TO CHANGE VALUE OF <*f:MAX0 ;TO POINT TO THE BOTTOM OF BLANK COMMON AREA CALL INC Oil {TO CALL « • TITL .NREL .ENT .EXTD • EXTM  ;  IHCOM ItJCOM .CPYL,.FRET ERROR  FS. = 0  T  It.'COMJ  FS. JSR LDA NEG .SYSTM .MEM I JMP JSR  .ERORJ  ERROR  SIZE?  000410  O.CPYL 0,CSIZE 0,0  J  &.EROR ©.FRET  I J &RETURN TO CALLING PROGRAM  GET SIZE OF BLANK COMMON AREA ;MAKE DECREMENT  COMMON SIZE  .END  S/R TO RETURN FROM OVERLAY SEGMENT CALL RETUR TO CALL : .TITL .NREL .ENT RETURt  ERROR?  .SYSTM .RTN .SYSTM .ERTN JMP .END  RETUR RETUR,ERROR  ;S/R TO OVER A.!Y FORTRAN PROGRAMS $TO CALL J CALL OVERL N (' AME OF SEGMENT)' .TITL N . REL OVERL E . NT VERL E . XTD O .CPYL,.FRET • EXTJ' ERROR TEXT=-!S7 FS. = 1  OVERL:  JSR LDA MOVZL SUB .SYSTM  E . XEC  JMP JSR  .ERORt  ERROR  9.CPYL  G ; ET POINTER TO NAME ;IN AC0 ?CLEAR AC 1 ;CALL IN SEGMENT  0,TEXT,5:MAKE BYTE POINTER  0,0  @.EROR  ©F . RET  ;RETURN  TO C A L L I N G  PROGRAM  • END  : S / R TO CHAIN ; T O C A L L .• .TITL .NREL .ENT .EXTD .EXTN  OVERLAY SEGMENT C A L L CHAIN ( ' N A M E  OF SEGMENT *>  CHAIN CHAIN .CPYL.,.FRET ERROR  TEXT=-167  JSR FS.  CHAINS  LDA MOVZL SUBZR .SYSTM  @.CPYL ; G E T POINTER TO NAME 0 , T E X T , 3 ; F O R M B Y T E POINTER IN AC0 0,0 1,1 ; S E T AC 1 B I T 0  .EXEC .ROR JMP ©E ©F . RET JSR .EROR: »  ERROR .END  &RETURN  TO C A L L I N G  PROGRAM  76  1 2 3 4 5 6 7 6 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 5« 55  C I N T E R A C T I V E A D A G E P A C K A G E FOR P I E K E ' S I G L SYSTEM--C - - - O B J E C I DECK C O N T A I N S S C O N T I N U E WITH A G T j B A S I C T H E R E B Y C O N C A T E N A T I O N OF THAT F I L E I S NOT REQUIRED, SUBROUTINE WA1TIN C P R O V I D E S THE I N T E R A C T I O N - R E A D S K E Y B O A R D AND C R O S S H A I R LOCATION LOGICAL FLAG /.TRUE,/ INTEGER P L O T / i PLOT ' / , Y E S / ' Y '/ COMMON/CURSOR/I H I T , X H I T , Y H I T , K E Y H I T REAL 0(b) IF (FLAG) WRITE(6,30) 30 F O R M A T C A K E Y B O A R D E N T R Y OF PLOT WILL AUTOMATICALLY'/ *' C O P Y THE D I S P L A Y AS A P L O T F I L E ON L O G I C A L U N I T 9,'// *' U N S P E C I F I E D L O G I C A L U N I T P U T S P L O T F I L E I N -PLOT*,') FLAG=,FALSE, 1 CALL AGTMUV(5925,1,37) C A L L D I S P L A Y S R E A D Y M E S S A G E ON SCREEN READ(5,10)KEYHIT 10 FORMAT (Aa) CALL AGTMOV(5888,1,37) C A L L D I S P L A Y S W A I T I M E S S A G E ON SCREEN C---A K E Y B O A R D E N T R Y OF PLOT WILL AUTOMATICALLY C O P Y THE D I S P L A Y AS A P L O T F I L E ON L O G I C A L U N I T 9,--I F ( K E Y H I T , E Q , P L 0 T ) GO TO 1 0 0 CALL D I A L S ( D ) XHIT=(DC4)+l,)*512,/780, YHJT=(D(l)+i,)*512,/78Q, RETURN 100 N F L AG = 0 WRITE(6,20) 20 F O R M A T ( ' ' , ' I S T H I S TO BE THE L A S T P L O T ? ' ) READ(5,21)1 REPLY 21 F O R M A T ( A 1) IF ( I R E P L Y . E O . Y E S ) N F L A G s l CALL SAVE(NFLAG) GO TO 1 END C- - - - - SUBROUTINE ERASE C E R A S E S S C R E E N A NO I N I T I A L I Z E S THE TERMINAL INTEGER DISP(112) LOGICAL F L A G / . F A L S E , / COMMON/POINTR/NV I F ( F L A G ) GO TO 2 0 0 F LAG= .TRUE. CALL A G T C V T ( D I S P ( 1 ) , 0 , , 0 , , 0 , 1 ) C A L L G E N E R A T E S AN EOF C O N D I T I O N TO K E E P S T O R E D M E S S A G E S FROM B E I N G D I S P L A Y E D CREATE MESSAGES C A L L A G T E X T ( - 5 , , 7 , , 1 , , ' W A I T I I ,0 , , 5 , D I S P ( 2 ) , N V 0 ) DO 1 0 0 J = 3 3 , 3 8 100 DISP(J)=0 C A L L A G T E X T ( - 5 , , 7 , , 1 , , • R E A D Y ' , 0 , , 5 , D I S P ( 3 9 ) , NVD) CREATE BLANK MESSAGE DO 3 0 0 J = 7 6 , 1 1 2 300 DISP(J)=0 200 CALL A G T D S P ( D I S P ( 1), 1 12,5887,,TRUE,,0)  77  56 57 58 59 60 61 62 63  64  65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 11 1 112 113 114 115  CALLS  C C  C A L L AGTMOVC5B88, 1 , 37 ) WAIT! MESSAGE NV-37 RETURN END  SUBROUTINE VECTOR(Xi,Y1 ,IDRAw) DRAWS A V E C T O R FROM P R E V I O U S P O S I T I O N UP OH D O » . \ (IDRAW = 0 OR i )  LOGICAL  TO NEW X t , Y l  WITH P E N  FLAG/,TRUE,/  INTEGER DISP COMMON/POINTR/NV IF ( F L A G ) C A L L CHECK FLAGs,FALSE, X = Xl  v=ri  CALL T S C A L E ( X , Y ) NV=NV+1 C R E A T E V E C T O R AND S E N D TO AGT C A L L AGTCVT ( D I S P , X , Y , I D R A W , 0 ) CALL A G T D S P ( P I S P , 1 , N V , , F A L S E , , 0 ) RETURN END SUBROUTINE D I S P S ( I S , X I , Y l , N C ) C THIS ROUTINE DYNAMICALLY A L L O C A T E S S U F F I C I E N T S T O R A G E FOR D S T E X T C A L L S D S T E X T , THEN D R O P S S T O R A G E IMMEDIATELY, EXTERNAL DSTEXT LOGICAL FLAG/,TRUE,/ INTEGER*2 I S U ) IF ( F L A G ) C A L L CHECK FLAG=,FALSE, N=NC*10 CALL G S P A C E ( P 0 I S P , N * 4 ) CALL C A L L E R ( D S T E X T , P D I S P , I P T R ( N ) , I P T R ( I S ) , I P T R ( X I ) , I P T R ( Y l ) # HPTR(NC)) CALL F S P A C E ( P D I S P ) RETURN END  C  100  C  S U B R O U T I N E D S T E X T ( D I S P , N , I S , X I , Y l ,NC) D I S P L A Y S A C H A R A C T E R S T R I N G OF NC C H A R A C T E R S AT X I , Y l INTEGER DISP(N),IS*2(1) COMMON/POINTR/NV NVcNV+1 X = X1 Y = Y1 CALL T S C A L E ( X , Y ) CALL A G T F . X T ( X , Y , 7 8 . / ? 5 6 , , I S , 0 , , N C , D 1 3 P ( 1 ),NVG) I F ( N V G . E U . O ) GO TO 1 0 0 CALL A G T D S P ( D I S P ( 1 ) , N V G , N V , , F A L S E , , 0 ) NV = NV + NVG-?1 RETURN END SUBROUTINE TSCALfc*(X,Y) L I M I T S X AND Y V A L U E S AND S C A L E S  I F ( X , L T , 0 , ) X=0,  FROM  IF(X,GT,1024,/780,) X=l024,/780, I F ( Y , L T , 0 . ) Y=0,  I G L TO AGT  7 8  116 117 116 119 120 121 122 123 124 125 126 127 128 129 130 131 132  IF(Y,GT,1.) Y=l, x =x * 7 n o , / 5 i ,2-10, Y=Y*780,/51,2-10 RETURN END C - - - - - - - - - - - - - - - - SUBROUTINE SAVE ( M F L A G ) C R E A D S THE B U F F E R AT THE AGT AND COMMON/PuINTR/^V CALL AGTM0VC5962,1/37) C A L L S BLANK MESSAGE CALL A J P L O T ( 1 0 , , N V ) CALL AGTMOVC5888,1,37) C A L L S WAIT I M E S S A G E I F ( N F L A G . E Q , 1 ) CALL PLOTND RETURN END t  SENDS  133 c«---------  134 135 136 137 138 139 140 141  C C  SUBROUTINE CHECK E N S U R E S THAT E R A S E HAS B E E N I N I T I A L I Z E SCREEN, LOGICAL FLAG/,TRUE,/ I F ( F L A G ) CALL ERASE FLAG=,FALSE, RETURN END  -  CALLED  DISPLAYED  IMAGE  TO L O G I C A L  UNIT  „--.--,.-.,..--,.-BEFORE  VFCTOR  AND  DISPS  TO  9,  

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

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-0101250/manifest

Comment

Related Items