TIPPrivate.mesa; Last Edited by McGregor, June 10, 1982 10:29 am
Last Edited by: Maxwell, December 17, 1982 9:52 am
DIRECTORY
Interminal USING [KeyName],
IO USING [Handle],
RefTab USING [Ref],
Rope USING [ROPE],
TIPTables USING [TIPTable];
TIPPrivate: CEDAR DEFINITIONS = BEGIN OPEN TIPTables;
the following are for internal use only
ReadTIPTable: PROC [s: IO.Handle]
RETURNS [table: TIPTable, keyOption: KeyOption ← none];
BadTable: ERROR; -- raised by ReadTIPTable
WriteTIPTable: PROC [table: TIPTable, keyOption: KeyOption, s: IO.Handle];
EqualTables: PROC [t1, t2: TIPTable];
version: CHAR = '1; -- table syntax version number
qZ: ZONE; -- quantized zone for allocations
predTable: RefTab.Ref; -- table for user defined predicates
KeyOption: TYPE = {none, printKeys, defaultKeys};
Symbol: TYPE = {OptionSym, Small, Fast, FastMouse, SlowMouse, PrintKeys, DefaultKeys,
Opaque, Select, Trigger, Enable, From, Endcase, End, While, And, Up, Down, Mouse, After,
Before, RightArrow, Comma, Semicolon, LeftCurly, RightCurly, Greater, Dot, VertBar,
Char, Coords, Time, KeyIdent, Ident, Number, String, Illegal};
nrOfErrors: CARDINAL = 30;
errorText : REF ARRAY [0..nrOfErrors] OF Rope.ROPE;
keyNames: REF ARRAY Interminal.KeyName OF Rope.ROPE;
InitBuilder: PROC;
END.
The syntax of "compiled" tip table files follows:
capital letters, numbers and parens are character literals
lower case id's are names of syntax equations
id* means 0 or more instances
<id> is a primitive of some sort such as text
file = TIPTABLE version opaque link ignore variant
version = <char>
opaque = flag
link = N --none-- | P --printKeys-- | D --defaultKeys--
ignore = up down move
up = flag
down = flag
move = flag
variant = S small | F fast
small = choiceseries
fast = choice U choicearray D choicearray time
time = choice
choicearray = ( choiceitem* )
choiceitem = ( key choice )
choiceseries = ( choice* )
choice = ( term* )
term = 1 keytrigger | 2 --mousetrigger-- | 3 timetrigger | 4 keyenable |
5 predenable | 6 --CHAR-- | 7 --COORDS-- | 8 choiceseries | 9 results |
A key2Enable | B keyEnableList | C --TIME--
keytrigger = key keystate
key = <byte>
keystate = U --up-- | D --down--
timetrigger = timeoutflavor msecs
timeoutflavor = G --gt-- | L --lt--
msecs = high low
high = <byte>
low = <byte>
keyenable = key keystate
key2Enable = keyenable keyenable
keyEnableList = ( keyenable* )
predenable = atom
results = ( result* )
result = 1 atom | 2 --TIPUser.stdChar-- | 3 <int> | 4 len <text> |
5 --TIPScreenCoords-- | 6 --TIPUser.stdTime--
flag = T | F -- true or false
atom = len pname
pname = <text>
len = <byte>
<text> stored as series of characters. length limited to 255 chars
<int> stored as 4 bytes
<char> and <byte> stored as themselves