# # Copyright (c) 1994 # Open Software Foundation, Inc. # # Permission is hereby granted to use, copy, modify and freely distribute # the software in this file and its documentation for any purpose without # fee, provided that the above copyright notice appears in all copies and # that both the copyright notice and this permission notice appear in # supporting documentation. Further, provided that the name of Open # Software Foundation, Inc. ("OSF") not be used in advertising or # publicity pertaining to distribution of the software without prior # written permission from OSF. OSF makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Copyright (c) 1996 X Consortium # Copyright (c) 1995, 1996 Dalrymple Consulting # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the names of the X Consortium and # Dalrymple Consulting shall not be used in advertising or otherwise to # promote the sale, use or other dealings in this Software without prior # written authorization. # instant - a formatting application for OSF SGML instances ____________________________________________________________________________ Requirements ANSI C compiler (gcc is one) sgmls 1.1 -- sgml parser from James Clark. Based on Goldfarb's ARC parser. Vanilla unix make POSIX C libraries Files for instant program Module Function ------ -------- browse.c interactive browser general.h general definitions info.c print information about the instances main.c main entry, arg parsing, instance reading tables.c table-specific formatting routines (TeX and tbl) traninit.c translator initialization (read spec, etc.) translate.c main translator translate.h structure definitions for translation code tranvar.c routines for handling "special variables" util.c general utilities Also required 1. Translation spec (transpec) files. (../transpecs/*.ts) 2. SDATA mapping files for mapping sdata entities. (../transpecs/*.sdata) 3. Character mapping files for mapping characters. (../transpecs/*.cmap) Platforms tried on OSF1 1.3 (i486) Ultrix 4.2 (mips) HP-UX 9.01 (hp 9000/700) AIX 3.2 (rs6000) SunOS [missing strerror()] ____________________________________________________________________________ General outline of program ------- ------- -- ------- To summarize in a sentence, instant reads the output of sgmls, builds a tree of the instnace in memory, then traverses the tree in in-order, processing the nodes according to a translation spec. Element tree storage ------- ---- ------- The first thing instant must do is read the ESIS (output of sgmls) from the specified file or stdin, forming a tree in memory. (Nothing makes sense without an instance...) Each element of the instance is a node in the tree, stored as a structure called Element_t. Elements contain content (what else?), which is a mixture of data (#PCDATA, #CDATA, #RCDATA - all the same in the ESIS), child elements, and PIs. Each 'chunk' of content is referred to by a Content_t structure. A Content_t contains an enum that can point to a string (data or PI), another Element_t. For example, if a
element
contains some characters, an