|
|
1.1 root 1: .bp
2: .sh 1 "A Textual Representation for \*(IP"
3: .sh 2 Introduction
4: .lp
5: This section describes a language used to represent an Interpress master in
6: human readable form.
7: In order to make an Interpress master compact,
8: an encoding scheme is used to represent the operators and the values.
9: Although this encoding uses less disk space and results in shorter
10: transmission times, it is practically impossible to examine or edit an
11: Interpress master. For this reason, the utilities \fIiptotext\fP and
12: \fItexttoip\fP represent the master as a text file.
13: For someone to completely use the Interpress utilities and understand the
14: output, an understanding of the text representation is necessary.
15: It is recommended
16: that the reader of this section have a working knowledge of Interpress.
17: .sh 2 Tokens
18: .lp
19: The keyword \*(lqHeader\*(rq indicates that the following string is the
20: header that appears at the front of the Interpress file. This keyword can
21: only be used once at the top of the file. It is not checked for validity.
22: .sh 2 "Integers"
23: .lp
24: A series of digits optionally preceded by a plus or minus sign is an integer.
25: .sh 2 "Short numbers"
26: .lp
27: Any integer that starts in the first column is translated into an Interpress
28: \fIshort number\fP. This number must be in the range \(mi4000..28767.
29: .sh 2 "Operators"
30: .lp
31: Any word that starts in the first column
32: is translated into an operator, with the exceptions noted in \fIkeywords\fP.
33: The \*(lqpseudo\*(rq operators are handled as follows.
34: The word \*(lqBEGIN\*(rq marks
35: the beginning of a block. The word \*(lqEND\*(rq indicates the
36: end of a block. The character \*(lq{\*(rq indicates the beginning
37: of a body and the character \*(lq}\*(rq indicates the end of a
38: body. All other words refer to an Interpress operator. The names found in
39: Appendix B of the \fIInterpress Electronic printing Standard\fP
40: are recognized. The case of the letters is insignificant.
41: .sh 2 "Comments"
42: .lp
43: Anything that appears in parentheses is assumed to be a
44: comment and is ignored. These comments should not be confused with a
45: comment sequence.
46: .sh 2 "Sequences"
47: .lp
48: If the first
49: character on the line is \*(lq>\*(rq then the remainder of the line
50: describes a \fIsequence\fP.
51: If the second character is also \*(lq>\*(rq then the
52: sequence described is \fIlong\fP, otherwise it is \fIshort\fP.
53: The keyword that starts
54: in the third column describes the type of sequence. The value of the
55: sequence appears after the colon. The following names are valid sequence
56: names: Comment, Identifier, Insert file, Integer, Rational, String.
57: .sh 2 "Strings"
58: .lp
59: Strings are represented in the same way they are in C.
60: A double quote is used to mark each end of the string
61: and a backslash is used to indicate the start of a special
62: character. If a digit follows a backslash, it starts an octal number that
63: does not exceed three digits. This number is the octal value of the
64: character represented. For example, the string "a\e244b" consists of an
65: ascii \*(lqa\*(rq followed by the octal value 244 and ending with an ascii
66: \*(lqb\*(rq. Two successive backslashes represents a single backslash and a
67: backslash followed by a double quote represents a double quote. It will not
68: be uncommon in program listings to use strings like:
69: "#include\ \e"file.h\e"".
70: .sh 2 "Rationals"
71: .lp
72: A rational number is represented as a fraction with a slash separating the
73: numerator and the denominator.
74: For example: \*(lq1/2\*(rq represents the rational 1 over 2.
75: .sh 2 Format
76: .sp
77: Here is a Backus-Naur style grammar that describes the text format
78: (tokens are in italics, literals are contained in double quotes):
79: .sp
80: .(l
81: textFile ::= prelim body | body
82:
83: prelim ::= file header | file | header
84:
85: file ::= "File: " \fIstring\fP \fInl\fP
86:
87: header ::= "Header: " \fIstring\fP \fInl\fP
88:
89: body ::= line \fInl\fP\^ body | line \fInl\fP
90:
91: line ::= \fIinteger\fP | \fIoperator\fP | short-long sequence
92:
93: .ta \w'sequence ::= 'u
94: sequence ::= "Comment: " \fIstring\fP |
95: "Identifier: " \fIidentifier\fP |
96: "Insert file: " \fIstring\fP |
97: "Integer: " \fIinteger\fP |
98: "Rational: " \fIinteger\fP\^ "/" \fIinteger\fP |
99: "String: " \fIstring\fP
100:
101: short-long ::= "> " | ">>"
102: .)l
103: .sp
104: The token \fInl\fP\^ is a newline or line terminator.
105: The other italicized tokens are explained in the previous section.
106: .sh 2 Omissions
107: .lp
108: There is currently no way to express large vectors or any
109: of the pixel vectors. There is also no way to specify a continued
110: sequence.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.