1 
2 /******************************************************************************
3 * MODULE     : drd_std.cpp
4 * DESCRIPTION: standard drd for TeXmacs; most other drd's inherit from it
5 * COPYRIGHT  : (C) 2003  Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
11 
12 #include "drd_std.hpp"
13 #include "vars.hpp"
14 
15 drd_info std_drd ("tm");
16 drd_info the_drd= std_drd;
17 hashmap<string,int> STD_CODE (UNKNOWN);
18 
19 #define BIFORM   CHILD_BIFORM
20 #define DETAILED CHILD_DETAILED
21 
22 #define regular(i) type (i, TYPE_REGULAR)
23 #define raw(i) type (i, TYPE_RAW)
24 #define macro(i) type (i, TYPE_MACRO)
25 #define argument(i) type (i, TYPE_ARGUMENT)
26 #define variable(i) type (i, TYPE_VARIABLE)
27 #define binding(i) type (i, TYPE_BINDING)
28 #define boolean(i) type (i, TYPE_BOOLEAN)
29 #define integer(i) type (i, TYPE_INTEGER)
30 #define string_type(i) type (i, TYPE_STRING)
31 #define numeric(i) type (i, TYPE_NUMERIC)
32 #define length(i) type (i, TYPE_LENGTH)
33 #define code(i) type (i, TYPE_CODE)
34 #define url_type(i) type (i, TYPE_URL)
35 #define identifier(i) type (i, TYPE_IDENTIFIER)
36 #define color_type(i) type (i, TYPE_COLOR)
37 #define graphical(i) type (i, TYPE_GRAPHICAL)
38 #define constraint(i) type (i, TYPE_CONSTRAINT)
39 #define graphical_id(i) type (i, TYPE_GRAPHICAL_ID)
40 #define point_type(i) type (i, TYPE_POINT)
41 #define effect(i) type (i, TYPE_EFFECT)
42 #define animation(i) type (i, TYPE_ANIMATION)
43 #define duration(i) type (i, TYPE_DURATION)
44 
45 #define returns_adhoc() type (TYPE_ADHOC)
46 #define returns_boolean() type (TYPE_BOOLEAN)
47 #define returns_integer() type (TYPE_INTEGER)
48 #define returns_string() type (TYPE_STRING)
49 #define returns_numeric() type (TYPE_NUMERIC)
50 #define returns_length() type (TYPE_LENGTH)
51 #define returns_url() type (TYPE_URL)
52 #define returns_identifier() type (TYPE_IDENTIFIER)
53 #define returns_animation() type (TYPE_ANIMATION)
54 #define returns_color() type (TYPE_COLOR)
55 #define returns_graphical() type (TYPE_GRAPHICAL)
56 #define returns_constraint() type (TYPE_CONSTRAINT)
57 #define returns_effect() type (TYPE_EFFECT)
58 
59 static tag_info
fixed(int arity,int extra=0,int child_mode=CHILD_UNIFORM)60 fixed (int arity, int extra=0, int child_mode= CHILD_UNIFORM) {
61   return tag_info (arity, extra, ARITY_NORMAL, child_mode, true);
62 }
63 
64 static tag_info
options(int arity,int extra,int child_mode=CHILD_UNIFORM)65 options (int arity, int extra, int child_mode= CHILD_UNIFORM) {
66   return tag_info (arity, extra, ARITY_OPTIONS, child_mode, true);
67 }
68 
69 static tag_info
repeat(int arity,int extra,int child_mode=CHILD_UNIFORM)70 repeat (int arity, int extra, int child_mode= CHILD_UNIFORM) {
71   return tag_info (arity, extra, ARITY_REPEAT, child_mode, true);
72 }
73 
74 static tag_info
var_repeat(int arity,int extra,int child_mode=CHILD_UNIFORM)75 var_repeat (int arity, int extra, int child_mode= CHILD_UNIFORM) {
76   return tag_info (extra, arity, ARITY_VAR_REPEAT, child_mode, true);
77 }
78 
79 static void
init(tree_label l,string name,tag_info ti)80 init (tree_label l, string name, tag_info ti) {
81   STD_CODE(name)= (int) l;
82   make_tree_label (l, name);
83   std_drd->info (l)= ti;
84   std_drd->freeze_arity (l);
85   std_drd->freeze_border (l);
86   // std_drd->freeze_block (l);
87   // FIXME: freeze children properties
88 }
89 
90 static void
init_var(string var,int tp,string vname="")91 init_var (string var, int tp, string vname= "") {
92   tree_label l= make_tree_label (var);
93   tag_info ti= fixed (0) -> var_parameter () -> type (tp);
94   if (vname != "") ti= ti->name (vname);
95   std_drd->info (l)= ti;
96   std_drd->freeze_arity (l);
97   std_drd->freeze_border (l);
98 }
99 
100 static bool std_drd_initialized= false;
101 
102 void
init_std_drd()103 init_std_drd () {
104   if (std_drd_initialized) return;
105   std_drd_initialized=true;
106 
107   init (STRING, "string", fixed (0) -> returns_string ());
108   init (UNKNOWN, "unknown", fixed (0));
109   init (UNINIT, "uninit", fixed (0));
110   init (ERROR, "error", fixed (1));
111   init (RAW_DATA, "raw-data", fixed (1) -> raw (0));
112 
113   init (DOCUMENT, "document",
114 	repeat (1, 1) -> inner_border () -> accessible (0));
115   init (PARA, "para",
116 	repeat (1, 1) -> inner_border () -> accessible (0) ->
117 	name ("paragraph"));
118   init (SURROUND, "surround", fixed (3) -> accessible (0));
119   init (CONCAT, "concat", repeat (1, 1) -> inner_border () -> accessible (0));
120   init (RIGID, "rigid", fixed (1) -> accessible (0));
121   init (HIDDEN, "hidden", fixed (1) -> inner_border () -> hidden (0));
122   init (FREEZE, "freeze",
123 	fixed (1) -> inner_border () -> regular (0));
124   init (UNFREEZE, "unfreeze", fixed (1) -> accessible (0) -> inner_border ());
125   init (HSPACE, "hspace",
126 	options (1, 2) -> length (0) ->	name ("horizontal space"));
127   init (VAR_VSPACE, "vspace*",
128 	options (1, 2) -> length (0) ->	name ("vertical space before"));
129   init (VSPACE, "vspace",
130 	options (1, 2) -> length (0) ->	name ("vertical space"));
131   init (SPACE, "space",
132 	options (1, 2) -> length (0));
133   // space markup has arity 1 or 3
134   init (HTAB, "htab",
135 	options (1, 1, BIFORM) -> length (0) -> name ("tab"));
136   init (MOVE, "move",
137         fixed (3, 0, DETAILED) ->
138         accessible (0) ->
139         length (1) -> name (1, "x-offset") ->
140         length (2) -> name (2, "y-offset"));
141   init (SHIFT, "shift",
142         fixed (3, 0, DETAILED) ->
143         accessible (0) ->
144         length (1) -> name (1, "x-offset") ->
145         length (2) -> name (2, "y-offset"));
146   init (RESIZE, "resize",
147         fixed (5, 0, DETAILED) ->
148         accessible (0) ->
149         length (1) -> name (1, "left") ->
150         length (2) -> name (2, "bottom") ->
151         length (3) -> name (3, "right") ->
152         length (4) -> name (4, "top"));
153   init (CLIPPED, "clipped",
154         fixed (5, 0, DETAILED) ->
155         accessible (0) ->
156         length (1) -> name (1, "left") ->
157         length (2) -> name (2, "bottom") ->
158         length (3) -> name (3, "right") ->
159         length (4) -> name (4, "top"));
160   init (REPEAT, "repeat", fixed (1, 1, BIFORM) -> accessible (0));
161   init (_FLOAT, "float", fixed (2, 1, BIFORM) -> accessible (1));
162   init (DATOMS, "datoms",
163 	var_repeat (1, 1, BIFORM) -> accessible (1) ->
164 	name ("decorate atoms"));
165   // arbitrary number of macros and decorated content
166   init (DLINES, "dlines",
167 	var_repeat (1, 1, BIFORM) -> accessible (1) ->
168 	name ("decorate lines"));
169   init (DPAGES, "dpages",
170 	var_repeat (1, 1, BIFORM) -> accessible (1) ->
171 	name ("decorate pages"));
172   init (DBOX, "dbox", fixed (0) -> name ("decorated box"));
173   init (LINE_NOTE, "line-note",
174         fixed (1, 2, BIFORM) -> length (1) ->
175 	name ("line note"));
176   init (PAGE_NOTE, "page-note",
177         fixed (1, 2, BIFORM) -> length (1) ->
178 	name ("page note"));
179 
180   init (WITH_LIMITS, "with-limits", fixed (0) -> name ("with limits"));
181   init (LINE_BREAK, "line-break", fixed (0) -> name ("line break"));
182   init (NEW_LINE, "new-line", fixed (0) -> name ("new line"));
183   init (NEXT_LINE, "next-line", fixed (0) -> name ("next line"));
184   init (NO_BREAK, "no-break", fixed (0) -> name ("no line break"));
185   init (NO_INDENT, "no-indent", fixed (0) -> name ("don't indent"));
186   init (YES_INDENT, "yes-indent", fixed (0) -> name ("do indent"));
187   init (VAR_NO_INDENT, "no-indent*", fixed (0) -> name ("don't indent after"));
188   init (VAR_YES_INDENT, "yes-indent*", fixed (0) -> name ("do indent after"));
189   init (VAR_PAGE_BREAK, "page-break*",
190 	fixed (0) -> name ("page break before"));
191   init (PAGE_BREAK, "page-break", fixed (0) -> name ("page break"));
192   init (VAR_NO_PAGE_BREAK, "no-page-break*",
193 	fixed (0) -> name ("no page break before"));
194   init (NO_PAGE_BREAK, "no-page-break", fixed (0) -> name ("no page break"));
195   init (VAR_NEW_PAGE, "new-page*", fixed (0) -> name ("new page before"));
196   init (NEW_PAGE, "new-page", fixed (0) -> name ("new page"));
197   init (VAR_NEW_DPAGE, "new-dpage*",
198 	fixed (0) -> name ("new double page before"));
199   init (NEW_DPAGE, "new-dpage", fixed (0) -> name ("new double page"));
200 
201   init (AROUND, "around", fixed (3, 0, DETAILED) ->
202         name (0, "left bracket") ->
203         accessible (1) ->
204         name (2, "right bracket"));
205   init (VAR_AROUND, "around*", fixed (3, 0, DETAILED) ->
206         name (0, "left bracket") ->
207         accessible (1) ->
208         name (2, "right bracket"));
209   init (BIG_AROUND, "big-around", fixed (2, 0, DETAILED) ->
210         name (0, "big operator") ->
211         accessible (1));
212   init (LEFT, "left", options (1, 2));
213   init (MID, "mid", options (1, 2));
214   init (RIGHT, "right", options (1, 2));
215   init (BIG, "big", fixed (1));
216   init (LONG_ARROW, "long-arrow",
217         options (2, 1, DETAILED) -> name ("long arrow") ->
218         accessible (1) -> name (1, "superscript") ->
219         accessible (2) -> name (2, "subscript"));
220   init (LPRIME, "lprime", fixed (1) -> name ("left prime"));
221   init (RPRIME, "rprime", fixed (1) -> name ("right prime"));
222   init (BELOW, "below", fixed (2) -> accessible (0));
223   init (ABOVE, "above", fixed (2) -> accessible (0));
224   init (LSUB, "lsub",
225 	fixed (1) -> name ("left subscript") ->
226         accessible (0) -> locals (0, "math-display", "false"));
227   init (LSUP, "lsup",
228 	fixed (1) -> name ("left superscript") ->
229         accessible (0) -> locals (0, "math-display", "false"));
230   init (RSUB, "rsub",
231 	fixed (1) -> name ("subscript") ->
232         accessible (0) -> locals (0, "math-display", "false"));
233   init (RSUP, "rsup",
234 	fixed (1) -> name ("superscript") ->
235         accessible (0) -> locals (0, "math-display", "false"));
236   init (FRAC, "frac",
237         fixed (2) -> name ("fraction") ->
238         accessible (0) -> locals (0, "math-display", "false"));
239   init (SQRT, "sqrt", options (1, 1) -> accessible (0) -> name ("root"));
240   init (WIDE, "wide", fixed (1, 1, BIFORM) ->
241         accessible (0) ->
242         name (1, "accent"));
243   init (VAR_WIDE, "wide*", fixed (1, 1, BIFORM) ->
244         accessible (0) -> name ("wide under") ->
245         name (1, "accent"));
246   init (NEG, "neg", fixed (1) -> accessible (0) -> name ("negation"));
247   init (TREE, "tree", repeat (2, 1) -> accessible (0));
248   init (SYNTAX, "syntax", fixed (1, 1, BIFORM) ->
249         accessible (0) -> name (0, "body") ->
250         regular (1) -> name (1, "syntax"));
251 
252   init (TFORMAT, "tformat",
253 	var_repeat (1, 1, BIFORM) -> inner_border () ->
254 	accessible (1) ->
255 	name ("table format"));
256   init (TWITH, "twith",
257 	fixed (2) -> returns_adhoc () ->
258 	accessible (0) -> binding (0) ->
259 	name ("table property"));
260   init (CWITH, "cwith",
261 	fixed (4, 2, BIFORM) -> returns_adhoc () ->
262 	accessible (0) -> integer (0) ->
263 	accessible (1) -> binding (1) ->
264 	name ("cell property"));
265   init (TMARKER, "tmarker", fixed (0) -> name ("table marker"));
266   init (TABLE, "table", repeat (1, 1) -> inner_border () -> accessible (0));
267   init (ROW, "row", repeat (1, 1) -> inner_border () -> accessible (0));
268   init (CELL, "cell", fixed (1) -> inner_border () -> accessible (0));
269   init (SUBTABLE, "subtable", fixed (1) -> inner_border () -> accessible (0));
270 
271   init (ASSIGN, "assign",
272 	fixed (1, 1, BIFORM) -> variable (0) -> regular (1));
273   init (WITH, "with",
274 	var_repeat (2, 1, BIFORM) -> with_like () ->
275 	binding (0) -> accessible (1));
276   init (PROVIDES, "provides",
277 	fixed (1) -> returns_boolean () -> string_type (0));
278   init (VALUE, "value", fixed (1) -> variable (0) ->
279         locals (0, "mode", "src"));
280   init (QUOTE_VALUE, "quote-value",
281 	fixed (1) -> variable (0) -> name ("quoted value") ->
282         locals (0, "mode", "src"));
283   init (MACRO, "macro",
284 	var_repeat (1, 1, BIFORM) -> argument (0) -> regular (1));
285   init (DRD_PROPS, "drd-props",
286 	repeat (3, 2) -> name ("drd properties"));
287   init (QUOTE_ARG, "quote-arg",
288 	repeat (1, 1, BIFORM) -> argument (0) -> name ("quoted argument") ->
289         locals (0, "mode", "src"));
290   init (ARG, "arg",
291 	repeat (1, 1, BIFORM) -> argument (0) -> name ("argument") ->
292         locals (0, "mode", "src"));
293   init (COMPOUND, "compound",
294 	repeat (1, 1, BIFORM) -> variable (0) -> accessible (1));
295   // FIXME: should be refined. The current setting is f.i. needed for "theorem"
296   init (XMACRO, "xmacro",
297 	fixed (1, 1, BIFORM) -> argument (0) -> regular (1));
298   init (GET_LABEL, "get-label", fixed (1) -> returns_string ());
299   init (GET_ARITY, "get-arity", fixed (1) -> returns_integer ());
300   init (MAP_ARGS, "map-args",
301 	options (3, 2, DETAILED) ->
302 	variable (0) -> name (0, "macro") ->
303 	variable (1) -> name (1, "return tag") ->
304 	argument (2) -> name (2, "argument") ->
305 	integer (3) -> name (3, "start index") ->
306 	integer (4) -> name (4, "end index") ->
307 	name ("map arguments"));
308   init (EVAL_ARGS, "eval-args",
309 	fixed (1) -> argument (0) -> name ("evaluate arguments"));
310   init (MARK, "mark", fixed (2));
311   init (EXPAND_AS, "expand-as", fixed (2));
312   init (EVAL, "eval", fixed (1) -> name ("evaluate"));
313   init (QUOTE, "quote", fixed (1) -> regular (0));
314   init (QUASI, "quasi", fixed (1) -> regular (0));
315   init (QUASIQUOTE, "quasiquote", fixed (1) -> regular (0));
316   init (UNQUOTE, "unquote", fixed (1) -> regular (0));
317   init (VAR_UNQUOTE, "unquote*", fixed (1) -> regular (0));
318   init (COPY, "copy", fixed (1) -> regular (0));
319   init (IF, "if",
320 	options (2, 1, DETAILED) ->
321 	boolean (0) -> name (0, "condition") ->
322         regular (1) -> regular (2));
323   init (VAR_IF, "if*",
324 	fixed (1, 1, BIFORM) ->
325 	boolean (0) -> name (0, "condition") ->
326         regular (1));
327   init (CASE, "case",
328 	repeat (2, 1));
329   init (WHILE, "while",
330 	fixed (1, 1, BIFORM) -> boolean (0) -> regular (1));
331   init (FOR_EACH, "for-each",
332 	fixed (1, 1, BIFORM) -> variable (0) -> regular (1));
333   init (EXTERN, "extern",
334 	repeat (1, 1, BIFORM) -> code (0) -> regular (1)); // func and args
335   init (VAR_INCLUDE, "include*", fixed (1) -> url_type (0));
336   init (INCLUDE, "include", fixed (1) -> url_type (0));
337   init (USE_PACKAGE, "use-package", repeat (1, 1) -> string_type (0));
338   init (USE_MODULE, "use-module", repeat (1, 1) -> code (0));
339 
340   init (OR, "or", repeat (2, 1) -> returns_boolean () -> boolean (0));
341   init (XOR, "xor", fixed (2) -> returns_boolean () -> boolean (0));
342   init (AND, "and", repeat (2, 1) -> returns_boolean () -> boolean (0));
343   init (NOT, "not", fixed (1) -> returns_boolean () -> boolean (0));
344   init (PLUS, "plus", repeat (2, 1) -> returns_numeric () -> numeric (0));
345   init (MINUS, "minus", repeat (1, 1) -> returns_numeric () -> numeric (0));
346   init (TIMES, "times", repeat (2, 1) -> returns_numeric () -> numeric (0));
347   init (OVER, "over", repeat (1, 1) -> returns_numeric () -> numeric (0));
348   init (DIV, "div",
349 	fixed (2) -> returns_numeric () -> numeric (0) -> name ("divide"));
350   init (MOD, "mod",
351 	fixed (2) -> returns_numeric () -> numeric (0) -> name ("modulo"));
352   init (MINIMUM, "minimum",
353 	repeat (2, 1) -> returns_numeric () -> numeric (0));
354   init (MAXIMUM, "maximum",
355 	repeat (1, 1) -> returns_numeric () -> numeric (0));
356   init (MATH_SQRT, "math-sqrt",
357 	fixed (1) -> returns_numeric () -> numeric (0) ->
358 	name ("square root"));
359   init (EXP, "exp", fixed (1) -> returns_numeric () -> numeric (0));
360   init (LOG, "log", fixed (1) -> returns_numeric () -> numeric (0));
361   init (POW, "pow", fixed (2) -> returns_numeric () -> numeric (0));
362   init (COS, "cos", fixed (1) -> returns_numeric () -> numeric (0));
363   init (SIN, "sin", fixed (1) -> returns_numeric () -> numeric (0));
364   init (TAN, "tan", fixed (1) -> returns_numeric () -> numeric (0));
365   init (MERGE, "merge", repeat (2, 1) -> returns_adhoc ());
366   init (LENGTH, "length", fixed (1) -> returns_integer ());
367   init (RANGE, "range",
368 	fixed (1, 2, BIFORM) -> returns_adhoc () -> accessible (0));
369   init (NUMBER, "number",
370 	fixed (2) -> returns_string () -> string_type (0));
371   init (_DATE, "date",
372 	options (0, 2) -> returns_string () -> string_type (0));
373   init (TRANSLATE, "translate",
374 	fixed (3) -> returns_string () -> string_type (0));
375   init (CHANGE_CASE, "change-case",
376 	fixed (1, 1, BIFORM) -> accessible (0) -> string_type (1));
377   init (FIND_FILE, "find-file",
378 	var_repeat (1, 1) -> returns_url () -> url_type (0)); // dirs and file
379   init (FIND_FILE_UPWARDS, "find-file-upwards",
380 	repeat (1, 1) -> returns_url () -> string_type (0));
381   init (IS_TUPLE, "is-tuple",
382 	fixed (1) -> returns_boolean () -> regular (0) -> name ("tuple?"));
383   init (LOOK_UP, "look-up",
384 	fixed (1, 1, BIFORM) -> regular (0) -> integer (1));
385   init (EQUAL, "equal",
386 	fixed (2) -> returns_boolean () -> regular (0));
387   init (UNEQUAL, "unequal",
388 	fixed (2) -> returns_boolean () -> regular (0) ->
389 	name ("not equal"));
390   init (LESS, "less",
391 	fixed (2) -> returns_boolean () -> regular (0));
392   init (LESSEQ, "lesseq",
393 	fixed (2) -> returns_boolean () -> regular (0) ->
394 	name ("less or equal"));
395   init (GREATER, "greater",
396 	fixed (2) -> returns_boolean () -> regular (0));
397   init (GREATEREQ, "greatereq",
398 	fixed (2) -> returns_boolean () -> regular (0) ->
399 	name ("greater or equal"));
400   init (BLEND, "blend", fixed (2) -> returns_color () -> color_type (0));
401 
402   init (CM_LENGTH, "cm-length", fixed (0) -> returns_length ());
403   init (MM_LENGTH, "mm-length", fixed (0) -> returns_length ());
404   init (IN_LENGTH, "in-length", fixed (0) -> returns_length ());
405   init (PT_LENGTH, "pt-length", fixed (0) -> returns_length ());
406   init (BP_LENGTH, "bp-length", fixed (0) -> returns_length ());
407   init (DD_LENGTH, "dd-length", fixed (0) -> returns_length ());
408   init (PC_LENGTH, "pc-length", fixed (0) -> returns_length ());
409   init (CC_LENGTH, "cc-length", fixed (0) -> returns_length ());
410   init (FS_LENGTH, "fs-length", fixed (0) -> returns_length ());
411   init (FBS_LENGTH, "fbs-length", fixed (0) -> returns_length ());
412   init (EM_LENGTH, "em-length", fixed (0) -> returns_length ());
413   init (LN_LENGTH, "ln-length", fixed (0) -> returns_length ());
414   init (SEP_LENGTH, "sep-length", fixed (0) -> returns_length ());
415   init (YFRAC_LENGTH, "yfrac-length", fixed (0) -> returns_length ());
416   init (EX_LENGTH, "ex-length", fixed (0) -> returns_length ());
417   init (FN_LENGTH, "fn-length", fixed (0) -> returns_length ());
418   init (FNS_LENGTH, "fns-length", fixed (0) -> returns_length ());
419   init (BLS_LENGTH, "bls-length", fixed (0) -> returns_length ());
420   init (FNBOT_LENGTH, "fnbot-length", fixed (0) -> returns_length ());
421   init (FNTOP_LENGTH, "fntop-length", fixed (0) -> returns_length ());
422   init (SPC_LENGTH, "spc-length", fixed (0) -> returns_length ());
423   init (XSPC_LENGTH, "xspc-length", fixed (0) -> returns_length ());
424   init (PAR_LENGTH, "par-length", fixed (0) -> returns_length ());
425   init (PAG_LENGTH, "pag-length", fixed (0) -> returns_length ());
426   init (GW_LENGTH, "gw-length", fixed (0) -> returns_length ());
427   init (GH_LENGTH, "gh-length", fixed (0) -> returns_length ());
428   init (GU_LENGTH, "gu-length", fixed (0) -> returns_length ());
429   init (TMPT_LENGTH, "tmpt-length", fixed (0) -> returns_length ());
430   init (PX_LENGTH, "px-length", fixed (0) -> returns_length ());
431   init (MSEC_LENGTH, "msec-length", fixed (0) -> returns_length ());
432   init (SEC_LENGTH, "sec-length", fixed (0) -> returns_length ());
433   init (MIN_LENGTH, "min-length", fixed (0) -> returns_length ());
434   init (HR_LENGTH, "hr-length", fixed (0) -> returns_length ());
435 
436   init (STYLE_WITH, "style-with",
437 	var_repeat (2, 1, BIFORM) -> binding (0) -> accessible (1));
438   init (VAR_STYLE_WITH, "style-with*",
439 	var_repeat (2, 1, BIFORM) -> binding (0) -> accessible (1));
440   init (STYLE_ONLY, "style-only", fixed (1) -> accessible (0));
441   init (VAR_STYLE_ONLY, "style-only*", fixed (1) -> accessible (0));
442   init (ACTIVE, "active", fixed (1) -> accessible (0));
443   init (VAR_ACTIVE, "active*", fixed (1) -> accessible (0));
444   init (INACTIVE, "inactive", fixed (1) -> accessible (0));
445   init (VAR_INACTIVE, "inactive*", fixed (1) -> accessible (0));
446   init (REWRITE_INACTIVE, "rewrite-inactive", fixed (2));
447   init (INLINE_TAG, "inline-tag",
448 	repeat (1, 1, BIFORM) ->
449 	accessible (0) -> variable (0) -> name (0, "macro") ->
450         accessible (1));
451   init (OPEN_TAG, "open-tag",
452 	repeat (1, 1, BIFORM) ->
453 	accessible (0) -> variable (0) -> name (0, "macro") ->
454         accessible (1));
455   init (MIDDLE_TAG, "middle-tag",
456 	repeat (1, 1, BIFORM) ->
457 	variable (0) -> name (0, "macro") ->
458         accessible (1));
459   init (CLOSE_TAG, "close-tag",
460 	repeat (1, 1, BIFORM) ->
461 	variable (0) -> name (0, "macro") ->
462         accessible (1));
463   init (SYMBOL, "symbol",
464         fixed (1) ->
465         code (0) -> name (0, "name") -> locals (0, "mode", "src"));
466   init (LATEX, "latex",
467 	fixed (1) ->
468         code (0) -> name (0, "command") -> locals (0, "mode", "src"));
469   init (HYBRID, "hybrid",
470 	options (1, 1, BIFORM) ->
471 	variable (0) -> name (0, "command") -> locals (0, "mode", "src") ->
472 	accessible (1));
473 
474   init (LOCUS, "locus",
475 	var_repeat (1, 1, BIFORM) ->
476 	accessible (1));
477   init (ID, "id",
478 	repeat (1, 1) -> returns_adhoc () ->
479 	accessible (0) -> identifier (0));
480   init (HARD_ID, "hard-id",
481 	options (0, 1) -> returns_identifier () ->
482 	regular (0));
483   init (LINK, "link",
484 	repeat (1, 1, BIFORM) -> returns_adhoc () ->
485 	accessible (0) -> string_type (0) -> name (0, "link type") ->
486 	accessible (1) -> name (1, "participants"));
487   init (URL, "url",
488 	options (1, 1, BIFORM) -> returns_adhoc () ->
489 	accessible (0) -> url_type (0) ->
490 	accessible (1) -> regular (1));       // FIXME: location?
491   init (SCRIPT, "script",
492 	repeat (1, 1, BIFORM) -> returns_adhoc () ->
493 	accessible (0) -> code (0) -> name (0, "function") ->
494 	accessible (1) -> regular (1) -> name (0, "arguments"));
495   init (OBSERVER, "observer",
496 	fixed (1, 1, BIFORM) -> returns_adhoc () ->
497 	accessible (0) -> identifier (0) -> name (0, "identifier") ->
498 	accessible (1) -> code (1) -> name (1, "call back"));
499   init (FIND_ACCESSIBLE, "find-accessible",
500 	fixed (1) -> regular (0));
501   init (HLINK, "hlink",
502 	fixed (1, 1, BIFORM) ->
503 	accessible (0) -> name (0, "text") ->
504 	url_type (1) -> name (1, "destination") ->
505 	name ("hyperlink"));
506   init (ACTION, "action",
507 	repeat (2, 1, DETAILED) ->
508 	accessible (0) -> name (0, "text") ->
509 	code (1) -> name (1, "function") ->
510 	regular (2) -> name (2, "arguments"));
511   init (SET_BINDING, "set-binding",
512 	options (1, 2));                      // see env_exec.cpp
513   init (GET_BINDING, "get-binding",
514 	options (1, 1, BIFORM) ->
515 	identifier (0) -> name (0, "key") ->
516 	integer (1) -> name (0, "kind"));
517   init (LABEL, "label",
518 	fixed (1) ->
519         identifier (0) -> name (0, "id") -> long_name (0, "identifier"));
520   init (REFERENCE, "reference",
521 	fixed (1) ->
522         identifier (0) -> name (0, "id") -> long_name (0, "identifier"));
523   init (PAGEREF, "pageref",
524 	fixed (1) -> name ("page reference") ->
525         identifier (0) -> name (0, "id") -> long_name (0, "identifier"));
526   init (GET_ATTACHMENT, "get-attachment",
527 	fixed (1) -> name ("get attachment") ->
528         identifier (0) -> name (0, "name"));
529   init (WRITE, "write",
530 	fixed (1, 1, BIFORM) ->
531 	string_type (0) -> name (0, "channel") ->
532 	regular (1) -> name (1, "content"));
533   init (TOC_NOTIFY, "toc-notify",
534 	fixed (1, 1, BIFORM) ->
535 	string_type (0) -> name (0, "kind") ->
536 	string_type (1) -> name (1, "title"));
537 
538   init (TUPLE, "tuple",
539 	repeat (0, 1) -> accessible (0));
540   init (ATTR, "attr",
541 	repeat (2, 2) -> accessible (0) -> binding (0) ->
542 	name ("attributes"));
543   init (TMLEN, "tmlen",
544 	options (1, 2) -> returns_length () ->
545 	length (0) -> name ("TeXmacs length"));
546   init (COLLECTION, "collection",
547 	repeat (1, 1) -> regular (0));
548   init (ASSOCIATE, "associate",
549 	fixed (2) -> binding (0));
550   init (BACKUP, "backup",
551 	fixed (2) -> regular (0));
552   init (PATTERN, "pattern",
553 	options (3, 1, DETAILED) -> returns_color () ->
554         url_type (0));
555   init (GRADIENT, "gradient",
556 	fixed (3) -> returns_color ());           // not yet implemented
557   init (SPECIFIC, "specific",
558 	fixed (1, 1, BIFORM) ->
559 	string_type (0) -> name (0, "medium") ->
560 	regular (1) -> name (1, "content"));
561   init (FLAG, "flag",
562 	options (2, 1, DETAILED) ->
563 	regular (0) -> name (0, "flag text") ->
564 	color_type (1) -> name (1, "color") ->
565 	argument (2) -> name (2, "source"));
566 
567   init (ANIM_COMPOSE, "anim-compose",
568 	repeat (1, 1) -> returns_animation () ->
569 	animation (0));
570   init (ANIM_REPEAT, "anim-repeat",
571 	fixed (1) -> returns_animation () ->
572 	accessible (0) -> animation (0));
573   init (ANIM_CONSTANT, "anim-constant",
574 	fixed (1, 1, BIFORM) -> returns_animation () ->
575 	accessible (0) -> duration (1));
576   init (ANIM_TRANSLATE, "anim-translate",
577 	fixed (1, 3, DETAILED) -> returns_animation () ->
578 	accessible (0) -> animation (0) ->
579 	duration (1));
580   init (ANIM_PROGRESSIVE, "anim-progressive",
581 	fixed (1, 3, DETAILED) -> returns_animation () ->
582 	accessible (0) -> animation (0) ->
583 	duration (1));
584   init (VIDEO, "video",
585 	fixed (1, 4, BIFORM) -> url_type (0));
586   init (SOUND, "sound",
587 	fixed (1) -> url_type (0));
588 
589   init (GRAPHICS, "graphics",
590 	repeat (1, 1) -> accessible (0) -> graphical (0));
591   init (SUPERPOSE, "superpose",
592 	repeat (1, 1) -> accessible (0));
593   init (GR_GROUP, "gr-group",
594 	repeat (1, 1) -> returns_graphical () -> graphical (0));
595   init (GR_TRANSFORM, "gr-transform",
596 	fixed (1, 1, BIFORM) -> returns_graphical () ->
597 	accessible (0) -> graphical (0));
598   init (GR_EFFECT, "gr-effect",
599 	var_repeat (1, 1, BIFORM) -> returns_graphical () ->
600 	accessible (0) -> graphical (0) ->
601         effect (1));
602   /*
603   init (TEXT_AT, "text-at",
604 	fixed (1, 1, BIFORM) -> returns_graphical () ->
605 	accessible (0) -> point_type (1));
606   init (MATH_AT, "math-at",
607 	fixed (1, 1, BIFORM) -> returns_graphical () ->
608 	accessible (0) -> point_type (1) ->
609         locals (0, "mode", "math"));
610   */
611   init (TEXT_AT, "text-at",
612 	options (1, 1, BIFORM) -> returns_graphical () ->
613 	accessible (0) -> point_type (1));
614   init (MATH_AT, "math-at",
615 	options (1, 1, BIFORM) -> returns_graphical () ->
616 	accessible (0) -> point_type (1) ->
617         locals (0, "mode", "math"));
618   init (_POINT, "point",
619 	repeat (1, 1) -> returns_graphical () -> point_type (0));
620   init (LINE, "line",
621 	repeat (2, 1) -> returns_graphical () -> point_type (0));
622   init (CLINE, "cline",
623 	repeat (3, 1) -> returns_graphical () -> point_type (0));
624   init (ARC, "arc",
625 	fixed (3) -> returns_graphical () -> point_type (0));
626   init (CARC, "carc",
627 	fixed (3) -> returns_graphical () -> point_type (0));
628   init (SPLINE, "spline",
629 	repeat (2, 1) -> returns_graphical () -> point_type (0));
630   init (VAR_SPLINE, "spline*",
631 	repeat (2, 1) -> returns_graphical () -> point_type (0));
632   init (CSPLINE, "cspline",
633 	repeat (3, 1) -> returns_graphical () -> point_type (0));
634   init (FILL, "fill",
635 	repeat (1, 1));                       // Not yet implemented
636   init (IMAGE, "image",
637 	fixed (1, 4, DETAILED) ->
638 	url_type (0) -> name (0, "url") ->
639 	length (1) -> name (1, "width") ->
640 	length (2) -> name (2, "height") ->
641         length (3) -> name (3, "x") -> long_name (3, "x-offset") ->
642         length (4) -> name (4, "y") -> long_name (4, "y-offset"));
643 
644   init (BOX_INFO, "box-info",
645 	fixed (1, 1, BIFORM) ->
646 	regular (0) ->                        // content leading to box
647 	string_type (1));                     // query
648   init (FRAME_DIRECT, "frame-direct",
649 	fixed (1) -> point_type (0));
650   init (FRAME_INVERSE, "frame-inverse",
651 	fixed (1) -> point_type (0));
652 
653   init (IS_EQUAL, "is-equal",
654         fixed (2) -> returns_constraint () -> graphical_id (0));
655   init (IS_INTERSECTION, "is-intersection",
656         fixed (3) -> returns_constraint () -> graphical_id (0));
657   init (ON_CURVE, "on-curve",
658         options (2, 1, BIFORM) -> returns_constraint () ->
659         graphical_id (0) -> numeric (1));
660   init (ON_TEXT_BORDER, "on-text-border",
661         fixed (2) -> returns_constraint () -> graphical_id (0));
662   init (ON_GRID, "on-grid",
663         fixed (2) -> returns_constraint () -> graphical_id (0));
664 
665   init (TRANSFORM_3D, "transform-3d",
666         fixed (1, 1, BIFORM) -> returns_graphical () ->
667         graphical (0));
668   init (OBJECT_3D, "object-3d",
669         repeat (1, 1) -> returns_graphical () ->
670         graphical (0));
671   init (TRIANGLE_3D, "triangle-3d",
672         fixed (3, 1, BIFORM) -> returns_graphical () ->
673         graphical (0) -> color_type (1));
674   init (LIGHT_3D, "light-3d",
675         fixed (1, 1, BIFORM) -> returns_graphical () ->
676         graphical (0));
677   init (LIGHT_DIFFUSE, "light-diffuse",
678         repeat (1, 1, BIFORM) ->
679         point_type (0));
680   init (LIGHT_SPECULAR, "light-specular",
681         repeat (2, 1, BIFORM) ->
682         point_type (0));
683 
684   init (EFF_MOVE, "eff-move",
685         fixed (3, 0, DETAILED) -> returns_effect () ->
686         effect (0) -> name (0, "body") ->
687         length (1) -> name (1, "dx") ->
688         length (2) -> name (2, "dy"));
689   init (EFF_MAGNIFY, "eff-magnify",
690         fixed (3, 0, DETAILED) -> returns_effect () ->
691         effect (0) -> name (0, "body") ->
692         numeric (1) -> name (1, "magx") ->
693         numeric (2) -> name (2, "magy"));
694   init (EFF_BUBBLE, "eff-bubble",
695         fixed (3, 0, DETAILED) -> returns_effect () ->
696         effect (0) -> name (0, "body") ->
697         length (1) -> name (1, "radius") ->
698         numeric (2) -> name (2, "amplitude"));
699   init (EFF_GAUSSIAN, "eff-gaussian",
700         options (1, 2, DETAILED) -> returns_effect () ->
701         length (0) -> name (0, "rx") -> long_name (0, "blur x-radius") ->
702         length (1) -> name (1, "ry") -> long_name (1, "blur y-radius") ->
703         numeric (2) -> name (2, "phi") -> long_name (2, "blur angle"));
704   init (EFF_OVAL, "eff-oval",
705         options (1, 2, DETAILED) -> returns_effect () ->
706         length (0) -> name (0, "rx") -> long_name (0, "x-radius") ->
707         length (1) -> name (1, "ry") -> long_name (1, "y-radius") ->
708         numeric (2) -> name (2, "phi") -> long_name (2, "angle"));
709   init (EFF_RECTANGULAR, "eff-rectangular",
710         options (1, 2, DETAILED) -> returns_effect () ->
711         length (0) -> name (0, "rx") -> long_name (0, "x-radius") ->
712         length (1) -> name (1, "ry") -> long_name (1, "y-radius") ->
713         numeric (2) -> name (2, "phi") -> long_name (2, "angle"));
714   init (EFF_MOTION, "eff-motion",
715         options (2, 0, DETAILED) -> returns_effect () ->
716         length (0) -> name (0, "dx") -> long_name (0, "x-shift") ->
717         length (1) -> name (1, "dy") -> long_name (1, "y-shift"));
718   init (EFF_BLUR, "eff-blur",
719         fixed (2, 0, DETAILED) -> returns_effect () ->
720         effect (0) -> name (0, "body") ->
721         effect (1) -> name (1, "pen"));
722   init (EFF_OUTLINE, "eff-outline",
723         fixed (2, 0, DETAILED) -> returns_effect () ->
724         effect (0) -> name (0, "body") ->
725         effect (1) -> name (1, "pen"));
726   init (EFF_THICKEN, "eff-thicken",
727         fixed (2, 0, DETAILED) -> returns_effect () ->
728         effect (0) -> name (0, "body") ->
729         effect (1) -> name (1, "pen"));
730   init (EFF_ERODE, "eff-erode",
731         fixed (2, 0, DETAILED) -> returns_effect () ->
732         effect (0) -> name (0, "body") ->
733         effect (1) -> name (1, "pen"));
734   init (EFF_SUPERPOSE, "eff-superpose",
735 	repeat (1, 1) -> returns_effect () -> effect (0));
736   init (EFF_ADD, "eff-add",
737 	repeat (1, 1) -> returns_effect () -> effect (0));
738   init (EFF_SUB, "eff-sub",
739 	repeat (1, 1) -> returns_effect () -> effect (0));
740   init (EFF_MUL, "eff-mul",
741 	repeat (1, 1) -> returns_effect () -> effect (0));
742   init (EFF_MIN, "eff-min",
743 	repeat (1, 1) -> returns_effect () -> effect (0));
744   init (EFF_MAX, "eff-max",
745 	repeat (1, 1) -> returns_effect () -> effect (0));
746   init (EFF_MIX, "eff-mix",
747 	fixed (4, 0, DETAILED) -> returns_effect () ->
748         effect (0) -> name (0, "eff1") ->
749         numeric (1) -> name (1, "alpha1") ->
750         effect (2) -> name (2, "eff2") ->
751         numeric (3) -> name (3, "alpha2"));
752   init (EFF_NORMALIZE, "eff-normalize",
753         fixed (1) -> returns_effect () ->
754         effect (0) -> name (0, "body"));
755   init (EFF_MONOCHROME, "eff-monochrome",
756         fixed (3, 0, DETAILED) -> returns_effect () ->
757         effect (0) -> name (0, "body") ->
758         color_type (1) -> name (1, "color") ->
759         numeric (2) -> name (2, "opacity"));
760   init (EFF_COLOR_MATRIX, "eff-color-matrix",
761         fixed (1, 1, BIFORM) -> returns_effect () ->
762         effect (0) -> name (0, "body") ->
763 	numeric (1));
764   init (EFF_MAKE_TRANSPARENT, "eff-make-transparent",
765         fixed (2, 0, DETAILED) -> returns_effect () ->
766         effect (0) -> name (0, "body") ->
767 	color_type (1) -> name (1, "bg") -> name (1, "background color"));
768   init (EFF_MAKE_OPAQUE, "eff-make-opaque",
769         fixed (2, 0, DETAILED) -> returns_effect () ->
770         effect (0) -> name (0, "body") ->
771 	color_type (1) -> name (1, "bg") -> name (1, "background color"));
772 
773   init (CANVAS, "canvas", fixed (6, 1, BIFORM) -> accessible (1));
774   init (ORNAMENT, "ornament", options (1, 1) -> accessible (0));
775 
776   init (FORMAT, "format",
777 	repeat (1, 1));
778   init (LINE_SEP, "line-sep",
779 	fixed (0) -> name ("line separator"));
780   init (SPLIT, "split",
781 	repeat (1, 1));
782   init (DELAY, "delay",
783 	fixed (1) -> regular (0));
784   init (HOLD, "hold",
785 	fixed (1) -> regular (0));
786   init (RELEASE, "release",
787 	fixed (1) -> regular (0));
788   init (OLD_MATRIX, "old-matrix",
789 	var_repeat (1, 2, BIFORM) -> accessible (0));
790   init (OLD_TABLE, "old-table",
791 	var_repeat (1, 2, BIFORM) -> accessible (0));
792   init (OLD_MOSAIC, "old-mosaic",
793 	var_repeat (1, 2, BIFORM) -> accessible (0));
794   init (OLD_MOSAIC_ITEM, "old-mosaic-item",
795 	repeat (1, 1) -> accessible (0));
796   init (SET, "set",
797 	fixed (1, 1, BIFORM) -> variable (0) -> regular (0));
798   init (RESET, "reset",
799 	fixed (1) -> variable (0));
800   init (EXPAND, "expand",
801 	repeat (1, 1, BIFORM) ->
802 	variable (0) -> accessible (1));
803   init (VAR_EXPAND, "expand*",
804 	repeat (1, 1, BIFORM) -> inner_border () ->
805 	variable (0) -> accessible (1));
806   init (HIDE_EXPAND, "hide-expand",
807 	repeat (2, 1, DETAILED) ->
808 	accessible (1));
809   init (APPLY, "apply",
810 	repeat (1, 1, BIFORM) -> variable (0));
811   init (BEGIN, "begin",
812 	repeat (1, 1, BIFORM) -> variable (0));
813   init (END, "end",
814 	fixed (1) -> variable (0));
815   init (FUNC, "func",
816 	var_repeat (1, 1, BIFORM) ->
817 	argument (0) -> regular (1));
818   init (ENV, "env",
819 	var_repeat (1, 2, BIFORM) ->
820 	argument (0));
821   init (AUTHORIZE, "authorize",
822 	fixed (2));
823   init (POSTSCRIPT, "postscript",
824 	fixed (1, 6, BIFORM) -> url_type (0));
825 
826   init (make_tree_label ("shown"), "shown",
827 	fixed (1) -> accessible (0) -> inner_border ());
828   init (make_tree_label ("ignore"), "ignore",
829 	fixed (1) -> regular (0) -> inner_border ());
830 
831   init_var (DPI, TYPE_NUMERIC);
832   init_var (ZOOM_FACTOR, TYPE_NUMERIC);
833   init_var (PREAMBLE, TYPE_BOOLEAN);
834   init_var (SAVE_AUX, TYPE_BOOLEAN);
835   init_var (MODE, TYPE_STRING);
836   init_var (INFO_FLAG, TYPE_STRING);
837   init_var (WINDOW_BARS, TYPE_STRING);
838   init_var (SCROLL_BARS, TYPE_BOOLEAN);
839   init_var (THE_LABEL, TYPE_REGULAR);
840   init_var (THE_TAGS, TYPE_ADHOC);
841   init_var (THE_MODULES, TYPE_ADHOC);
842   init_var (WARN_MISSING, TYPE_BOOLEAN);
843   init_var (GLOBAL_TITLE, TYPE_STRING);
844   init_var (GLOBAL_AUTHOR, TYPE_STRING);
845   init_var (GLOBAL_SUBJECT, TYPE_STRING);
846 
847   init_var (FONT, TYPE_STRING);
848   init_var (FONT_FAMILY, TYPE_STRING);
849   init_var (FONT_SERIES, TYPE_STRING);
850   init_var (FONT_SHAPE, TYPE_STRING);
851   init_var (FONT_SIZE, TYPE_NUMERIC);
852   init_var (FONT_BASE_SIZE, TYPE_NUMERIC);
853   init_var (MAGNIFICATION, TYPE_NUMERIC);
854   init_var (COLOR, TYPE_COLOR);
855   init_var (OPACITY, TYPE_NUMERIC);
856   init_var (BG_COLOR, TYPE_COLOR);
857   init_var (LOCUS_COLOR, TYPE_COLOR);
858   init_var (VISITED_COLOR, TYPE_COLOR);
859   init_var (NO_PATTERNS, TYPE_COLOR);
860   init_var (LANGUAGE, TYPE_STRING);
861   init_var (ATOM_DECORATIONS, TYPE_ADHOC);
862   init_var (LINE_DECORATIONS, TYPE_ADHOC);
863   init_var (PAGE_DECORATIONS, TYPE_ADHOC);
864   init_var (XOFF_DECORATIONS, TYPE_LENGTH);
865   init_var (YOFF_DECORATIONS, TYPE_LENGTH);
866 
867   init_var (MATH_LANGUAGE, TYPE_STRING);
868   init_var (MATH_FONT, TYPE_STRING);
869   init_var (MATH_FONT_FAMILY, TYPE_STRING);
870   init_var (MATH_FONT_SERIES, TYPE_STRING);
871   init_var (MATH_FONT_SHAPE, TYPE_STRING);
872   init_var (MATH_LEVEL, TYPE_INTEGER);
873   init_var (MATH_DISPLAY, TYPE_BOOLEAN);
874   init_var (MATH_CONDENSED, TYPE_BOOLEAN);
875   init_var (MATH_VPOS, TYPE_INTEGER);
876   init_var (MATH_NESTING_MODE, TYPE_STRING);
877   init_var (MATH_NESTING_LEVEL, TYPE_INTEGER);
878 
879   init_var (PROG_LANGUAGE, TYPE_STRING);
880   init_var (PROG_SCRIPTS, TYPE_STRING);
881   init_var (PROG_FONT, TYPE_STRING);
882   init_var (PROG_FONT_FAMILY, TYPE_STRING);
883   init_var (PROG_FONT_SERIES, TYPE_STRING);
884   init_var (PROG_FONT_SHAPE, TYPE_STRING);
885   init_var (PROG_SESSION, TYPE_STRING);
886 
887   init_var (PAR_MODE, TYPE_STRING);
888   init_var (PAR_FLEXIBILITY, TYPE_NUMERIC);
889   init_var (PAR_HYPHEN, TYPE_STRING);
890   init_var (PAR_SPACING, TYPE_STRING);
891   init_var (PAR_KERNING_STRETCH, TYPE_NUMERIC);
892   init_var (PAR_KERNING_MARGIN, TYPE_BOOLEAN);
893   init_var (PAR_WIDTH, TYPE_LENGTH);
894   init_var (PAR_LEFT, TYPE_LENGTH);
895   init_var (PAR_RIGHT, TYPE_LENGTH);
896   init_var (PAR_FIRST, TYPE_LENGTH);
897   init_var (PAR_NO_FIRST, TYPE_BOOLEAN);
898   init_var (PAR_SEP, TYPE_LENGTH);
899   init_var (PAR_HOR_SEP, TYPE_LENGTH);
900   init_var (PAR_VER_SEP, TYPE_LENGTH);
901   init_var (PAR_LINE_SEP, TYPE_LENGTH);
902   init_var (PAR_PAR_SEP, TYPE_LENGTH);
903   init_var (PAR_FNOTE_SEP, TYPE_LENGTH);
904   init_var (PAR_COLUMNS, TYPE_INTEGER);
905   init_var (PAR_COLUMNS_SEP, TYPE_LENGTH);
906 
907   init_var (PAGE_MEDIUM, TYPE_STRING);
908   init_var (PAGE_PRINTED, TYPE_BOOLEAN);
909   init_var (PAGE_TYPE, TYPE_STRING);
910   init_var (PAGE_ORIENTATION, TYPE_STRING);
911   init_var (PAGE_WIDTH_MARGIN, TYPE_BOOLEAN);
912   init_var (PAGE_HEIGHT_MARGIN, TYPE_BOOLEAN);
913   init_var (PAGE_SCREEN_MARGIN, TYPE_BOOLEAN);
914   init_var (PAGE_BREAKING, TYPE_STRING);
915   init_var (PAGE_FLEXIBILITY, TYPE_NUMERIC);
916   init_var (PAGE_FIRST, TYPE_NUMERIC);
917   init_var (PAGE_NR, TYPE_INTEGER);
918   init_var (PAGE_THE_PAGE, TYPE_ADHOC);
919   init_var (PAGE_WIDTH, TYPE_LENGTH);
920   init_var (PAGE_HEIGHT, TYPE_LENGTH);
921   init_var (PAGE_ODD, TYPE_LENGTH);
922   init_var (PAGE_EVEN, TYPE_LENGTH);
923   init_var (PAGE_RIGHT, TYPE_LENGTH);
924   init_var (PAGE_ODD_SHIFT, TYPE_LENGTH);
925   init_var (PAGE_EVEN_SHIFT, TYPE_LENGTH);
926   init_var (PAGE_TOP, TYPE_LENGTH);
927   init_var (PAGE_BOT, TYPE_LENGTH);
928   init_var (PAGE_USER_HEIGHT, TYPE_LENGTH);
929   init_var (PAGE_SHRINK, TYPE_LENGTH);
930   init_var (PAGE_EXTEND, TYPE_LENGTH);
931   init_var (PAGE_HEAD_SEP, TYPE_LENGTH);
932   init_var (PAGE_FOOT_SEP, TYPE_LENGTH);
933   init_var (PAGE_ODD_HEADER, TYPE_REGULAR, "odd page header");
934   init_var (PAGE_ODD_FOOTER, TYPE_REGULAR, "odd page footer");
935   init_var (PAGE_EVEN_HEADER, TYPE_REGULAR, "even page header");
936   init_var (PAGE_EVEN_FOOTER, TYPE_REGULAR, "even page footer");
937   init_var (PAGE_THIS_HEADER, TYPE_REGULAR);
938   init_var (PAGE_THIS_FOOTER, TYPE_REGULAR);
939   init_var (PAGE_SCREEN_WIDTH, TYPE_LENGTH);
940   init_var (PAGE_SCREEN_HEIGHT, TYPE_LENGTH);
941   init_var (PAGE_SCREEN_LEFT, TYPE_LENGTH);
942   init_var (PAGE_SCREEN_RIGHT, TYPE_LENGTH);
943   init_var (PAGE_SCREEN_TOP, TYPE_LENGTH);
944   init_var (PAGE_SCREEN_BOT, TYPE_LENGTH);
945   init_var (PAGE_SHOW_HF, TYPE_BOOLEAN);
946   init_var (PAGE_FNOTE_SEP, TYPE_LENGTH);
947   init_var (PAGE_FNOTE_BARLEN, TYPE_LENGTH);
948   init_var (PAGE_FLOAT_SEP, TYPE_LENGTH);
949   init_var (PAGE_MNOTE_SEP, TYPE_LENGTH);
950   init_var (PAGE_MNOTE_WIDTH, TYPE_LENGTH);
951 
952   init_var (TABLE_WIDTH, TYPE_LENGTH);
953   init_var (TABLE_HEIGHT, TYPE_LENGTH);
954   init_var (TABLE_HMODE, TYPE_STRING);
955   init_var (TABLE_VMODE, TYPE_STRING);
956   init_var (TABLE_HALIGN, TYPE_STRING);
957   init_var (TABLE_VALIGN, TYPE_STRING);
958   init_var (TABLE_ROW_ORIGIN, TYPE_INTEGER);
959   init_var (TABLE_COL_ORIGIN, TYPE_INTEGER);
960   init_var (TABLE_LSEP, TYPE_LENGTH);
961   init_var (TABLE_RSEP, TYPE_LENGTH);
962   init_var (TABLE_BSEP, TYPE_LENGTH);
963   init_var (TABLE_TSEP, TYPE_LENGTH);
964   init_var (TABLE_LBORDER, TYPE_LENGTH);
965   init_var (TABLE_RBORDER, TYPE_LENGTH);
966   init_var (TABLE_BBORDER, TYPE_LENGTH);
967   init_var (TABLE_TBORDER, TYPE_LENGTH);
968   init_var (TABLE_HYPHEN, TYPE_STRING);
969   init_var (TABLE_MIN_ROWS, TYPE_INTEGER);
970   init_var (TABLE_MIN_COLS, TYPE_INTEGER);
971   init_var (TABLE_MAX_ROWS, TYPE_INTEGER);
972   init_var (TABLE_MAX_COLS, TYPE_INTEGER);
973 
974   init_var (CELL_FORMAT, TYPE_ADHOC);
975   init_var (CELL_DECORATION, TYPE_ADHOC);
976   init_var (CELL_BACKGROUND, TYPE_COLOR);
977   init_var (CELL_ORIENTATION, TYPE_STRING);
978   init_var (CELL_WIDTH, TYPE_LENGTH);
979   init_var (CELL_HEIGHT, TYPE_LENGTH);
980   init_var (CELL_HPART, TYPE_NUMERIC);
981   init_var (CELL_VPART, TYPE_NUMERIC);
982   init_var (CELL_HMODE, TYPE_STRING);
983   init_var (CELL_VMODE, TYPE_STRING);
984   init_var (CELL_HALIGN, TYPE_STRING);
985   init_var (CELL_VALIGN, TYPE_STRING);
986   init_var (CELL_LSEP, TYPE_LENGTH);
987   init_var (CELL_RSEP, TYPE_LENGTH);
988   init_var (CELL_BSEP, TYPE_LENGTH);
989   init_var (CELL_TSEP, TYPE_LENGTH);
990   init_var (CELL_LBORDER, TYPE_LENGTH);
991   init_var (CELL_RBORDER, TYPE_LENGTH);
992   init_var (CELL_BBORDER, TYPE_LENGTH);
993   init_var (CELL_TBORDER, TYPE_LENGTH);
994   init_var (CELL_ROW_SPAN, TYPE_INTEGER);
995   init_var (CELL_COL_SPAN, TYPE_INTEGER);
996   init_var (CELL_VCORRECT, TYPE_STRING);
997   init_var (CELL_HYPHEN, TYPE_STRING);
998   init_var (CELL_BLOCK, TYPE_STRING);
999   init_var (CELL_ROW_NR, TYPE_INTEGER);
1000   init_var (CELL_COL_NR, TYPE_INTEGER);
1001 
1002   init_var (GR_GEOMETRY, TYPE_ADHOC);
1003   init_var (GR_FRAME, TYPE_ADHOC);
1004   init_var (GR_MODE, TYPE_STRING);
1005   init_var (GR_AUTO_CROP, TYPE_BOOLEAN);
1006   init_var (GR_CROP_PADDING, TYPE_LENGTH);
1007   init_var (GR_GRID, TYPE_ADHOC);
1008   init_var (GR_GRID_ASPECT, TYPE_ADHOC);
1009   init_var (GR_EDIT_GRID, TYPE_ADHOC);
1010   init_var (GR_EDIT_GRID_ASPECT, TYPE_ADHOC);
1011   init_var (GR_TRANSFORMATION, TYPE_ADHOC);
1012 
1013   init_var (GR_MAGNIFY, TYPE_NUMERIC);
1014   init_var (GR_OPACITY, TYPE_NUMERIC);
1015   init_var (GR_COLOR, TYPE_COLOR);
1016   init_var (GR_POINT_STYLE, TYPE_STRING);
1017   init_var (GR_LINE_WIDTH, TYPE_LENGTH);
1018   init_var (GR_LINE_JOIN, TYPE_STRING);
1019   init_var (GR_LINE_CAPS, TYPE_STRING);
1020   init_var (GR_LINE_EFFECTS, TYPE_ADHOC);
1021   init_var (GR_DASH_STYLE, TYPE_ADHOC);
1022   init_var (GR_DASH_STYLE_UNIT, TYPE_LENGTH);
1023   init_var (GR_ARROW_BEGIN, TYPE_ADHOC);
1024   init_var (GR_ARROW_END, TYPE_ADHOC);
1025   init_var (GR_ARROW_LENGTH, TYPE_LENGTH);
1026   init_var (GR_ARROW_HEIGHT, TYPE_LENGTH);
1027   init_var (GR_FILL_COLOR, TYPE_COLOR);
1028   init_var (GR_FILL_STYLE, TYPE_STRING);
1029   init_var (GR_TEXT_AT_HALIGN, TYPE_STRING);
1030   init_var (GR_TEXT_AT_VALIGN, TYPE_STRING);
1031   init_var (GR_TEXT_AT_MARGIN, TYPE_LENGTH);
1032 
1033   init_var (GID, TYPE_INTEGER);
1034   init_var (MAGNIFY, TYPE_NUMERIC);
1035   init_var (POINT_STYLE, TYPE_STRING);
1036   init_var (LINE_WIDTH, TYPE_LENGTH);
1037   init_var (LINE_JOIN, TYPE_STRING);
1038   init_var (LINE_CAPS, TYPE_STRING);
1039   init_var (LINE_EFFECTS, TYPE_ADHOC);
1040   init_var (DASH_STYLE, TYPE_ADHOC);
1041   init_var (DASH_STYLE_UNIT, TYPE_LENGTH);
1042   init_var (ARROW_BEGIN, TYPE_ADHOC);
1043   init_var (ARROW_END, TYPE_ADHOC);
1044   init_var (ARROW_LENGTH, TYPE_LENGTH);
1045   init_var (ARROW_HEIGHT, TYPE_LENGTH);
1046   init_var (FILL_COLOR, TYPE_COLOR);
1047   init_var (FILL_STYLE, TYPE_STRING);
1048   init_var (TEXT_AT_HALIGN, TYPE_STRING);
1049   init_var (TEXT_AT_VALIGN, TYPE_STRING);
1050   init_var (TEXT_AT_MARGIN, TYPE_LENGTH);
1051 
1052   init_var (SRC_STYLE, TYPE_STRING);
1053   init_var (SRC_SPECIAL, TYPE_STRING);
1054   init_var (SRC_COMPACT, TYPE_STRING);
1055   init_var (SRC_CLOSE, TYPE_STRING);
1056 
1057   init_var (CANVAS_TYPE, TYPE_STRING);
1058   init_var (CANVAS_COLOR, TYPE_COLOR);
1059   init_var (CANVAS_HPADDING, TYPE_LENGTH);
1060   init_var (CANVAS_VPADDING, TYPE_LENGTH);
1061   init_var (CANVAS_BAR_WIDTH, TYPE_LENGTH);
1062   init_var (CANVAS_BAR_PADDING, TYPE_LENGTH);
1063   init_var (CANVAS_BAR_COLOR, TYPE_COLOR);
1064   init_var (ORNAMENT_SHAPE, TYPE_STRING);
1065   init_var (ORNAMENT_TITLE_STYLE, TYPE_STRING);
1066   init_var (ORNAMENT_BORDER, TYPE_LENGTH);
1067   init_var (ORNAMENT_SWELL, TYPE_NUMERIC);
1068   init_var (ORNAMENT_HPADDING, TYPE_LENGTH);
1069   init_var (ORNAMENT_VPADDING, TYPE_LENGTH);
1070   init_var (ORNAMENT_COLOR, TYPE_COLOR);
1071   init_var (ORNAMENT_EXTRA_COLOR, TYPE_COLOR);
1072   init_var (ORNAMENT_SUNNY_COLOR, TYPE_COLOR);
1073   init_var (ORNAMENT_SHADOW_COLOR, TYPE_COLOR);
1074 }
1075