UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

A structured language for interactive graphics Teeple, Douglas William Lloyd 1977

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

Notice for Google Chrome users:
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.

Item Metadata

Download

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

Full Text

A STRUCTURED LANGUAGE FOR INTERACTIVE GRAPHICS by DOUGLAS WILLIAM LLOYD TEEPLE B.A.Sc, U n i v e r s i t y of Waterloo, 1975 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE . i n I n t e r d i s c i p l i n a r y Studies ( E l e c t r i c a l Engineering and Computer Science) We accept t h i s t h e s i s as conforming to the required standards THE UNIVERSITY OF BRITISH COLUMBIA March, 1977 Q D.W.L. Teeple, 1977 In p r e s e n t i n g t h i s t h e s i s in p a r t i a l f u l f i l m e n t o f the requirements f o r an advanced degree at the U n i v e r s i t y of B r i t i s h Columbia, I agree that the L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e fo r reference and study. I f u r t h e r agree tha t permiss ion fo r e x t e n s i v e copying of t h i s t h e s i s f o r s c h o l a r l y purposes may be granted by the Head of my Department or by h i s r e p r e s e n t a t i v e s . It i s understood that copying or p u b l i c a t i o n of t h i s t h e s i s f o r f i n a n c i a l ga in s h a l l not be al lowed without my w r i t t e n p e r m i s s i o n . Department of I <? C>l*C iPl l*/A*Y ^TOOtBS ( E L £ C T £ i C * L &+±&>l«EeAt/4C:t The U n i v e r s i t y of B r i t i s h Columbia 2075 Wesbrook Place Vancouver, Canada V6T 1W5 Date frW^H \7 \ <?7? 6 A b s t r a c t T h i s t h e s i s d i s c u s s e s t h e d e s i g n and i m p l e m e n t a t i o n of t h e computer language SLING ( S t r u c t u r e d Language f o r I n t e r a c t i v e G r a p h i c s ) . SLING by a e s i g n i s a h i g h - l e v e l s t r u c t u r e d p r o c e d u r a l language. C o n s t r u c t s promoting u s e r i n t e r a c t i o n have been added t o enhance g r a p h i c s c a p a b i l i t i e s . The i m p l e m e n t a t i o n of SLING i s c o r e and e x e c u t i o n - t i m e e f f i c i e n t r e l a t i v e t o c u r r e n t computer g r a p h i c s languages. I t i s designed t o r u n on a minicomputer w i t h m i n i m a l c o r e r e g u i r e m e n t s . i i i Table of Contents 0} Introduction ........................ 1 A) Background ............................................. 1 B) The Language 3 1) Predecessors 8 A) LIG .-. .............. 8 B) IMAGE ........ • • 10 C) GRIP ,««.«...»•...«.•«•..»...»»•.........»............. 10 D) ESP3 . . ......................................... 11 E) BGRAF2 ..11 F) DA LI ....12 G) SUGAR 12 H) SKETCHPAD 13 2) Objectives 14 3) F a c i l i t i e s of the UBC Implementation .16 A) General Interactive Graphic F a c i l i t i e s .....16 B) General control Structures 19 i) WITH 20 i i ) FOR 21 i i i ) AS., ........... 21 iv) WHILE ........................... ................. 22 v) CASE 22 vi) IF .... ..... ............... .... ................ ... 23 T a b l e of C o n t e n t s i v v i i ) ON .... 24 C) Transput S t r u c t u r e s 25 D) The G r a p h i c a l F u n c t i o n 26 E) Semantics of O p e r a t o r s and Assignments ................ 27 F) Type C o e r c i o n s 30 4) S h o r t co in I ngs ........»..«•...........». .*............•» ... 32 5) S u g g e s t i o n s f o r Improvement 34 6) Summary .... ........ ................ .... .. ...... ... ........ 35 7) F u t u r e Work .............................................. 36 Appendices .................................................. 41 A) Syntax c h a r t s ......................................... 41 B) Backus - Naur Form Syntax 54 C) G r a p h i c a l Data S t r u c t u r e .............................. 58 D) The T r a n s l a t o r ........................................ 63 E) Reserved Words and Symbols 65 F) Running I n s t r u c t i o n s .................................. 68 G) Sample Program L i s t i n g ................................ 70 H) Sample FORTRAN O b j e c t Code . . . 7 3 I) A Review o f Language Statements . . .77 Index ......... • ....... 82 T a b l e o f C o n t e n t s V L i s t o f F i g u r e s I) INKING Sample Output 7 I I ) G r a p h i c a l Datum T a b l e . . . 6 0 I I I ) Homogeneous C o o r d i n a t e M a t r i c e s ........................ 62 L i s t o f F i g u r e s v i L i s t of T a b l e s I) Core Osage Comparison .................................... 61 L i s t of T a b l e s v i i Acknowledgement I would l i k e i n particular to thank Dr. G.F. Schrack for his continued encouragement i n the thesis work. I would also l i k e to thank Dr. J . E . L . Peck, Dr. B. Pollack, ana Dr. M.R. Ito for t h e i r constructive c r i t i c i s m in reading early versions of the thesi s . F i n a l l y I would l i k e to thank various students i n the OBC Department of computer Science f o r a number of c r i t i c a l discussions of the work and for t h e i r suggestions i n improving the guality of the report. A Structured Language for Interactive Graphics 1 0) Introduction A) Background In reading the l i t e r a t u r e on present graphics languages i t became apparent that there i s s t i l l much controversy over the forms that such a language might take. General purpose languages are developing now based on the work of such people as Hoare [1973ab], Dijkstra [1971,1972], Wirth [1973,1976] and others. The trend i s towards highly structured procedural languages. Cumulative experience i n the use of languages has shown that some control constructs are notably conducive to the writing of code that i s d i f f i c u l t to understand, time consuming to debug and d i f f i c u l t to communicate to other programmers. An active research area i s concerned with replacing such constructs with control structures that promote understandable expression of a computer algorithm, Hoare [1973b] stated that "a good programming language should give assistance i n expressing not only how the program i s run, but what i t i s intended to accomplish; and i t should enable t h i s to be expressed at various l e v e l s , from the o v e r a l l strategy to the d e t a i l s of coding and data representation. A good programming language w i l l Introduction A Structured Language for INteractive Graphics 2 encourage and a s s i s t the programmer to write clear self-documenting code and even perhaps to develop and display a pleasant style of writing". A number of books have recently been published on programming style. Dijkstra et a l . [1972] stress that programming s t y l e i s of great importance in producing correct programs. His i d e a l language was to be used as "*a communication language' say, not for the communication of algorithms, but for the communication of ways of thinking, as a vehicle of programming s t y l e " . The e f f i c i e n c y of a programming system i s i n part dependent on the f a c i l i t y with which a programmer can express an algorithm in a given language. The f a c i l i t y of expression i s dependent on a number of factors, notably the "human-engineering" aspects of a language as cited in recent l i t e r a t u r e . Weinberg [1971] has made a s i g n i f i c a n t contribution in his book The Psychology of Computer Programming,. In t h i s book Weinberg sets a number of goals for improving the design and management of programs. Notably he stresses improvements i n the r e a d a b i l i t y and w r i t e a b i l i t y of code, and proposes "egoless" and group programming techniques. Graphical language designers have adopted some of the recent language constructs and ideas creating some reasonably advanced control and data structures for p a r t i c u l a r use in computer graphics. The problem i s somewhat di f f e r e n t than that Introduction A Structured Language for INteractive Graphics 3 of conventional languages because the designer i s dealing with a number of di f f e r e n t graphical input devices ( l i g h t pen, cursor, etc). An attempt was mads in the language developed f o r t h i s thesis to manage t h i s i n t e r a c t i o n in a natural way, and to promote the writing of structured code, B) The Language The reader should consult Appendix G for a sample program l i s t i n g and Appendix I for a review of the language statements to make the following discussion more concrete. A graphical datum can be thought of as being a member of a data type. Variables of t h i s data type (named GRAPHICAL i n SLING) have some properties s i m i l a r to the properties of more common data types such as REAL or INTEGER in that a value i s returned i n an expression and t h i s value can be assigned. However the graphical data type i s distinguished from other data types i n that the graphical datum i s a recursive record structure, A graphical variable i s recursive as i t i s composed of graphical variable (s) . A graphical variable i s a record because references to the properties of a graphical variable return values of type REAL. Graphical variables must resolve to primitive display values of l i n e or blank. A data type c a l l e d CHARACTER i s available i n the language Introduction A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 4 h a v i n g the p r o p e r t i e s o f a g r a p h i c a l v a r i a b l e e x c e p t t h a t i t must r e s o l v e t o a s t r i n g o f c h a r a c t e r s . From t h i s d i s c u s s i o n i t i s c l e a r t h a t a program w r i t t e n i n t h e language can o n l y output t i t l e d l i n e d r a w i ngs. A program c o n s i s t s o f any number of n e s t e d , named pr o c e d u r e s and/or f u n c t i o n s . The outermost l e v e l must be a g r a p h i c a l p r o c e d u r e . A procedure i s any number o f e x e c u t a b l e s t a t e m e n t s i n t h e s e t o f p e r m i s s i b l e s t a t e m e n t s preceded by d a t a d e c l a r a t i o n s t h a t d e c l a r e e v e r y v a r i a b l e , a r r a y , l a b e l , l i t e r a l , e x t e r n a l f u n c t i o n and procedure used i n t h e program. The Backus Naur Form s y n t a x d e f i n i n g the p e r m i s s i b l e statement s e t i s found i n Appendix B. P r o c e d u r e s may be n e s t e d to any depth. Any procedure or f u n c t i o n c a l l e d o r r e f e r e n c e d i n a program must be preceded by the body o f code c o n s t i t u t i n g t h a t procedure o r f u n c t i o n . A l l e x t e r n a l p r o c e d u r e s , f u n c t i o n s , o r s u b r o u t i n e s must be d e c l a r e d as e x t e r n a l i n t h e d a t a d e c l a r a t i o n . E x t e r n a l FO RT A N s u b r o u t i n e s may be c a l l e d from a program. G r a p h i c a l , r e a l , i n t e g e r and Boolean data a r e not known o u t s i d e the scope of t h e procedure i n which t h e y a r e d e c l a r e d e x c ept when passed as parameters. Parameter p a s s i n g f o l l o w s t h e c o n v e n t i o n s o f FORTRAN s u b r o u t i n e parameter p a s s i n g w i t h the e x c e p t i o n of d a t a o f t h e type g r a p h i c a l which a r e passed by I n t r o d u c t i o n A Structured Language for INteractive Graphics 5 reference only. It i s possible to pass reference to a graphical function i n SLING. This property i s useful i n dealing with external procedures. Graphical arrays may have only one dimension. Subscripting starts from zero. Character variables must be declared with a maximum length. This length i s used to set the length of the s t r i n g vector where the characters are stored. It i s possible f o r a s t r i n g to exceed i t s declared length though the t o t a l declared length may not be exceeded. Graphical functions are defined, A graphical function i s a piece of code which returns a graphical value. This value has associated with i t a l l the properties of graphical variables. The functions use space in the symbol table only during execution of the function for i s core e f f i c i e n c y . The graphical function takes parameters of any type. Functions may be compiled externally, stored i n l i b r a r y f i l e s and loaded s e l e c t i v e l y . Control structures available i n SLING are explained in d e t a i l l a t e r i n the report., Only free format transput i s defined. Graphical and Introduction A Structured Language for Interactive Graphics 6 character variables can be retrieved and stored in f i l e s under programmer control. The language benefitted from experience derived from LIG (Language for Interactive Graphics) which was developed by Pieke [1973] and Schrack [1976b]. The domain of SLING i s two dimensional l i n e drawings. A storage tube display i s used fo r transput in the UBC implementation. Input devices are a joystick cursor and a keyboard. The display i s driven by a a NOVA 840, 32K minicomputer running under RDOS 5. The translator, written in XPL resides on an IBM 370 machine running under MTS, the Michigan Terminal System. The FORTRAN object produced by the translator i s compiled on the minicomputer. The following section introduces a number of graphical programming languages. The following discussion serves only to introduce the reader to the languages, no attempt i s made for a complete description. Readers should consult the references given for a more complete discussion. Introduction A Structured Language for Interactive Graphics 7 figure I Sample Cutpnt Sample cutput from the "INKING" program used in system dehuqginq. See appendix G for the source program. Introduction A S t r u c t u r e d Language f o r I n t e r a c t i v e G r a p h i c s 8 1) PREDECESSORS A) LIG (Language f o r I n t e r a c t i v e G r a p h i c s ) LIG was devel o p e d at t h e U n i v e r s i t y o f B r i t i s h Columbia by P i e k e [ 1973 ] and Sch r a c k [ 1976b ]. I t i s a h i g h - l e v e l u s e r - o r i e n t e d language f o r i n t e r a c t i v e g r a p h i c s . Because LIG i s a d i r e c t p r e d e c e s s o r o f SLING, t h e b u l k of the d i s c u s s i o n on o t h e r g r a p h i c s programming languages c o n c e r n s LIG, I t i s o r i e n t e d towards r u n n i n g g r a p h i c a l programs on a 32K c o r e minicomputer. I t was developed f o r use by t h e Department of E l e c t r i c a l E n g i n e e r i n g a t the U n i v e r s i t y o f B r i t i s h Columbia f o r t h e development o f c i r c u i t a n a l y s i s , c r i t i c a l p a t h , and s i m i l a r programs. T h i s d i s c u s s i o n of LIG presupposes knowledge of t h e language. See P i e k e [ 1 9 7 3 ] and Schrack [1976b] f o r a d i s c u s s i o n i n g r e a t e r d e p t h , LIG i s a s u p e r s e t o f t h e host language FORTRAN. The user who knows FORTRAN has o n l y t o l e a r n a few more g r a p h i c a l e x t e n s i o n s t o l e a r n LIG. A l l o f t h e f a m i l i a r FORTRAN c o n t r o l s t r u c t u r e s a r e a v a i l a b l e i n LIG. W h i l e l e a r n i n g t i m e can be reduced by such an approach and the i m p l e m e n t a t i o n i s f a s t e r and e a s i e r than the i m p l e m e n t a t i o n o f a f u l l g r a p h i c s language. P r e d e c e s s o r s A Structured Language for interactive-Graphics 9 there are some disadvantages. In p a r t i c u l a r , the user has available only the control structures of FORTRAN. / That means that none of the newer language constructs of structured languages are possible, SLING attempts to a l l e v i a t e t h i s weakness by discarding the host language concept in favour of a complete language design and implementation. The LIG subroutine system i s large, over t h i r t y routines are needed in the supporting system. As a r e s u l t , the size of the user program i s r e s t r i c t e d . The user must resort to complicated and time consuming overlay techniques to run a moderate sized program. The graphical database used by LIG i s very large. It takes 3 . 6 K words of core space to store the graphical data structure. This amount of core i s used whether the source program uses no graphical variables or the maximum of t h i r t y nine. I f a user wants to use fewer graphical variables presumably he wants to use more variables of another type (e.g. REAL or INTEGER). However the large core overhead of the graphical data structure must be paid, LIG incorporates six graphical primitives - LINE, BLANK, CIRCLE, SQUARE, TRIANGLE and SEMICIRCLE. These are sometimes useful i n that the user i s saved from forming them himself. However the user pays for the primitives i n core space whether Predecessors A Structured Language for in t e r a c t i v e Graphics 10 or not they are used in the program. A di f f e r e n t approach has been taken i n the current design in which function c a l l s accomplish the benefits of a large set of primitives without the disadvantage mentioned. B) IMAGE IMAGE (O'Brien and Bown[ 1975]) was designed as a high-level, portable, i n t e r a c t i v e , structured language. It i s p a r t i c u l a r l y suited to the handling of interrupts from the user. The language i s structured around OBJECT and ACTION blocks r e l a t i n g a pa r t i c u l a r set of actions to a block of object code. The control structures are Algol S-like. The syntax i s not well human-engineered. The language uses some constructs l i k e data i n i t i a l i z a t i o n from FORTRAN and modifiers somewhat l i k e those of LIG. C) GRIP GRIP, Graphical Procedures for Instruction Purposes ( G i l o i [1975]) uses data structures suitable f o r implementation i n a number of languages, either as a subroutine system, or in conjunction with a preprocessor. The author discusses the data structures mainly, giving l i t t l e attention to implementation. Predecessors A Structured Language for i n t e r a c t i v e Graphics 11 The language i s quite large and not suitable f o r minicomputer applications. The syntax i s very poorly human-engineered although l i t t l e source code i s needed to generate pictures. D) E S P 3 ESP 3 (Shapiro [ 1975 ]) i s an extension to the language SNOBOL (Extended SNOBOL Picture Pattern Processor), I t was designed to "provide simple natural and e f f i c i e n t manipulation of l i n e drawings". Simple and e f f i c i e n t are defined i n large machine terms; the programs are too large for minicomputer applications. The language uses predicates to retrieve a t t r i b u t e information on the graphical data structure. Assignment and union operators as well as scaling and transformation functions are available. Very l i t t l e control structure i s noted i n the paper. The language handles matching of picture patterns very well. I t i s oriented towards A r t i f i c i a l Intelligence applications. E) BGEAF2 BGRAF2 (Bergman and Kauf man[ 1976 ]) uses graphical procedures, but not graphical functions. The language i s very terse, making i t d i f f i c u l t to understand programs. One strong advantage of BGRAF2 i s i t s recursive feature, a feature that would be valuable in SLING, but d i f f i c u l t to implement because Predecessors A Structured Language for i n t e r a c t i v e Graphics 12 of the object language chosen. F) DALI DALI {Pfister [1976]) i s oriented to providing the motion a t t r i b u t e for graphical data i n a natural way. Much of the discussion i s taken up by the scheduling algorithms. A graphical function i s defined, i t returns a value (non-graphical) that i s ignored. DALI can be embedded in FORTRAN, PL/I, ALGOL, and LISP. The author chose MUDDLE, a LISP-like language available on the PDP10. G) SUGAR SUGAR (Kriger [ 1976]) i s intended as a high-level language for geographical analysis and mapping. I t i s a non-procedural language using " E n g l i s h - l i k e " sentences as program input. The BNF syntax i s defined using conventional simple English formats. Verbs, nouns, and prepositional phrases are handled. , The pa r t i c u l a r set of words used i s kept on f i l e , so that p a r t i c u l a r d i a l e c t s of the language can develop. While the system i s useful for applications type work ( i . e . for use by non-computer-trained s c i e n t i s t s in t h i s case), i t s non-procedural approach i s a setback for general graphics programming. Predecessors A S t r u c t u r e d L a n g u a g e f o r i n t e r a c t i v e G r a p h i c s 13 H) SKETCHPAD SKETCHPAD ( S u t h e r l a n d [ 1967] ) i s one o f t h e o r i g i n a l g r a p h i c s i n t e r a c t i o n p a c k a g e s . I t was d e v e l o p e d by S u t h e r l a n d a t MIT . SKETCHPAD p r o m i s e d t o " o p e n up a new a r e a o f m a n - m a c h i n e c o m m u n i c a t i o n " . I t i s a n i n t e r a c t i v e n o n - p r o g a m m i n g g r a p h i c s p a c k a g e i n w h i c h s t r u c t u r e s a r e c r e a t e d d u r i n g t h e i n t e r a c t i v e s e s s i o n . S u t h e r l a n d ' s work i n i t i t i a t e d r e s e a r c h on g r a p h i c a l d a t a b a s e s . P r e d e c e s s o r s A Structured Language for i n t e r a c t i v e Graphics 14 2) OBJECTIVES The primary objective in designing SLING i s to create a structured procedural graphics language small enough to run on a 32K core minicomputer... More recent control constructs, such as CASE, WHILE, FOR, WITH, and IF-THEN-ELSE are implemented. Every attempt i s made to make the control structures conceptually as simple and straightforward as possible. This objective i s based upon Hoare's [1973] assertion that any language must be simple to understand and use. The designer, benefits because implementation i s simpler, thus the language i s more l i k e l y to work correctly. The user benefits because the language i s easy to learn and program debugging i s faster. In keeping with the size considerations and reasonable run time speed operations on graphical data have been made as fast and core e f f i c i e n t as possible. The operation of the superposition and deletion operators has been s i m p l i f i e d conceptually from the operators as supported by LIG. The s i m i l a r i t y between graphical data superposition and set union i s exploited, ; several new control structures based on Objectives A Structured Language for Interactive Graphics 15 set operations are available to the programmer. These w i l l be discussed i n d e t a i l i n l a t e r sections. The language has a simple transput structure thus reducing the s i z e of the support routines required leaving the user with more available core space. The user has the ca p a b i l i t y to define a l i b r a r y of functions and procedures., FORTRAN routines can be c a l l e d from a program, thus a large number of support routines are available. Disk f a c i l i t i e s are provided to increase the available storage area. Disk access i s programmer-controlled i n t h i s implementation. I t i s anticipated that subsequent implementations may support automatic disking, or a v i r t u a l memory system. Graphical functions returning graphical values are an important feature. The graphical function can be manipulated as any other graphical variables This means that the user can have a function c a l l e d CIRCLE, which returns the graphical value of a c i r c l e ; thus obviating b u i l t - i n primitives of a complexity greater than BLANK or LINE. The function i s useful as a core saving device. Only during the display of that function need the graphical variables used i n that function use storage in the database. see the sample program i n appendix G for aa example of the use of graphical functions. Objectives A . S t r u c t u r e d language f o r i n t e r a c t i v e G r a p h i c s 16 3) FACILITIES OF THE UBC IMPLEMENTATION A) GENERAL INTERACTIVE GRAPHIC FACILITIES The language s u p p o r t s g r a p h i c a l f u n c t i o n s , p r o c e d u r e s , and v a r i a b l e s . A g r a p h i c a l v a r i a b l e i s a data s t r u c t u r e t h a t has a s s o c i a t e d w i t h i t a m o d i f i a b l e g r a p h i c a l v a l u e . The d i s p l a y v a l u e of a g r a p h i c a l v a r i a b l e r e s o l v e s t o a l i n e o r a s e r i e s of l i n e s , o r a blank or a s e r i e s of b l a n k s . A g r a p h i c a l v a r i a b l e has a s s o c i a t e d w i t h i t t h e f i v e a t t r i b u t e s of x l o c a t i o n , y l o c a t i o n , x s c a l e , y s c a l e and a n g l e o f r o t a t i o n . The v a l u e s of t h e a t t r i b u t e s a re o f t y p e REAL. The s c r e e n r e p r e s e n t a t i o n i s c a l l e d t h e a r e a l e x t e r n a l r e p r e s e n t a t i o n as developed by Schrack [ 1 9 7 6 a ] , G r a p h i c a l o b j e c t s a r e d e f i n e d as a p p e a r i n g on a l a r g e but f i n i t e s u r f a c e . By d e f a u l t a g r a p h i c a l v a r i a b l e appears c e n t e r e d on t h e s c r e e n , w i t h d e f a u l t a t t r i b u t e s as g i v e n : The d e f a u l t v a l u e s a r e d e f i n e d on a s c r e e n t h a t i s one square u n i t i n s i z e . The lo w e r l e f t hand c o r n e r has c o o r d i n a t e s (0.0,0,0) and t h e upper r i g h t ( 1 . 0 , 1 . 0 ) . A l l g r a p h i c a l F a c i l i t i e s o f the UBC Imp l e m e n t a t i o n XSCALE YSCALE ANGLE XLOCATION YLOCATION 0.5 UNITS 0.5 UNITS 1.0 UNIT 1.0 UNIT 0.0 RADIANS A Structured Language for in t e r a c t i v e Graphics 17 variables have an area associated with them c a l l e d the i d e n t i f i c a t i o n area. The location of a variable i s the center of that area which defaults to the unit screen as explained. The scale of a variable determines the extent of the area representing the area of the graphical variable. Scaling i s used to change the screen s i z e and the i d e n t i f i c a t i o n area of the graphical variable. It i s used f o r the "ON" l o g i c a l test i n graphical interaction. A variable's attributes can be accessed by using the conventional notation f o r accessing a record structure. In t h i s notation the graphical variable name appears followed by a dot followed by the name of the at t r i b u t e . EXAMPLE: X : = TH OCK.XSCALE;1 Note that the attributes location and scale represent two values of type REAL. EXAMPLE: TRUCK,LOCATION := X,Y; The only operators v a l i d f o r use i n graphical assignment statements are the superposition and deletion operators, and «-» respectively. The semantics of these operators are quite d i f f e r e n t from that of the corresponding r e a l and integer operators. The reason for the difference i s the set-oriented implementation of the operations. The problems w i l l be examined in d e t a i l i n section 3-E, 1 Throughout the report syntactic keywords are underlined. F a c i l i t i e s of the OBC Implementation A Structured Language for i n t e r a c t i v e Graphics 18 A new l o g i c a l operator "IN" i s available i n SLING. This operator i s a set testing operator returning a l o g i c a l r e s u l t . It e s s e n t i a l l y gives the programmer the capability to determine whether a graphical datum i s an element of another graphical datum. EXAMPLE: A •= i l l J E ; B : = LINE; B - M £ P •= 3 .14159 /2 .0 ; CROSS += A + B; IF A IN CROSS THEN POT CROSS; In t h i s case the value of the l o g i c a l expression i s TRUE. A has been assigned to CROSS and has not been deleted from CROSS before the test so CROSS i s displayed on the screen. The "ON" statement tests whether the cursor was within the i d e n t i f i c a t i o n area of the graphical variable when the user h i t the keyboard interrupt. EXAMPLE: ON A THEN PUT -•YOU HIT A'; The cursor i s a crosshair on the display screen which the user can manipulate. If the cursor i s over a graphical object i d e n t i f i c a t i o n area when the user presses a key then the ON statement w i l l be TRUE for that object. In t h i s example i f the cursor was over the i d e n t i f i c a t i o n area of A then "YOU HIT A" would be printed on the screen. The statement w i l l also be TRUE for any other graphical object i d e n t i f i c a t i o n area under the F a c i l i t i e s of the UBC Implementation A Structured Language for Interactive Graphics 19 cursor. A graphical object i d e n t i f i c a t i o n area i s defined by the user through the use of the SCALE attributes. The default for the i d e n t i f i c a t i o n area i s a square covering the whole screen. A scale factor of (0.5,0.5) w i l l cause the i d e n t i f i c a t i o n area to shrink to half i t s s i z e along each axis. The i d e n t i f i c a t i o n area i s centered on the graphical object which i s i n turn centered on the default x and y locations (0.5,0,5). If the graphical datum i s moved to (0.4,0.1) then these coordinates become the center of the i d e n t i f i c a t i o n area. The user may define character variables of varying lengths although a maximum must be sp e c i f i e d . The character variable has the properties of a graphical variable including four of the f i v e a t t r i b u t e s of x and y, scale and location. Rotation i s not supported as an a t t r i b u t e of a character variable as the exi s t i n g hardware w i l l not rotate characters. The l o g i c a l ON operation can be used i n the selection of menu items i n conjunction with character variables. The operations of superposition, concatenation, substring and length of string are availa b l e i n SLING as l i b r a r y functions. Section 3-E contains a discussion i n greater depth. B) GENERAL CONTROL STRUCTURES Seven basic control structures are available: F a c i l i t i e s of the UBC Implementation A Structured Language for i n t e r a c t i v e Graphics 20 WITH FOB AS WHILE CASE I f • " ON~"" In every construct the control statement i s completed by a f u l l statement.. The BEGIN ... END; statement i s a v a l i d statement which brackets a series of statements. The f u l l syntax of the control structures can be found in Appendix A; a discussion of the semantics of each , i l l u s t r a t e d by examples, follows. i) WITH The WITH statement opens up the named graphical variable or the named attribute of a graphical variable for attribute assignment. EXAMPLE: WITH TRUCK DO LOCATION := 0.5,0.4; EXAMPLE: WITH LOCATION DO BEGIN TRUCK := 0. 5, 0. 4; BUS := 0.3,0.1; END; The WITH construct i s useful i n reducing the length of source code required to set the att r i b u t e s of a variable, or to modify the common attributes of a number of graphical or character variables. F a c i l i t i e s of the UBC Implementation A Structured Language for i n t e r a c t i v e Graphics 21 i i ) FOR The FOR construct allows the programmer to access the members of the set of a graphical or character variable. The FOR statement i s i t e r a t i v e , in that the object statement i s executed once f o r each member of the argument. EXAMPLE: A += B + C; I := 0; FOR A DO " B E G I N I~:= I + 1; SCAL(I) := XSCALE; E N D ; In t h i s example the vector SCAL i s assigned the XSCALE values of each of the top-level members of A ( i . e . B,C). The value of I i s two on e x i t from the loop. i i i ) AS The AS statement i s a an i t e r a t i v e statement which executes the object statement a specified number of times. EXAMPLE: AS I := 15 TO 1 BY -3 DO K := K + I; The object statement i s not executed i f the loop conditions do not hold at the entrance to the loop. The " B Y " clause i s optional, defaulting to the value "one" i f not specified. Each F a c i l i t i e s of the DBC Implementation A S t r u c t u r e d Language f o r i n t e r a c t i v e G r a p h i c s 22 of t h e i t e r a t i o n v a r i a b l e s (1, 15, and - 3 i n t h i s example) may be f u l l e x p r e s s i o n s t h a t r e s o l v e t o p o s s i b l y n e g a t i v e i n t e g e r v a l u e s . The v a l u e s o f the s e e x p r e s s i o n s s h o u l d not change w i t h i n t h e o b j e c t s t a t e m e n t as u n d e f i n e d r e s u l t s w i l l o c c u r . i v ) WHILE The WHILE statement e x e c u t e s the o b j e c t statement w h i l e the argument o f the statement i s TRUE. E X A M P L E : WHILE X <= Y DO BEGIN X~:= X + 1; F(X) := X* 2 ; END; The t e s t of the t r u t h v a l u e o c c u r s at t h e e n t r a n c e t o the WHILE s t a t e m e n t . The o b j e c t statement w i l l not be exe c u t e d i f the c o n d i t i o n i s FALSE upon e n t r y t o t h e c o n s t r u c t . v) CASE The case s t a t e m e n t i s a s i m p l e c o n s t r u c t which e x e c u t e s the " n t h " s t a tement f o l l o w i n g t h e case statement w i t h i n the bounds of t h a t s t a t e m e n t , where "n" i s an e x p r e s s i o n t h a t r e s o l v e s t o an i n t e g e r v a l u e . The ELSE c l a u s e i s exe c u t e d i f the argument i s not i n s i d e t h e range of c a s e s . F a c i l i t i e s of the UBC Implementation A Structured Language for i n t e r a c t i v e Graphics 23 E X A M P L E : C A S E N D O B E G I N " & I ~ * • • « H «—* C • — • • * j B E G I N T • = J : = . .. ; E N D ; E N D ! E L S E P U T * E E R O B « ; There are four cases i n t h i s example. In cases one, two and three assignments are made to A, B, and C respectively. In case four both I and J are assigned values. The object statement of the ELSE clause i s the default i f n 8 " i s not equal to any of one, two, three, or four. The ELSE clause i s not optional. vi) IF The IF statement executes the object code co n d i t i o n a l l y , depending on the l o g i c a l value of the argument, EXAMPLE: IF X = Y THEN GO TO LABEL1; If the condition X = Y i s TRUE then control w i l l transfer to the statement indicated by LABEL1, otherwise execution continues with the following statement. An ELSE clause can be used i n conjunction with the IF statement. The object statement of the ELSE clause i s executed i f the argument of the IF F a c i l i t i e s of the UBC Implementation A S t r u c t u r e d Language f o r i n t e r a c t i v e G r a p h i c s 24 s t a t e m e n t i s FALSE. EXAMPLE: I F X = BLSE I := 4; v i i ) ON The ON sta t e m e n t p r e v i o u s l y d i s c u s s e d can a l s o t a k e an ELSE L o g i c a l s t a t e m e n t s (ON, IF) a r e p r e c l u d e d from b e i n g o b j e c t s of the THEN c l a u s e o f a l o g i c a l s t a t e m e n t i f an ELSE c l a u s e f o l l o w s . T h i s approach i s t a k e n t o r e s o l v e t h e a m b i g u i t y a s s o c i a t e d w i t h compound IF(ON) s t a t e m e n t s . F a c i l i t i e s o f t h e UBC I m p l e m e n t a t i o n c l a u s e . EXAMPLE: ON TBUCK THEN I 1111 • i := 3 • = U' A Structured Language for INteractive Graphics 25 C) TRANSPUT STRUCTURES The transput structures are straightforward. The programmer can PUT variables, constants, or expressions on the screen, with the same syntax regardless of type. Similarly the programmer can GET variables from the keyboard or cursor. The syntax of the GET statement i s not as simple as that of PUT. See the Backus - Naur Form syntax description in Appendix B. F i l e s can be accessed to store and retrieve graphical and character variables. This c a p a b i l i t y permits the user to develop large databases by maintaining data on disk. EXAMPLE: GRAPHICAL VARIABLE TRUCK,BUS; REAL l A i l l B L E X , Y7 GET T ROC K~?ROM FILJ TRUCKFILE; POT TRUCK; POT * TRUCK*; GET X,Y FROM CORSOR; GET BOS FROM F I L E " B O S F I L E ; BOS.LOCATION :=~X , Y ; POT BOS; POT *BUS«; F a c i l i t i e s of the UBC Implementation A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 26 D) THE GRAPHICAL FUNCTION The g r a p h i c a l f u n c t i o n has a n a l o g s i n the more common da t a t y p e s , I n FORTRAN f o r i n s t a n c e t h e i n t e g e r f u n c t i o n i s a p i e c e of code t h a t r e t u r n s an i n t e g e r v a l u e . S i m i l a r l y a g r a p h i c a l f u n c t i o n i s a p i e c e o f code which r e t u r n s a g r a p h i c a l v a l u e . The g r a p h i c a l s t o r a g e used by t h e f u n c t i o n i s used o n l y d u r i n g e x e c u t i o n o f t h e f u n c t i o n . A g r a p h i c a l f u n c t i o n can t a k e arguments of any t y p e . , The f u n c t i o n s are s e l e c t i v e l y loaded so t h a t o n l y the c a l l e d f u n c t i o n s r e s i d e i n c o r e . The g r a p h i c a l f u n c t i o n has a l l the a t t r i b u t e s of a g r a p h i c a l v a r i a b l e , namely x and y s c a l e , and l o c a t i o n a t t r i b u t e s as w e l l as a r o t a t i o n a n g l e and i d e n t i f i c a t i o n a r e a . The f u n c t i o n i s a major c o n t r i b u t i o n b o t h t o the min i m a l s i z e of programs and t o the power o f t h e programming t e c h n i q u e s a v a i l a b l e . G r a p h i c a l f u n c t i o n s may be passed as parameters. T h i s p r o p e r t y i s u s e f u l f o r h a n d l i n g e x t e r n a l g r a p h i c a l f u n c t i o n s . The g r a p h i c a l f u n c t i o n r e t u r n s a s i n g l e g r a p h i c a l v a l u e . A l l g r a p h i c a l v a r i a b l e s and e x t e r n a l g r a p h i c a l f u n c t i o n s d e f i n e d i n s i d e t h e f u n c t i o n d u r i n g e x e c u t i o n a r e u n d e f i n e d o u t s i d e t h a t f u n c t i o n . C o n s e q u e n t l y complex g r a p h i c a l v a l u e s and g r a p h i c a l F a c i l i t i e s o f t h e UBC I m p l e m e n t a t i o n A Structured Language for INteractive Graphics 27 functions must be passed as parameters. For a contrasting implementation of graphical functions see Newman and Sproull [1973], and Newman [1971]. E) SEMANTICS OF OPERATORS AND ASSIGNMENTS The superposition and deletion operators of SLING ("+" and respectively) have somewhat diff e r e n t interpretations than s i m i l a r operators used i n integer and re a l arithmetic. F i r s t l y , the operators are s t r i c t l y dyadic i n nature meaning that each operator takes two operands. Secondly, semantically means set union and '»-" means deletion from a set. The set implementation i s core e f f i c i e n t , i s consistent with the recursive nature of the graphical datum and i s an elegant representation of graphical datum manipulations. EXAMPLE: A += LIME; B += LINE; B. ANGLE := 3. 14159/2. 0; CROSS += A + B; In this example A i s by default a horizontal l i n e , and B i s a l i n e whose angle i s 90 degrees. CROSS i s not a primitive of the language as are A and B, but i s a set containing elements that are primitives., Every graphical variable must resolve to primitives at some l e v e l to be displayed. CROSS i s linked to A and to B. When CROSS i s displayed, both A and B are displayed. F a c i l i t i e s of the UBC Implementation A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 28 I f CROSS.LOCATION were changed t o (0.1,0.2) f o r i n s t a n c e , t h e n the e n t i r e c r o s s would be t r a n s l a t e d . But note t h a t i f t h e l o c a t i o n o f A were changed then t h e shape of CROSS would change. I f A was moved up t o c o i n c i d e w i t h the t o p o f B then CROSS would d i s p l a y as a "T". Thus i t i s i m p o r t a n t t h a t the user know t h a t the s e m a n t i c s o f s u p e r p o s i t i o n are not t h e s e m a n t i c s o f the a d d i t i o n o p e r a t i o n w i t h which he i s p r o b a b l y more f a m i l i a r . I f t h e u s e r t h i n k s of s u p e r p o s i t i o n as s e t u n i o n t h e language w i l l be e a s i e r t o l e a r n . EXAMPLE: C += C + A; I n t h i s case A becomes a member o f C and no elements are d e l e t e d from C. Note t h a t i n t h e case o f s e t union where C i s not u n i t e d t o i t s e l f , t h e c u r r e n t s e t o f C i s emptied b e f o r e t h e new element i s added t o C. Note t h a t t h e u s e r can form t h e s t r u c t u r e : A += LINE; B •= LINE; B. ANGLE := 3.141593/2.0; A B; B += A; PUT A; In t h i s case t h e r e c u r s i v e nature of the datum i s e x p l o i t e d . The program w i l l d i s p l a y A i n i n f i n i t e r e c u r s i o n . The s u p e r p o s i t i o n o p e r a t i o n i s a l s o d e f i n e d f o r v a r i a b l e s F a c i l i t i e s o f t h e UBC I m p l e m e n t a t i o n A Structured Language for INteractive Graphics 29 of the type CHARACTER, Superposition i s different than the operation of concatenation. Concatenation means that the two strings are appended to form one st r i n g , EXAMPLE: 51 := »III»; 52 := »000«; 53 := S1 J| S2; SH += S1 + S2; PUT S3; PUT S4; In t h i s example S3 w i l l appear on the screen as "IIIOOO", while S4 w i l l appear as " i s a " , i f a l l the variables r e t a i n t h e i r default attributes. Of coarse i f the attributes of S1 or S2 are changed then SU w i l l change. For instance i f S1,YLOCATION i s modified to be lower than that of S2 then when S4 i s displayed S1 w i l l appear below S2 on the screen. The assignment operator «:=» i s used in an assignment statement to copy the value of a graphical variable to the assigned graphical variable, In contrast the set union operator "+=« simply enters the assigned variable entry point i n t o the set of the assignee. The assignment operation i s useful when several instances of a graphical variable are required. EXAMPLE: TRUCK. L.OCATION : = 0.5,-0.5; TRUCKA += TRUCK; TRUCKB := TRUCK; TRUCK.LOCATION := 0.2,0.5; PUT TRUCKAJTIU CKB; In t h i s example TRUCKB i s a copy of TRUCK while TRUCK i s a F a c i l i t i e s of the UBC Implementation A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 30 member o f the s e t TROCKA. When TRUCKA and TSUCKB a r e d i s p l a y e d TRUCKA w i l l appear c e n t e r e d on t h e l o c a t i o n (0.2,0.5) and TRUCKB w i l l appear c e n t e r e d on (0.5,0.5). The s e m a n t i c s o f a l l o t h e r o p e r a t o r s ( i . e . *,/, + ,-,**,HOD,&, | ,-«,>,<,=) are s i m i l a r t o e q u i v a l e n t o p e r a t o r s i n modern programming languages. See Appendix E f o r a v a i l a b l e b u i l t - i n f u n c t i o n s . F) TYPE COERCIONS As the d a t a t y p e s g r a p h i c a l and c h a r a c t e r a r e t h e o n l y s t r u c t u r e s a v a i l a b l e t h e y cannot be c o e r c e d t o any o t h e r t y p e . T h i s f a c t imposes some r e s t r i c t i o n s on t h e use of c h a r a c t e r and g r a p h i c a l v a r i a b l e s . G r a p h i c a l and c h a r a c t e r v a r i a b l e s a r e the o n l y t y p e o f v a r i a b l e t h a t can be put i n a FI L E u s i n g t h e f i l e s t a t e ment. Due t o i m p l e m e n t a t i o n r e s t r i c t i o n s n e i t h e r g r a p h i c a l nor c h a r a c t e r v a r i a b l e s may be used i n the GET statement. Mixed mode c h a r a c t e r and g r a p h i c a l v a r i a b l e s may appear i n a g r a p h i c a l e x p r e s s i o n , as c o e r c i o n between t h e s e t y p e s i s d e f i n e d though no o t h e r t y p e may be mixed w i t h g r a p h i c a l d a t a . C h a r a c t e r s t r i n g c o n s t a n t s , as d i s t i n c t from c h a r a c t e r v a r i a b l e s may appear as t h e o b j e c t o f a PUT statement. C h a r a c t e r s t r i n g c o n s t a n t s a r e u n d e c l a r e d s t r i n g s of a r b i t r a r y F a c i l i t i e s o f t h e UBC I m p l e m e n t a t i o n A Structured Language for INteractive Graphics 31 length enclosed i n singl e quotes. Coercion takes place between integer and r e a l variables, Real values are truncated i f assigned to an integer variable. The attributes of a graphical or character variable are of type REAL, and l i e within the ranges: XLOCATION,YLOCATION 0.0 - 1.0 XSCALE,YSCALE 0.0 - INFINITY ROTATION ANGLE ±Pi Note that i f coercion of X or Y location values from rea l to integer takes place the value w i l l always be either one or zero. Logical variables are not coerced to any other type. A l o g i c a l expression may contain r e a l and integer values, and i n the special case of the " I S " operator may contain graphical and character variables. EXAMPLE: LOGICAI, yASIAflLE L1 rL2 ; S 1 M 1 I 2 M i i i l A B I i l G1 , G 2; INTEGER VARIABLE 11,12; REAL VISIABIE R1,R2; I f 61 IN G2 THEN. . . • IF-II - >= 12 TlEN*.'. , IF L1 THEN. . . IF L1 S 12 THEN'.. . I I - (G1 IN G2) J (II = R2) THEN... F a c i l i t i e s of the UBC Implementation A Structured language for INteractive Graphics 32 4) SHORTCOMINGS The UBC implementation of SLING i s not without i t s shortcomings. These are due for the most part to the approach taken i n generating the language. The XPL based Translator Writing System (TWS) of McKeeman, Horning and Wortman [1970] was used to translate SLING to FORTRAN. XPL runs on the IBM 370 but not on the minicomputer. This means that the user must translate a program on the IBM 370 and transfer the object to the minicomputer. The language i s therefore not f u l l y transportable. A better approach would have been that of creating a self-compiling language including as one of i s c a p a b i l i t i e s the creation of graphical data handlers. The FORTRAN object code produced i s of course reasonably transportable. The only system dependent routines are the plo t t i n g and b i t handling routines. The semantics and data structure handling routines can be written i n SLING so that they are as transportable as any other part of the system. While FORTRAN i s reasonably common and widely understood i t s control structures and data structures are weak. Thus the object code of a program i s somewhat d i f f i c u l t to understand. The weak data Shortcomings A Structured Language for i n t e r a c t i v e Graphics 33 structuring in p a r t i c u l a r makes more powerful data structures which the user might want d i f f i c u l t to implement, SLING has no data structuring c a p a b i l i t i e s over and above the graphical data structure. FORTRAN does not support recursive subroutine or function c a l l s . The language would be more useful i f the object language had these recursive c a p a b i l i t i e s . The language i s not extensible. The programmer must use the s t r i c t syntax of SLING as given by the BNF syntax. The programmer can redefine single keywords such as YLOCATION, but the l i t e r a l c a p a b i l i t i e s of the language are weak. See Appendix E f o r the f u l l l i s t of keywords and symbols. Shortcomings A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 34 5) SUGGESTIONS FOR IMPROVEMENT The s h o r t c o m i n g s and r e s t r i c t i o n s o f SLING have been documented t h r o u g h o u t t h e t h e s i s . S u g g e s t i o n s f o r improvement are g a t h e r e d here i n a c o n c i s e form. i ) Change t h e o b j e c t language from FORTRAN t o a language t h a t s u p p o r t s more advanced data s t r u c t u r e s , has e f f i c i e n t parameter p a s s i n g , s u p p o r t s r e c u r s i o n , and has more modern c o n t r o l s t r u c t u r e s . i i ) Change t h e o r i e n t a t i o n o f t h e language from an i n t e r a c t i v e g r a p h i c s language t o a more g e n e r a l s m a l l computer s t r u c t u r e d p r o c e d u r a l language. G r a p h i c s c a p a b i l i t i e s can then be added t o the d a t a s t r u c t u r e as a p r e l u d e and t o t h e s u p p o r t i n g s u b r o u t i n e system. i i i ) W r i t e a c o m p i l e r f o r t h e language i n t h e language so t h a t t h e XPL sytem i s no l o n g e r needed. T h i s and t h e p r e v i o u s s u g g e s t i o n w i l l improve t h e p o r t a b i l i t y o f the language. i v ) Work more on t h e d i s k f a c i l i t i e s , a p o s s i b i l i t y b e i n g a v i r t u a l memory s t o r e w i t h a u t o m a t i c d i s k i n g o f d a t a . v) Expand t h e t r a n s p u t f a c i l i t i e s t o handle i n t e r r u p t s and t r a n s p u t from a number of d i f f e r e n t d e v i c e s . S u g g e s t i o n s f o r Improvement A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 35 6) SUMMABY A h i g h - l e v e l g r a p h i c s language has been implemented t h a t p e r m i t s the m a n i p u l a t i o n o f v a r i a b l e s o f the d a t a type GRAPHICAL. The system i s compact and e f f i c i e n t i n i t s use of r e s o u r c e s . The s i m i l a r i t y between i t and a number of modern programming languages i n d i c a t e s t h a t most programmers w i l l have l i t t l e t r o u b l e i n l e a r n i n g t h e language. The language's weaknesses stem t o a l a r g e e x t e n t from th e t a r g e t language chosen. The language i s not s e l f - c o m p i l i n g , t h u s i t s p o r t a b i l i t y i s l i m i t e d . The a n a l y s e r o f HcKeeman, Hornin g , and l o r t m a n i s w r i t t e n i n XPL, a language t h a t does not p r e s e n t l y run on minicomputers. A more p r o f i t a b l e approach t o t h e d e s i g n of a g r a p h i c a l language i s t o w r i t e a language c a p a b l e o f h a n d l i n g d a t a s t r u c t u r e s t h a t s u p p o r t th e t r a n s p u t f a c i l i t i e s t h r o u g h u t i l i t y r o u t i n e s . Summary A Structured Language for INteractive Graphics 36 7) Future Work Implementation of a second version has begun., The language translates to "minicode", an assembler-like language used as a common target language for reasons of p o r t a b i l i t y . The data structure as given i n Hoare [ 1973b] i s used. The data type GRAPHICAL can be defined as a prelude in a language supporting such structures. The homogeneous coordinate system used in the previous version w i l l be dropped in favour of simple storage of properties, as the homogeneous coordinate system i s prone to storage overflow problems. A BCPL-like approach to transput i s being taken. The graphics output routines can be stored as functions written i n the language and stored i n a l i b r a r y f i l e . Future Work A Structured Language for INteractive Graphics 37 Bibliography and References Bergman, S. and A, Kaufman "BGRAF2: 1 REAL TIME GRAPHICS LANGUAGE WITH MODULAR OBJECTS AND IMPLICIT DYNAMICS" Com outer Graphics. (SIG GRAPH - ACM) vol. To No7/2 Summer 1976 Chan, B.B. MA THEM -ATI C AL = - ASPf CT S OF A. GRAPHICAL PROGRA MHING LANGUAGE AND ITS IMPLEMENTATION ~ Master's Thesis, Department E l e c t r i c a l Engineering University of B r i t i s h Columbia July 1976 Cleavland, J.C. and R.C. Ozgalis £1MM1S ~ £OR PROGRAMMING LANGUAGES WHAT EvIeY~PRJDGJAM GRAMMARS -University of C a l i f o r n i a , Los Angeles 1974 Dijkstra, E. W. , .. A-SHORT INTRODUCTION TO T H f - f i f : 21 i :Jti2SlllIlIS • monograph August 1971 Dijkstra, E.W., O.J. Dahl AND C.A.R. Hoare STRUCTfRED-PROGRAMMING Academic Press, Ne» York 1972 G i l o i , W.K, "ON HIGH-LEVEL PROGRAMMING SYSTEMS FOR STRUCTURED DISPLAY PROGRAMMING" computer- Graphics, (SIGGRAPH - ACM) Vol. J 9 Io7 1 ~ Spring 1975 Harrison, M. ,,-€. DATA STRUCTURES AMD PROGRAMMING Scott Foresman and company, I l l i n o i s 1973 Bibliography and References A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 38 Hoare, C,A,R. RECURSIVE DATA STRUCTURES SAIL"MEMO AIM"223' October 1973 Hbare, C. A. R. 1 I I 2 S . ON f R 0 G 1 M 8 I I 5 M^ G O j i G E DESIGN SAIL MEMO AIM 224 October 1973 J e n s e n , K. and N.f. W i r t h PASCAL USER JANUAL « | JIPOOT Second E d i t i o n S p r i n g e r - V e r l a g , New York 1976 K r i g e r , M.P. "SUGAR: A HIGH LEVEL PROGRAMMING LANGUAGE FOR GEOGRAPHICAL ANALYSIS AND MAPPING" SIGPLAN N o t i c e s {SIGGRAPH - SIGPLAN - ACM) V o l . ,11 NO. 6 June 1976 L u c i d o , A. P. "SOFTWARE SYSTEMS FOR COMPUTER GRAPHICS" Computer (IEEE Computer S o c i e t y ) V o l . " 9 No. 8 August 1976 McKeeman, W.M. ,• and J . J . Horning and D.B. Wortman I COMPILER-GENERATOR P r e n t i c e H a l l , New J e r s e y 1970 Newman, W.M. " D i s p l a y P r o c e d u r e s " Communications ACM Vol7"~14~No7~10 October 1971 Newman, W.M. and R.F. S p r o u l l S i l l C I P L E S OF INTERACTIVE CXMPUTER GRAPHICS McGraw H i l l , New York 1973 N i c h o l l s , J.E. THE SJRUGfgRE M D DESIGN OF PROGRAMMING LANGUAGES Addison Wesley, Massachusets 1975 B i b l i o g r a p h y and R e f e r e n c e s A Structured Language for INteractive Graphics 39 O'Brien, CD. .and E.G. Bown "IMAGE: A LANGUAGE FOR THE INTERACTIVE MANIPULATION OF A GRAPHICS ENVIRONMENT" CoiEuter Gr^£hics, (SIGGRAPH - ACM) Vol. 9 No. ,1 Spring 1975 P f i s t e r , G.F. "A HIGH LEVEL LANGUAGE EXTENSION FOR CREATING AND CONTROLLING DYNAMIC PICTURES" Computer Graphics; (SIGGRAPH - SIGPLAN. - ACM) Vol. 11 No. 6 June 1976 Pieke, B. ASSIGN AND IM P-L EM E NT AT 10 N Of A^  HIGH LEVEL LANGUAGE £ 2 1 INTERACTIVE GRAPHICS Master's Thesis, Department of E l e c t r i c a l Engineering University of B r i t i s h Columbia July 1973 Shapiro, L.G. "ESP 3: A HIGH LEVEL GRAPHICS LANGUAGE" Computer Graphics. (SIGGRAPH - ACM) Vol. J No. 1 Spring 1975 Schrack, G.F. , "ON THE SEMANTICS OF THE ASSIGNMENT STATEMENT OF HIGH LEVEL GRAPHICAL LANGUAGES" Computer Graphics, (SIGGRAPH - ACM) Vol. 10 No. 2 Summer 1976 Schrack, G.F. "DESIGN, IMPLEMENTATION AND EXPERIENCES WITH A HIGHER-LEVEL GRAPHICS LANGUAGE FOR INTERACTIVE COMPUTER-AIDED DESIGN PURPOSES" SIGPLAN Notices. SIGGRAPH. - SIGPLAN - ACM) Vol. 11 No. 6 June 1976 Sutherland, I.E. "SKETCHPAD: A MAN-MACHINE GRAPHICAL COMMUNICATION SYSTEM" ACM •  Pro fessibnal^Development Seminar • Readings for computer Graphics 1967 Bibliography and References A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s Van Dam, A. "DATA AND STORAGE STRUCTURES FOR INTERACTIVE GRAPHICS" SIGPLAN N o t i c e s , (SIGGRAPH - ACM) V o l ? 6~No7 2~ 1971 Weinberg, G.M. I l l PSYCHOLOGY OF COMPUTER PHOJiAMMING Van Nostrand R e i n h o l d , New York 1971 Wegner, P. , "DATA STRUCTURES IN PROGRAMMING LANGUAGES SEMINAR" SIGPLAN f o t i c e s , (ACM) V o l 7 /6~No. ,2~~ February 1971 W i r t h , N. SYSTEMATIC PROGRAMMING: AN INTRODUCTION P r e n t i c e H a i l , New J e r s e y 1973 w i r t h , N. ALGORITHMS -+• DATA STRUCTURES = ^  PROGRAMS P r e n t i c e H a l l , New J e r s e y 1976 B i b l i o g r a p h y and R e f e r e n c e s A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 41 Appendix A Syntax C h a r t s - Words i n square c o r n e r e d boxes a r e d e f i n e d a f t e r t h e i r use i n t h e c h a r t s . - W o r d s i n round c o r n e r e d boxes a r e s y n t a c t i c keywords. Those word sequences e n d i n g i n " i d e n t i f i e r " are programmer d e c l a r e d names f o l l o w i n g P L / I i d e n t i f i e r c o n v e n t i o n s . , APPENDICES PROGRAM ALGORITHM algorithm data body head declaration ALGORITHM HEAD ^integer functio7P)J f loaical literal l a b e l ) literal identifier J \ label identifier 1 i DATA DECLARATION s t a t e m e n t identifier a l g o r i t h m 1 r SH logical s t a t e m e n t c o n t r o l s t a t e m e n t basic s t a t e m e n t BASIC STATEMENT " input "-s t a t e m e n t o u t p u t s t a t e m e n t assignment s t a t e m e n t a l g o r i t h m c a l l ,. • . -A r e t u r n . s t a t e m e n t > j g o t o s t a t e m e n t J e r a s e s t a t e m e n t ) b e g i n s t a t e m e n t .45.. -B>-CONTROL STATEMENT w i t h s t a t e m e n t f o r s t a t e m e n t w h i l e s t a t e m e n t c a s e s t a t e m e n t .A a s s t a t e m e n t -A l LOGICAL STATEMENT 46 ( i f ) - * ' logical expression] onV—H variable •{^ then statement if logical expression on variable then basic statement INPUT STATEMENT,, 47 g e t v a r i a b l e identifier ,. f r o m v . OUTPUT STATEMENT ^ c u r s o r - : ^ - v k e y f i l e n a m e i d e n t i f i e r in — H f i l e n a m e i d e n t i f i e r ERASE STATEMENT e r a s e v a r i a b l e identifier T ALGORITHM CALL c a l l -SH a l g o r i t h m identifier e x p r e s s i o n RETURN STATEMENT r e t u r n GO TO STATEMENT BEGIN STATEMENT 49 WITH STATEMENT w i t h g r a p h i c a l v a r i a b l e g r a p h ica! + i e r -s t a t e m e n t FOR STATEMENT for \ t i g r a p h i c a l v a r i a b l e AS STATEMENT e x p r e s s i o n WHILE STATEMENT w h i l e l o g i c a l e x p r e s s i o n d o )—-*4 s t a t e m e n t + 50 C A S E STATEMENT b e g i n s t a t e m e n t ASSlGNlylENT .STATHVEN^^ v a r i a b l e e x p r e s s iair--t l o g i c a l e x p r e s s i o n — EXPRESSION 51 TERM f a c t o r k. m o d > FACTOR LOGICAL EXPRESSION 52 LOGICAL TERM. LOGICAL FACTOR ( ^ e x p r e s s i o n c o mparator e x p r e s s i o n t r u e -A J 53 COMPARATOR -A < >= < = n VARIABLE (OR FUNCTION CALL) *• identifier <1>-HD A . S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 5U APPENDIX B Backus - Naur Porn Syntax - Words and symbols i n a n g l e b r a c k e t s a re s y n t a c t i c v a r i a b l e s which a r e d e f i n e d s u b s e q u e n t l y ' t o use i n the s y n t a x . , - The o p e r a t o r "::=" means " i s r e p l a c e d by". - The o p e r a t o r "|" means " o r " - Words and symbols not i n a n g l e b r a c k e t s a r e s y n t a c t i c keywords and symbols r e s p e c t i v e l y . , APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 55 <PROGRAM> ::= <ALGORITHM> EOF <ALGORITHM> : := <ALGORITHM FORMAT> <STATEMENT LIST> END <ALGORITHM NAME> <ALGORITHM FORMAT> ::= ^ALGORITHM HEAD> ; <DATA DECLARATIONS> <ALGORITHM HEAD> ::= <DATA TYPE> <ALGORITHM TYPE> <IDENTIFIER> | <ALGORITHM HEAD> ( <DECLARATIONS> ) <ALGORITHM TYPE> FUNCTION 1 PROCEDURE <DECLARATIONS> ::= <DATA DECLARATION> 1 <ALGORITHM> | <DECLARATIONS> ; <DATA DECLARATION> <DATA DECLARATION> ::= <DATA HEAD> <EXPRESSION> | <DATA DECLARATION> , <EXPRESSION> <STATEMENT> ::= <LOGICAL STATEMENT> \ <CONTROL STATEMENT> ! <BASIC STATEMENT> ; j <LABEL> : <STATEMENT> 1 ; <BASIC STATEMENT> ::= <INPUT STATEMENT> | <OUTPUT STATEMENT> | <ERASE STATEMENT> | <ASSIGNMENT STATEHENT> | <ALGORITHM CALL> 1 <1ETURN STATEMENT> ! <GO TO STATEMENT> | <BEGIN STATEMENT> <DATA HEAD> ::= <DATA TYPE> <VARIABLE TYPE> 1 LITERAL <IDENTIFIER> IS f LABEL <DATA TYPE> ::= GRAPHICAL 1 REAL I INTEGER ! LOGICAL <VARIABLE TYPE> ::= VARIABLE j ARRAY | EXTERNAL <INPUT STATEMENT> ::= GET EXPRESSION LIST> 1 GET EXPRESSION LIST> FROM <DEVICE> APPENDICES A Structured Language for INteractive Graphics 56 <GOTPUT STATEMENTS PUT EXPRESSION LIST> ! PUT ^EXPRESSION LIST> IN <FILE NAME> <ERASE STATEMENT> ::= ERASE | ERASE <VARIABLE> <LOGICAL CLAUSE> IF <LOGICAL EXPRESSION> THEN | ON <VARIABLE> THEN <LOGICAL STATEMENTS ::= <LOGICAL CLAUSE> <STATEMENT> f CLOGICAL CLAUSE> <BASIC STATEMENT> ELSE <STATEMENT> <CONTROL CLAUSE> FOR <?ARIABLE> | WITH < 7 A R I A B L E > 1 AS <ITERATION> | CASE <EXPRESSION> | WHILE <LOGICAL EXPRESSION> <CONTROL STATEMENT> ::= <CONTROL CLAUSE> DO <STATEMENT> <ITERATION> ::= <ASSIGNMENT> TO <ARGO MENT> | <ASSIGNMENT> TO <ARGOMENT> BY <ARGUMENT> <BEGIN STATEMENT> ::= BEGIN <STATEMENT LIST> END <ALGORITHM CALL> CALL <VARIABLE> ASSIGNMENT STATEMENT> ::= <VARIABLE> •= <EXPRESSION> I <VARIABLE> := <EXPRESSION> ! <VARIABLE> := <LOGICAL EXPRESSION> | <ASSIGNMENT> , <EXPRESSION> <RETURN STATEMENT> ::= RETURN <GO TO STATEMENT> ::= GO TO <LABEL> <EXPRESSION> ::= <EXPRESSION> + <TERM> ) <EXPRESSION> - <TERM> 1 - <TERM> 1 + <TERM> ! <TERM> <TERM> ::= <TERM> * <FACTOR> | <TERM> / <FACTOR> | <TERM> ** <FACTOR> 1 <TERM> MOD <FACTOR> | <TERM> J J <FACTOR> ! <FACTOR> <FACTOR> ( <EXPRESSION> ) 1 <ALGORITHM TAIL> APPENDICES A Structured Language for INteractive Graphics 57 | <ARGUMENT> | <STRING> <LOGICAL EXPRESSION> ::= <LOGICAL EXPRESSION> | <LOGICAL TERM> i <LOGICAL TERM> <LOGICAL TERM> ::= <LOGICAL TERB> & <LOGICAL FACTOR> \ <LOGICAL FACTOR> | \-t <LOGICAL FACTOR> <LOGICAL FACTOR> ::= ( <LOGICAL EXPRESSIQN> ) j <EXP8ESSION> <COMPARATOR> <EXPRESSION> | TRUE ] FALSE <COMPARATOR> : := < 1 > I < = I > = ! IN <VARIABLE> : := < ID E NT I F l E R > j <VARIABLE> ( I <VARIABLE> . EXPRESSION LIST> ) <IDENTIFIER> <DEVICE> CURSOR f KEY | CFILE NAME> <FILE NAME> : := <IDENTIFIER> <TDENTIFIER> : := <ALPHABETIC CHARACTER> 1 <ID EN TIFIER > ALPHANUMERIC CHARACTER> <NUMBER> ::= <DIGIT SEQUENCE> I <DIGIT SEQUENCE> . <DIGIT SEQUENCE> <ALPH ABETIC CHARACTER> ::= A j B } C | D ] E | F j G j H j11J j K J L J M | N 1 0 |P| Q|R |S | T j U I V ] W j X | Y | Z <ALPHANUMERIC CHARACTER> ::= <ALPHABETIC CHARACTER> 1 <DIGIT> <DIGIT SEQUENCE> ::= <DIGIT> i <DIGIT SEQUENCE> <DIGIT> <DIGIT> ::= 1}2|3|4|5l6|7|8|9!0 APPENDICES A Structured Language for INteractive Graphics 58 Appendix C Graphical Data Structure The graphical variable a t t r i b u t e s , display value, and set union information are stored in the "Graphical Datum Table", The size of the table i s calculated by the translator as (number of graphical variables and functions + s i z e of subscripted variables ) * the core factor. The core factor increases the table s i z e by a default value of 120%, The homogeneous transformation matrices are stored i n six locations of the variable's entry i n the Graphical Datum Table. A "control" word i s stored for each graphical variable. Bit 3 indicates whether a graphical variable i s currently being displayed ("1" = yes). Bits zero through two indicate the display value of the variable ("0" = blank, " 1 " = l i n e , "2" = st r i n g ) . A minimum of two words are used to store set union information for each graphical variable. Each bit corresponds to a position in the Graphical Datum Table. If the b i t i s set then the corresponding graphical variable i s an element of that graphical variable set. A minimum of two words i s used because graphical variables of the type character use the words as pointers into the s t r i n g vector, APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 59 r a t h e r than as s e t u n i o n i n d i c a t o r s . The number o f words i n the s e t u n i o n i n d i c a t o r s i s dependent on the number of G r a p h i c a l V a r i a b l e Table e n t r i e s . There i s one b i t a l l o c a t e d f o r each e n t r y . Thus t h e two words a l l o c a t e d i n i t i a l l y w i l l be enough f o r up t o t h i r t y two g r a p h i c a l v a r i a b l e s . The t r a n s l a t o r a l l o c a t e s a l l needed s t o r a g e and manages t h e v a r i a b l e l i s t and e n t r y p o i n t s i n t o t h e g r a p h i c a l v a r i a b l e t a b l e . A l l o c a t i o n i n the t a b l e i s made on a s i m p l e s e q u e n t i a l b a s i s from the u s e r d a t a d e c l a r a t i o n . The t o t a l s t o r a g e a r e a f o r a n o n - c h a r a c t e r g r a p h i c a l v a r i a b l e i s (4+2+1+2)=9 words. Note t h a t i f more t h a n t h i r t y two g r a p h i c a l v a r i a b l e s a r e used t h e n more s t o r a g e i s needed. A count o f 33 t o 48 g r a p h i c a l v a r i a b l e s r e q u i r e s 10 words per v a r i a b l e . The l e n g t h of t h e s t r i n g s t o r a g e v e c t o r i s c a l c u l a t e d from t h e s t r i n g d e c l a r a t i o n i n t h e source program,. One word i s a l l o c a t e d f o r e v e r y two c h a r a c t e r s . The s e t i n f o r m a t i o n words of t h e e n t r y of a c h a r a c t e r v a r i a b l e p o i n t t o the b e g i n n i n g and the end o f the a s s o c i a t e d s t r i n g . L e n g t h , s u b s t r i n g and c o n c a t e n a t i o n o p e r a t i o n s modify t h e s e p o i n t e r s . No garbage c o l l e c t i o n scheme e x i s t s as y e t f o r t h e s t r i n g s t o r a g e a r e a . APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s i — —i 1 —t •—T : ! 1 1 1 1 1 ! I A | B | C | SET | 1 1 ! ! I L ; _ . 4 _ __.} I 1 I I I | 4 WOHDS | 2 WOHDS | 1 f 2 WORDS | « ; —.—'• — J I J , . J ; I F i g u r e I I G r a p h i c a l Datum T a b l e "A" = A M a t r i x "B" = B M a t r i x "C" = C o n t r o l word "SET" = s e t uni o n i n d i c a t o r words APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 61 r L-• •• T NO. of 1 V a r i a b l e s \ Words SLING .. — . T R e q u i r e d f | LIG j F a c t o r 1 i I * 1 1 ! 9 I 3.6K | 400x 2 J 18 I 3.6K f 200x 3 ! 27 I 3. 6K | 120x 10 J 90 I 3.6K | 4 Ox 39 \ 390 ! 3. 6K | 10x 100 | 1. 4K I - 1 -. — _' . . — J T a b l e I Core Usage Comparison The homogeneous t r a n s f o r m a t i o n m a t r i c e s a r e t h o s e used i n LIG. Use o f t h e m a t r i c e s i s advantageous i n t h a t c a l c u l a t i o n a s e r i e s o f t r a n s f o r m a t i o n s i s g u i t e s i m p l e . However o v e r f l o w o f m a t r i x e n t r i e s o c c u r s i f t h e s c a l e f a c t o r i s g r e a t e r t h a n three.,; APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 62 r i | XSCALE*COS(p -YSCALE*SIN<P 1 A = | I I XSCALE*SIN$ YSCALE*COS<p | L J r T B = j XLOC + (YSCALE*SIN<|> - XSCALE*COS<P)/2 | ! YLOC - {XSCALE*SIN$ + YSCALE*COS<J>)/2 j F i g u r e I I I Homogeneous C o o r d i n a t e M a t r i c e s XLOC = t h e h o r i z o n t a l a x i s x l o c a t i o n YLOC = t h e v e r t i c a l a x i s y l o c a t i o n XSCALE = the h o r i z o n t a l a x i s s c a l e f a c t o r YSCALE = t h e v e r t i c a l a x i s s c a l e f a c t o r <p = t h e r o t a t i o n a n g l e i n Radians APPENDICES A S t r u c t u r e d Language f o r i n t e r a c t i v e G r a p h i c s 63 Appendix D The T r a n s l a t o r The main d a t a s t r u c t u r e i n t h e t r a n s l a t o r i s a b i n a r y t r e e used t o a c c e s s the names and a t t r i b u t e s o f g r a p h i c a l and c h a r a c t e r v a r i a b l e s . As each g r a p h i c a l o r c h a r a c t e r d e c l a r a t i o n i s r e a d the name i s put i n t o t h e t r e e i n a l p h a b e t i c a l o r d e r . The l e v e l o f n e s t i n g a t which t h e v a r i a b l e was d e c l a r e d i s appended t o t h e name, t h e v a r i a b l e t y p e ( c h a r a c t e r o r g r a p h i c a l , v a r i a b l e , f u n c t i o n o r parameter) i s e n t e r e d and t h e e x e c u t i o n symbol t a b l e e n t r y i s r e c o r d e d . E x e c u t i o n t a b l e e n t r i e s (the g r a p h i c a l v a r i a b l e t a b l e o f Appendix C, F i g u r e I I ) a r e a l l o c a t e d s e q u e n t i a l l y as t h e v a r i a b l e s a r e r e a d . Note t h a t r e a l , i n t e g e r and l o g i c a l v a r i a b l e s a r e not e n t e r e d i n t o the t a b l e . E x p r e s s i o n s u s i n g such v a r i a b l e s a r e not p r o c e s s e d by the t r a n s l a t o r o t h e r t h a n by c o n v e r s i o n t o FORTRAN f o r m a t t i n g . , P r e d e f i n e d f u n c t i o n s and keywords a r e e n t e r e d i n t o the t r e e at i n i t i a l i z a t i o n t i m e . , The p r o c e s s i n g o f g r a p h i c a l s t a t e m e n t s APPENDICES A ..Structured Language f o r i n t e r a c t i v e G r a p h i c s 6H c r e a t e s a s e r i e s o f c a l l s t o FORTRAN r u n - t i m e r o u t i n e s i n the s u p p o r t i n g s u b r o u t i n e system. Access t o t h e g r a p h i c a l v a r i a b l e t a b l e i s handled by t h e t r a n s l a t o r . The e n t r y p o i n t i n t o t h e t a b l e i s passed t o the r u n - t i m e r o u t i n e s t o e f f e c t a c c e s s t o the s t o r e d a t t r i b u t e s o f t h a t v a r i a b l e . G r a p h i c a l parameters can be passed t o g r a p h i c a l f u n c t i o n s and pr o c e d u r e s . G r a p h i c a l parameter p a s s i n g i s done by r e f e r e n c e , A v a r i a b l e i s put i n th e f o r m a l parameter l i s t which i s r e p l a c e d by the a c t u a l parameter e n t r y p o i n t a t t i m e o f c a l l . E x t e r n a l f u n c t i o n s a c c e s s the t a b l e v i a an o f f s e t passed i n the system common a r e a . The t a b l e s i z e - i s d e t e r m i n e d by c o u n t i n g t h e number o f d e c l a r e d v a r i a b l e s , a r r a y s and f u n c t i o n s . T h i s number i s then i n c r e a s e d by t h e c o r e f a c t o r ( d e f a u l t 120%). The d i f f e r e n c e between t h e amount a c t u a l l y needed and t h a t a l l o c a t e d can be used by e x t e r n a l f u n c t i o n s . I f o v e r f l o w o c c u r s t h e u s e r must r e c o m p i l e h i s program w i t h a l a r g e r c o r e f a c t o r . APPENDICES A Structured Language for INteractive Graphics 65 Appendix E RESERVED WORDS AND SYMBOLS i) Those modifiable by the LITERAL statement: XLOCATIQN YLOCATION LOCATION XSCALE YSCALE SCALE ANGLE i i ) Syntactical keywords: BEGIN END FUNCTION PROCEDURE GRAPHICAL REAL INTEGER LOGICAL VARIABLE ARRAY LITERAL IS LABEL GET FROM KEY CURSOR PUT IN FILE ERASE IF ON THEN ELSE FOR AS TO BY CASE WHILE WITH DO CALL RETURN GO TO TRUE FALSE i i i ) Operators: assignment set union APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s * / ** HOD i I 5 I -1 0 a d d i t i o n , s u p e r p o s i t i o n s u b t r a c t i o n , d e l e t i o n m u l t i p l i c a t i o n d i v i s i o n power o f modulus s t r i n g c o n c a t e n a t i o n l o g i c a l AND l o g i c a l OR l o g i c a l NOT b r a c k e t s i v ) Comparators: < > <= >= IN l e s s than g r e a t e r t h a n l e s s t h a n o r e q u a l t o g r e a t e r t h a n o r e q u a l t o e q u a l t o not e q u a l t o element o f ( g r a p h i c a l on v i ) G r a p h i c a l P r i m i t i v e s : LINE BLANK v i i ) System R o u t i n e s : GATR COPY ERROR LENGTH PLOP POP STORE SUBSTR VERASE CAT DISPLAY HITH PATR PDSH RESTORE STRING STKPLT* v i i i ) B u i l t - i n F u n c t i o n s : ABS ALOG ARCOS ARSIN ATAN ATAN2 FLOAT IABS I F I X INT SIGN SIN APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c COS SIHH COSH SQHT EXP TAN * machine dependent r o u t i n e APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 68 Appendix F RUNNING INSTRUCTIONS To t r a n s l a t e a SLING program: $RUN ELEC:SLING [ SCARDS=... ] £ S P U N C H — . [ S P R I N T = . , . ] £PAR=CORE=<CORE FACTOR N0M8ER>] D e f a u l t s : SCARDS *SO0RCE* SPUNCH -LOAD SPRINT *SINK* CORE 120 To run a SLING program on t h e NOVA: 1) copy t h e f i l e s t o t h e NOVA d i s k 2) c o m p i l e t h e f i l e c o n t e n t s : FORTRAN <MAIN PROCEDURE NAME> {FORTRAN <SUB PROCEDURE NAM E>} 3) l o a d t h e p r o c e d u r e s and l i b r a r i e s : RLDR < MA IN PROCEDURE NAME> {<SUB PROCEDURE NAME>} [<USER.LB>] SLING, LB 10. LB MATH. LB TSK.LB APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s H) r u n t h e program: <MAIN PROCEDURE NAME> Legend: <> r e p l a c e w i t h a c t u a l name [ ] o p t i o n a l {} r e p e a t 0 or more t i m e s APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s Appendix G Sample Program L i s t i n g APPENDICES A Structured Language for INteractive Graphics 71 THE STRUCTURED LANGUAGE FOB INTERACTTV E GRAPHICS VERSION OF DECEMBER 1976 01-24-77 19:32:30 1 GRAPHICAL PROCEDURE INKING; 2 /* t h i s procedure c a l l s INK and displays i t 3 at 8 di f f e r e n t locations chosen by the user */ 4 INTEGER VARIABLE I,NUMBER,ROTAT; 5 REAL VARIABLE X,Y,SCALX,SCALY; 6 GRAPHICAL ARRAY LINES(30); 7 GRAPHICAL VARIABLE FIGURE; 8 GRAPHICAL EXTERNAL INK; 9 PUT 'PLEASE ENTER THE NUMBER OF LINES IN THE FIGURE'; 10 GET NUMBER; 11 PUT * PLEASE ENTER THE ANGLE OF ROTATION IN DEGREES'; 12 GET BOTAT; 13 PUT • PLEASE ENTER THE XY SCALES (0 - 1 ) ' ; 14 GET SCALX; GET SCALY; 15 ERASE;: 16 FIGURE += IN K (LINES, NUMBER) ; 17 FIGURE.SCALE :- SCALX,SCALY; 18 AS I := 1 TO 8 DO 19 BEGIN 20 GET X,Y FROM CURSOR; 21 FIGURE.LOCATION := X,Y; 22 PUT FIGURE; 23 FIGURE.ANGLE := FIGURE.ANGLE 24 +FLOAT (ROTAT) /180 . %3. 14159; 25 END; 26 END INKING; OBJECT FILE WRITTEN CORE REQUIREMENTS: GRAPHICAL DATA STRUCTURE: 39 * 10 WORDS STRING STORAGE: 0 WORDS CORE FACTOR: 120% COMPILATION TIME: 0.18 SECONDS END OF COMPILATION NO ERRORS WERE DETECTED. APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s THE STRUCTURED LANGUAGE FOR INTERACTIVE GRAPHICS VERSION OF DECEMBER 1976 •01-25-77 19:53:57 1 GRAPHICAL FUNCTION INK{GRAPHICAL ARRAY LINES; 2 INTEGER VARIABLE NUMBER) ; 3 GRAPHICAL EXTERNAL LINEAT; 4 /* t h i s p rocedure a l l o w s t h e user t o d e f i n e 5 a g r a p h i c a l o b j e c t o f h i s own c h o o s i n g */ 6 REAL VARIABLE A,B,C,D; 7 INTEGER VARIABLE I ; 8 GET A,B FROM CURSOR; 9 AS I : = 1 TO NUMBER DO 10 BEGIN 11 GET C,D FROM CURSOR; 12 LINES (I) := LINEAT (A, B, C, D) ; 13 PUT LINES (I) ; 14 INK *- INK + LINES(I) ; 15 A := C; 16 B := D; 17 END; 18 END INK; OBJECT FI L E WRITTEN CORE REQUIREMENTS: GRAPHICAL DATA STRUCTURE: 2 * 9 WORDS STRING STORAGE: 0 WORDS CORE FACTOR: 120% COMPILATION TIHE:0.25 SECONDS END OF COMPILATION NO ERRORS WERE DETECTED. APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 73 Appendix H Sample FORTHAN Object Code - T h i s FORTAN code i s a sample o f t h e code produced by t h e t r a n s l a t o r f o r t h e i n k i n g program of Appendix G. APPENDICES A Structured Language for INteractive Graphics 74 This routine i s the FORTRAN target code generated by the SLING routine INKING i n the previous Appendix. I t drives the INK graphical function, supplying the size (number of lines) of the graphical object to be drawn. The routine also inputs parameters used to manipulate the graphical object. REAL SCALY REAL SCALX REAL Y REAL X INTEGER ROTAT INTEGER NUMBER INTEGER I INTEGER AMATRIX(2,2,39) , BMATRIX (2,3 9) INTEGER CONTROL (39) , SET(39,3) INTEGER STRING (1) REAL GATR INTEGER TABLETOP,SHEAD,STACKP,ERRCO LOGICAL HIT,ITEST EXTERNAL HIT,GATR,ITEST DATA MAXSIZE/3 9/,TABLETOP/33/,ISLEN/1/,ISETW/3/ DATA (( (AMATRIX (I, J,K) ,K=1 ,39) ,J=1,2) ,1=1,2) /39* *10000,39*0,39*0,39*10000/, DATA BHATRIX/78*0/ DATA CONTROL/39*0/,SET/117*0/ DATA STRING/1 *' •/ COMMON MAXSIZE,TABLETOP,ISETW,ISLEN,SHEAD,STACKP,ERRCO WRITE FREE(10) 'ENTER THE NUMBER OF LINES IN THE FIGURE* READ FREE(11) NUMBER WRITE FREE(10) 'ENTER THE ANGLE OF ROTATION IN DEGREES' READ FREE(11) ROTAT WRITE FREE (10) »ENTER THE XY SCALES (0 - 1) » READ FREE (11) SCALX READ FREE (11) SCALY CALL ERASE SET (32,1) =0 CALL ISET(SET(32, (33- 1)/16+1) ,MOD (33-1 ,16) ) CALL INK(1,NUMBER,33,AHATHIX,BHATRIX,CONTROL,SET,STRING) CALL PATR(32,•XS',SCALX,AMATRIX,BMATRIX) CALL PATR (32, • YS» ,SCALY, AMATRIX, BMATRIX) 1=1 10001 IF( (1iLT,8) .AND. (I.LT. 1.0R.I.GT. 8) ) GO TO 10000 IF ((1.GT. 8) . AND. (I.GT. 1. OR. I. LT. 8) ) GO TO 10000 CALL CURSOR (MDUM,X,Y) CALL PATH (32, * XL' , X,AMATRIX, BHATRIX) CALL PATH(32,* YL',Y,AHATRIX,BMATRIX) CALL DISPLAY (32,AMATRIX,BMATRIX,CONTROL,SET,STRING) CALL PATH(32,'AN',GATR(32,'AN',AMATRIX,BMATRIX) APPENDICES *+FLOAT (EOTAT) /180.*3. 141 59,A MATRIX, BMATRIX) 1=1+(1) GO TO 10001 10000 CONTINUE STOP END APPENDICES A S t r u c t u r e a L a n g u a g e f o r I N t e r a c t i v e G r a p h i c s 76 T h i s r o u t i n e a p p e a r s i n t h e u s e r f u n c t i o n l i b r a r y . I t i s u s e d t o r e t u r n a g r a p h i c a l v a l u e r e p r e s e n t i n g A s e r i e s o f l i n e s i n p u t by t h e u s e r . SUBROUTINE INK( IN 1 , N U M B E R , I N 0 f A H A T R I X , B M A T R I X , • C O N T R O L , S E T , S T R I N G ) INTEGER I REAL D REAL C REAL B REAL A INTEGER NUMBER INTEGER A M A T R I X { 2 , 2 , M A X S I Z E ) , BMATRIX ( 2 , MAXSIZE) INTEGER CONTROL (MAXSIZE) , SET (MAXSIZE , ISETB) INTEGER STRING( ISLEN) REAL GATR INTEGER T A B L E T O P , S H E A D , S T A C K P , E B R C O LOGICAL H I T / I T E S T EXTERNAL H I T , G A T R , I T E S T COMMON M A X S I Z E , T A B L E T O P , I S E T H , I S L E N , S H E A D , S T A C K P i S S I Z E CALL CURSOR (MDUM, A,B) 1= 1 10001 I F ( (1 .LT .NUMBER) . A N D . ( I . L T . 1 . 0 R . I . G T . N U M B E R ) ) GO TO 10000 I F ( ( 1 . G T . NUMBER) . A N D . ( I . GT. 1 . OR. I. L T . NUMBER) ) GO TO 10000 CALL CURSOR (MDUM,C,D) SET (IN1 + I, 1)=0 C A L L I SET (SET (IN1 + I, (T ABLETOP+2) / 1 6 + 1) , *MOD(TABLETOP + 2 - 1 , 15) ) C A L L L I N E A T ( A , B , C , D , T A B L E T O P + 2 , A M A T R I X , • B M A T R I X , C O N T R O L , S E T , STRING) CALL COPY( IN1 +1,TABLETOP + 2 , A M A T R I X , B M A T R I X , C O N T R O L , S E T ) C A L L D I S P L A Y ( I N 1+1 , A M A T R I X , B M A T R I X , C O N T R O L , S E T , S T R I N G ) C A L L I S E T ( S E T ( I N 0 , (IN 1+1) /16+1) , MOD (IN 1 + 1 - 1 , 15) ) A=C B=D 1=1+(1) GO TO 10001 10000 CONTINUE RETURN END APPENDICES A Structured Language for INteractive Gra ph i c s 77 Appendix I A Review of Language Statements i) Transput PUT A,B; -The PUT statement w i l l put a variable or constant of any type on the screen. - If a blank i s put on the screen then the next non-graphical or non-character variable w i l l be put over that blank. PUT TRUCK IN -F|LE-TRUCKFILE; - The graphical variable TBUCK i s written into a f i l e c a l l e d "TRUCKFILE". The f i l e i s automatically created. GET X,Y; - The GET statement gets values from the keyboard. in t h i s case the values must be BEAL or INTEGER. GET TBUCK FROM, ^ IIjE TRUCKFILE; - In t h i s variant a graphical variable i s returned from a f i l e . GET X,Y FROM CTRSOB; -The x,y cursor coordinates are returned when the user h i t s any.key on the keyboard. The values are from (0.0 - 1.0). , GET CHAR PROM KEY; - The key that the user h i t i s returned after the user keyboard interruptw Both this and the above variant stop execution of the program and turn on the cursor u n t i l the user responds. APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 78 i i ) Begin Statement BEGIN A ~ : = 3; B := 4; J I S i - The BEGIN s ta tement i s used to b r a c k e t a s e r i e s o f s ta tements . I t i s a v a l i d o b j e c t s tatement o f a c o n t r o l c o n s t r u c t . i i i ) C o n t r o l WITH LOCATION DO BUS : = 0 . 5 , 0 . 5 ; - The a t t r i b u t e LOCATION o f the g r a p h i c a l or c h a r a c t e r v a r i a b l e BUS i s s e t t o the g i v e n v a l u e s . -WITH BUS DO LOCATION := 0. 5 ,0 . 5; - Again the a t t r i b u t e s are se t t o the g i v e n v a l u e s . There i s no d i f f e r e n c e i n the g i v e n examples , they show t h a t e i t h e r a v a r i a b l e or an a t t r i b u t e may be m o d i f i e d us ing the WITH s ta tement . FOR TRUCK DO I := I + 1; - T h i s s tatement i t e r a t e s th rou gh the members o f the se t of TRUCK ( i . e . , i t s components ) . , In t h i s case "I" counts the number o f e lements of the TRUCK, The named v a r i a b l e (TRUCK) must be g r a p h i c a l or c h a r a c t e r . AS I := J TO K 1 1 - 1 DO R := R + 1.0; - T h i s s tatement i s s i m i l a r to the DO l o o p o f P L / I . The o b j e c t s tatement i s not executed i f the l o o p c o n d i t i o n s do not h o l d on e n t r a n c e to the l o o p . T e s t i n g i s done a t the top o f the l o o p . . I S I I I I <= 10 DO R := R + 1 . 0 ; T h i s s tatement i s s i m i l a r to the WHILE s tatement o f P L / I . The t e s t o f t h e l o g i c a l va lue i s made a t the e n t r a n c e to the l o o p . ,,; CASE I DO BEGIN J := J + 1; K := K + 1; END; APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 79 ELSE L := L + 1; - " I " must r e s o l v e t o an i n t e g e r v a l u e . The " I " t h statement i n t h e BEGIN c l a u s e i s e x e c u t e d . I f " I " does not r e s o l v e t o a number i n t h e range o f s t a t e m e n t s i n t h e BEGIN c l a u s e t h e n t h e ELSE c l a u s e i s e x e c u t e d . I F A < B THEN GO TO ALPHA; ELSE GO TO BETA; - I f t h e l o g i c a l v a l u e o f the argument i s t r u e t h e n the THEN c l a u s e i s e x e c u t e d , o t h e r w i s e the ELSE c l a u s e i s execut e d . ON TRUCK THEN I : = 3; ' - I : = 4; - The c u r s o r i s t u r n e d on and e x e c u t i o n h a l t s u n t i l the us e r p r e s s e s a key. I f the c u r s o r was o v e r the i d e n t i f i c a t i o n a r e a o f t h e argument (TBUCK) t h e THEN c l a u s e i s e x e c u t e d , o t h e r w i s e t h e ELSE c l a u s e i s ex e c u t e d . The argument must be a g r a p h i c a l o r a c h a r a c t e r v a r i a b l e . i v ) Assignment A := A + 1; The assignment statement p l a c e s t h e v a l u e of the e x p r e s s i o n on t h e r i g h t hand s i d e o f t h e assignment o p e r a t o r i n t o t h e l o c a t i o n a d d r e s s e d by t h e name o f the v a r i a b l e on t h e l e f t hand s i d e . The g r a p h i c a l s e t union o p e r a t o r "+=" d i s c u s s e d i n 3-E has a d i f f e r e n t meaning th a n t h e assignment o p e r a t o r : TBUCK •= TRUCKB; - The s e t u n i o n s t a t e m e n t has t h e e f f e c t of p u t t i n g TRUCKB i n t o t h e s e t o f TRUCKA where assignment moves t h e 9 data words a s s o c i a t e d w i t h a g r a p h i c a l v a r i a b l e . The assignment statement s h o u l d be used o n l y i f i t i s n e c e s s a r y t h a t t h e s e t o f a t t r i b u t e s be s t o r e d t e m p o r a r i l y v) D e c l a r a t i o n s REAL VARIABLE X, Y; I I T E G I R ~ V A R I A B L E I t , K2; LOGICAL ARRAY A (10) , B (20) ; GRAPHICAL VARIABLE TRUCK, BUS; APPENDICES A S t r u c t u r e d language f o r I N t e r a c t i v e G r a p h i c s 80 GRAPHICAL ARRAY MEMBER (1.0) ; CHAli£ilS{^°)""cHAR(10) ; - R e a l , i n t e g e r and l o g i c a l d e c l a r a t i o n s a r e s e l f e x p l a n a t o r y -TRUCK and BUS a r e d e c l a r e d as g r a p h i c a l v a r i a b l e s . , MEMBER i s an a r r a y o f 11 e l e m e n t s , each o f which i s a g r a p h i c a l datum. - G r a p h i c a l a r r a y bounds are i n d e x e d from z e r o , no lower bound s p e c i f i c a t i o n i s p o s s i b l e . M u l t i d i m e n s i o n a l a r r a y s o f g r a p h i c a l and c h a r a c t e r v a r i a b l e s a r e not p e r m i t t e d . - The c h a r a c t e r a r r a y CHAR has 11 e l e m e n t s each o f which c o n t a i n a maximum o f t e n c h a r a c t e r s . LITERAL XL IS XLOCATION; - The l i t e r a l s t a t ement a l l o w s t h e programmer t o s h o r t e n c e r t a i n keywords. , The l i s t : o f keywords t h a t can be r e d e f i n e d i n t h e l i t e r a l s tatement i s g i v e n i n Appendix E. GRAPHICAL EXTERNAL CIRCLE, SQUARE; i ITIGER""! XTERN AL"* NT H R 0 0T ; - A l l e x t e r n a l f u n c t i o n s n o t mentioned as b e i n g b u i l t - i n i n Appendix E must be d e c l a r e d . The d e c l a r a t i o n must s p e c i f y t h e TYPE o f t h e f u n c t i o n . LABEL L1,L2; - A l l l a b e l s must be d e c l a r e d . I f a l a b e l i s not d e c l a r e d then i t w i l l be assumed by c o n t e x t , and the t r a n s l a t o r w i l l g i v e a wa r n i n g . v i ) A l g o r i t h m Head GRAPHICAL PROCEDURE ALPHA; I ITEGER~FUNCTION"BETA(K); GRAIHICAt"FU:NCTIQN TRUCK; - P r o c e d u r e s and f u n c t i o n s may be REAL, INTEGER, LOGICAL o r GRAPHICAL. A f u n c t i o n r e t u r n s a v a l u e of the a s s o c i a t e d t y p e . The o u t e r procedure must be g r a p h i c a l i f n e s t e d p r o c e d u r e s a r e g r a p h i c a l . R e a l , i n t e g e r , and l o g i c a l p r o c e d u r e s a r e more e f f i c i e n t t h a n g r a p h i c a l p r o c e d u r e s , however t h e s e p r o c e d u r e s may c o n t a i n no g r a p h i c a l o r c h a r a c t e r v a r i a b l e s . , v i i ) R eturn Statement APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 81 RETURN: - T h e r e t u r n s t atement r e t u r n s e x e c u t i o n t o the c a l l i n g program. I t must appear once i n a f u n c t i o n , but can appear any number o f t i m e s . v i i i ) Go t o Statement GO TO ALPHA; - ALPHA must be a d e c l a r e d l a b e l a t t a c h e d to some statement i n t h e procedure body. ,;• i x ) Erase Statement ERASE CAR; ERASE; - The e r a s e s t a t e m e n t can e r a s e a s i n g l e v a r i a b l e , as shown i n the f i r s t example or i t can be used t o e r a s e t h e whole s c r e e n a s i n t h e second example. x) P r o c e d u r e C a l l CALL S1 (A,B,C) - S t a r t s e x e c u t i o n o f t h e named proce d u r e a t t h e p o i n t o f c a l l . On r e t u r n .from t h e : procedure e x e c u t i o n b e g i n s a g a i n a t the s t a t e m e n t a f t e r t h e c a l l . Parameters a r e passed by t h e normal FORTRAN c a l l i n g c o n v e n t i o n s e x c e p t g r a p h i c a l s which a r e passed by r e f e r e n c e o n l y . APPENDICES A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 82 Index a n g l e .. .. .. .. .. . .... 16,65 a r r a y 4,80 as 20,21,78 a t t r i b u t e 16,17,19,20,31,58 b e g i n statement •. 20,78 b i b l i o g r a p h y 37 bnf s y n t a x 55 b u i l t - i n f u n c t i o n 66 case 14,20 ,22,79 c h a r a c t e r s t r i n g c o n s t a n t 30 c h a r a c t e r v a r i a b l e 5,19,28,30,80 c o e r c i o n 30 comparator ............................... .... ............... 66 c o m p i l e 68 c o n c a t e n a t i o n 19,29,59 c o n t r o l s t r u c t u r e .. .......................... ............ 32,78 c o n t r o l word ................................. ............... 58 c o r e f a c t o r • 58,68 c o r e usage 5,9, 15,26,27,58 c u r s o r 6,18,25,77 da t a d e c l a r a t i o n .. ........................................... 4 d a t a s t r u c t u r e , 10,16,32,58 database 9,25 d e c l a r a t i o n .. . 79 d e f a u l t ............................................ 16,19,27,68 d e l e t i o n 14,17,19,27 d i s k 15,25,34 d i s p l a y 6 e x t e n s i b l e 33 e x t e r n a l 4,80 f i l e 15,25,30,77 f o r 14,20,21,78 garbage c o l l e c t i o n ....................... ..«•................ 59 get 25,30,77 g r a p h i c a l d a t a s t r u c t u r e 58 g r a p h i c a l datum t a b l e 60 g r a p h i c a l f u n c t i o n 5,15,16,26 g r a p h i c a l procedure 11,16 g r a p h i c a l v a r i a b l e 16,30,58 homogeneous c o o r d i n a t e m a t r i c e s .......... ................ 58,61 h o s t language ......... . 8 human e n g i n e e r i n g 10 i d e n t i f i c a t i o n a r e a , 18,19 i f ; 14,20,23,79 i n t e r r u p t ........................ ..................... 10 ,18,34 i t e r a t i v e 21 keyword 65 l a b e l 80 Index A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 8 3 l e n g t h 19,59 l i b r a r y ............... ....................... .... 5,15,19,26,68 l i t e r a l 33,65,80 l o c a t i o n ......................... ........................... 65 l o g i c a l e x p r e s s i o n ................................. 18,22,23,31 l o g i c a l o p e r a t o r ............... .. .... .. .. .... ....... ........ 17 minicomputer ....... .... v................................. . 6,32 n e s t i n g ....... .......... ..*.-. ............ .... 4 o b j e c t i v e s 14 on • 18,20,24,79 o p e r a t o r 27,65 o v e r l a y 9 p o r t a b l e 34 p r i m i t i v e 9,15,66 p r o c e d u r a l language ......................................... 14 program 4 put 25,30,77 r e c u r s i v e ................................................... 11 r e f e r e n c e s 37 r e s e r v e d symbol 65 r e s e r v e d word * 65 r e v i e w 77 run 68 s c a l e . 6 5 s c a r d s • 68 scope • 4 s c r e e n 16 s e l f - c o m p i l i n g ................... .......... 32,35 s e t 15,17,27,58 s h o r t c o m i n g s 32 s p r i n t 68 spunch 68 sta t e m e n t r e v i e w 77 s t r i n g v e c t o r 59 s t r u c t u r e d language 9,10,14 s u b s t r i n g 19,59 s u p e r p o s i t i o n 14,17,19,27 symbol t a b l e * ................. 5,58 s y n t a x 33,41,55 s y n t a x c h a r t s 41 system r o u t i n e .............. ... 66 t r a n s l a t o r . . . . . . . . . . . . v . . v . . . . . . • • . • . . . . . . . . . ............ 63,64 t r a n s l a t o r w r i t i n g system . . . 3 2 , 3 5 t r a n s p o r t a b l e 32 t r a n s p u t .. 5,6,15,25,34,77 t y p e 25,30 use ...............................•....••••••••«•.••«•••••»• 68 while-...^;C.v.^v :^ w i t h 14,20,78 x l o c a t i o n ,16,65 x s c a l e .... ........ .......". 16 ,65 y l o c a t i o n ...16,65 Index A S t r u c t u r e d Language f o r I N t e r a c t i v e G r a p h i c s 84 y s c a l e . ... .. • • • • ,1 6 ,65 BCPL • 3 6 BGRAF2 11 DALI 1 2 ES P . . 11 FORTRAN ..... ........... 4,6,8,15,73 GRIP I0 IBM 370 ........... ...... .. .... ........... .. .............. . 6,32 IMAGE • 1 ° LIG 6,8 MTS * 6 NOVA f ° SKETCHPAD . .... ............ 13 SUGAR • ^ XPL ........... ................... .... . • . . ........ ... ... ... Index 

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}]}"
                            data-media="{[{embed.selectedMedia}]}"
                            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:
https://iiif.library.ubc.ca/presentation/dsp.831.1-0076830/manifest

Comment

Related Items