SGML Functions for Athenamuse 2
Total Page:16
File Type:pdf, Size:1020Kb
SGML Functions for AthenaMuse 2 by James C. Gentry SUBMITTED TO THE DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN COMPUTER SCIENCE AND ENGINEERING AT THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY JUNE 1996 © 1996 James C. Gentry. All Rights Reserved The author hereby grants MIT permission to reproduce and to distribute publicly paper and electronic copies of this thesis document in whole or in part. Signature of A uthor ............ .................................................................................................. - " 1"epartment of Electrical Engineering and Computer Science May 28, 1996 Certified by....-. .............. .... ................... ............ .................................................................. Steven Lerman Professor of Civil and Environmental Engineering Director, Center for Educational Computing Initiatives Si t Thesis Supervisor Accepted by ............ .. .......... ...... .................................................................................. NJFrederic R. Morgenthaler Graduate Officer, Depart ent of Electrical Engineering and Computer Science OF TEC-HNOLOGY Eng. JUN 1 1 1996 LIUBRARIES SGML Functions for AthenaMuse 2 by James C. Gentry Submitted to the Department of Electrical Engineering and Computer Science on May 28, 1996 in partial fulfillment of the requirements for the Degree of Master of Science in Computer Science and Engineering ABSTRACT The Standard Generalized Markup Language provides a way to specify markup languages. With these markup languages, diverse types of information can be organized. SGML makes the storage and sharing of information easier, and it is being used by an increasingly large number of publish- ers. AthenaMuse 2 is a tool used to create multimedia computer programs, which is currently being developed at the Center for Educational Computing Initiatives of the Massachusetts Institute of Technology. AM2 uses an object-oriented language called the Application Description Language (ADL) to script multimedia programs. This paper describes a group of classes, written for the ADL, which can parse and dissect SGML documents. These classes, collectively called AM2SGML, will enable the AM2 application developer to use SGML in his applications, and in the future will possibly provide the base for a new set of ADL Hypertext Markup Language (HTML) classes. Thesis Supervisor: Steven Lerman Title: Professor of Civil and Environmental Engineering; Director, Center for Educational Com- puting Initiatives Acknowledgments There are many people I would like to acknowledge for helping me complete this paper. First, I would like to thank everyone at the Center for Educational Computing Initiatives. I espe- cially thank Professor Steven Lerman for his guidance through every stage in this project. I also thank Ana Beatriz Chiquito for first introducing me to CECI. I would like to thank my Brothers and friends at Pi Lambda Phi, Massachusetts Theta, for giving me support at the times when I did not happen to be working on this or any other projects. And finally, I would like to thank my family, for reasons which go without saying. Table Of Contents 1 M otivation ..................................................................................................................... 13 1.1 SGM L .................................................................................................................... 13 1.2 AM 2 ....................................................................................................................... 14 1.2.1 Better HTML Functions .................................................................................................... 14 1.2.2 The Current State of HTML in AM2 ................................................................................ 15 1.3 SGM L in AM 2 ....................................................................................................... 16 2 Specifications ................................................................................................................ 17 2.1 Purpose...................................................................................................................17 2.2 Class Specifications ............................................................................................... 17 2.2.1 The DTD Classes .............................................................................................................. 20 2.2.1.1 The MMdtd Class................................................................................................ 20 2.2.1.2 The MMdtdDocumentType Class................................................................... 22 2.2.1.3 The MMdtdElement Class ............................................................................... 26 2.2.1.4 The MMdtdContentModel Class................................................................... 29 2.2.1.5 The MMdtdAttribute Class .......................................................................... 32 2.2.1.6 The MMdtdEntity Class ................................................................................. 36 2.2.1.7 The MMdtdNotation Class ............................................................................ 38 2.2.1.8 The MMsgmlSectionMark Class................................................................... 40 2.2.1.9 The MMsgmlComment Class ............................................................................ 41 2.2.2 The Document Instance Classes........................................................................................ 42 2.2.2.1 The MMsgmlDocument Class .......................................................................... 42 2.2.2.2 The MMsgmlElement Class ............................................................................ 44 2.2.2.3 The MMsgmlPCData Class............................................................................... 45 2.2.2.4 The MMsgmlEmpty Class.................................................................................46 2.2.2.5 The MMsgmlAttribute Class........................................................................ 47 3 The AM 2SGM L C++ Classes ..................................................................................... 49 3.1 YASP......................................................................................................................49 3.1.1 Why YASP? ....................................................................................................................... 49 3.1.2 An Overview of YASP ...................................................................................................... 50 3.2 Overview of the AM 2SGM L C++ Functions ........................................................ 50 3.3 AM 2SGM L M odule Descriptions ......................................................................... 52 3.3.1 The Test Function.............................................................................................................. 52 3.3.2 The parseSGMLFile Function ..................................................................................... 52 3.3.3 The dispatch Function ................................................................................................. 54 3.3.4 The SGMLObj ect Class and its Subclasses .................................................................... 56 3.3.4.1 The SGMLDocument Class............................................................................... 56 3.3.4.2 The SGMLElement Class .............................................................................. 57 3.3.5 The Service Functions.......................................................................................................58 3.3.5.1 The eltSt Function .......................................................................................... 58 3.3.5.2 The eltNd Function .......................................................................................... 59 3.3.5.3 The text Function ............................................................................................ 59 3.3.5.4 The msg Function.............................................................................................. 60 3.3.5.5 The sGet and sFre Functions..........................................................................61 3.3.5.6 The find Function ........................................................................................... 61 3.3.5.7 The xEnOp Function .......................................................................................... 62 3.3.5.8 The utOpR and utOpW Functions................................................................... 63 3.3.5.9 The utWrt Function .......................................................................................... 63 3.3.5.10 The utRd Function ........................................................................................... 63 3.3.5.11 The utCl and xEnCl Functions......................................................................... 64 3.3.5.12 The xEnRd Function .......................................................................................... 64 3.3.5.13 The proSt Function ....................................................................................... 64 3.3.5.14 The docNd Function .......................................................................................... 65 3.3.5.15 The DTDSt Function ......................................................................................