home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb153.zip / fweb-1.53 / web / map.hweb < prev    next >
Text File  |  1995-09-23  |  26KB  |  738 lines

  1. @z --- map.hweb ---
  2.  
  3. FWEB version 1.53 (September 23, 1995)
  4.  
  5. Based on version 0.5 of S. Levy's CWEB [copyright (C) 1987 Princeton University]
  6.  
  7. @x-----------------------------------------------------------------------------
  8.  
  9. @ Here is the layout of the style file map structure that relates the
  10. keyword in the style file to the argument that it sets.
  11.  
  12. @#ifdef _STYLE_
  13. @m YSET(stuff) = stuff
  14. @#else
  15. @m YSET(stuff)
  16. @#endif
  17.  
  18. @f S_MAP int
  19. @f STY_TYPE int
  20.  
  21. @<Typedef...@>=
  22.  
  23. typedef enum {S_DONE,S_CMNT,S_KEYWORD,S_STRING,S_CHAR,S_INT,S_LONG,
  24.     S_MODIFIED = 128,
  25.     S_CMNT_MOD,S_KEYWORD_MOD,S_STRING_MOD,
  26.     S_CHAR_MOD,S_INT_MOD,S_LONG_MOD} STY_TYPE;
  27.  
  28. typedef struct s_map
  29.     { 
  30.     outer_char *keyword; // Style keyword.
  31.     STY_TYPE type; // Type of argument.
  32.     void *ptr; /* Where to put the argument. This is a generic pointer,
  33. so it can be explicitly cast depending on the argument type. */
  34.     SRTN (*init)PROTO((struct s_map HUGE *)); // Initialization routine.
  35.     } S_MAP;
  36.     
  37. @ Here are the addresses of any control code characters that have been
  38. overridden by the style file.
  39.  
  40. @<Typedef...@>=
  41.  
  42. typedef char *CODES;
  43.  
  44. typedef struct
  45.     {
  46.     CODES Ascii_constant,
  47.         Begin_bp,
  48.         Begin_C,
  49.         Begin_FORTRAN,
  50.         Begin_meta,
  51.         Begin_RATFOR,
  52.         Begin_code,
  53.         Begin_nuweb,
  54.         Big_line_break,
  55.         Compiler_directive,
  56.         Defd_at,
  57.         Definition,
  58.         End_meta,
  59.         Force_line,
  60.         Formatt,
  61.         Implicit_reserved,
  62.         Insert_bp,
  63.         Invisible_cmnt,
  64.         Join,
  65.         Limbo_text,
  66.         Macro_def,
  67.         Math_break,
  68.         Module_name,
  69.         New_module,
  70.         New_output_file,
  71.         No_index,
  72.         No_line_break,
  73.         No_mac_expand,
  74.         Op_def,
  75.         Pseudo_colon,
  76.         Pseudo_expr,
  77.         Pseudo_semi,
  78.         Switch_math_flag,
  79.         TeX_String,
  80.         Thin_space,
  81.         Trace,
  82.         Undefinition,
  83.         Underline,
  84.         Verbatim,
  85.         WEB_Definition,
  86.         Xref_roman,
  87.         Xref_typewriter,
  88.         Xref_wildcard
  89.         Yes_index;
  90.     } C_STYLE;
  91.  
  92. IN_STYLE C_STYLE c_style;
  93.  
  94. @ Here are the mappings for the control-code keywords. These are shared by
  95. both \FTANGLE\ and \FWEAVE.
  96.  
  97. @m CMAP(code,Code) {OC(#code),S_STRING,(void *)&c_style.Code,set_str}
  98.  
  99. @<Mappings for the \FWEB\ control codes@>=
  100.  
  101. CMAP(ascii_constant,Ascii_constant),
  102. CMAP(begin_bp,Begin_bp),
  103. CMAP(begin_C,Begin_C),
  104. CMAP(begin_FORTRAN,Begin_FORTRAN),
  105. CMAP(begin_meta,Begin_meta),
  106. CMAP(begin_RATFOR,Begin_RATFOR),
  107. CMAP(begin_code,Begin_code),
  108. CMAP(begin_nweb,Begin_nuweb),
  109. CMAP(big_line_break,Big_line_break),
  110. CMAP(compiler_directive,Compiler_directive),
  111. CMAP(defd_at,Defd_at),
  112. CMAP(definition,Definition),
  113. CMAP(end_meta,End_meta),
  114. CMAP(force_line,Force_line),
  115. CMAP(format,Formatt),
  116. CMAP(explicit_reserved,Implicit_reserved),
  117. CMAP(insert_bp,Insert_bp),
  118. CMAP(invisible_cmnt,Invisible_cmnt),
  119. CMAP(join,Join),
  120. CMAP(limbo_text,Limbo_text),
  121. CMAP(math_break,Math_break),
  122. CMAP(module_name,Module_name),
  123. CMAP(new_module,New_module),
  124. CMAP(new_output_file,New_output_file),
  125. CMAP(no_index,No_index),
  126. CMAP(no_line_break,No_line_break),
  127. CMAP(no_mac_expand,No_mac_expand),
  128. CMAP(pseudo_colon,Pseudo_colon),
  129. CMAP(pseudo_expr,Pseudo_expr),
  130. CMAP(pseudo_semi,Pseudo_semi),
  131. CMAP(switch_math_flag,Switch_math_flag),
  132. CMAP(TeX_string,TeX_String),
  133. CMAP(thin_space,Thin_space),
  134. CMAP(trace,Trace),
  135. CMAP(undefinition,Undefinition),
  136. CMAP(underline,Underline),
  137. CMAP(verbatim,Verbatim),
  138. CMAP(WEB_definition,WEB_Definition),
  139. CMAP(xref_roman,Xref_roman),
  140. CMAP(xref_typewriter,Xref_typewriter),
  141. CMAP(xref_wildcard,Xref_wildcard),
  142. CMAP(yes_index,Yes_index)
  143.  
  144. @ The style file layout for \.{FWEAVE}.  These are the actual value fields,
  145. and are initialized to default values.  They are linked to vocabulary
  146. intries via |S_MAP| entries below.
  147.  
  148. @<Typedef...@>=
  149.  
  150. typedef struct
  151.     {
  152.    outer_char *preamble; // \TeX\ string to start the index. (``\.{\\Winx}'')
  153.    outer_char *postamble; // \TeX\ string to end the index. (``\.{\\Wfin}'')
  154.    outer_char *group_skip; // \TeX\ string to insert between letter groups.
  155.    outer_char *lethead_prefix; /* \TeX\ string to begin identifying letter
  156. at start of group. */
  157.    outer_char *lethead_suffix; /* \TeX\ string to insert after identifying
  158. letter. */
  159.    int lethead_flag; /* If~0, insert no letter. If~$> 0$, insert
  160. uppercase letter. If~$< 0$, insert lowercase letter. */
  161.    outer_char *item_0; // \TeX\ command to begin an index entry. (``\.{\\:}'')
  162.    outer_char *delim_0; // String to insert after identifier.
  163.    outer_char *delim_n; // String to insert between two module numbers.
  164.    outer_char *encap_prefix; // TeX command to begin a page number.
  165.    outer_char *encap_infix; // Left delimiter for encapsulation.
  166.    outer_char *encap_suffix; // Right delimiter for encapsulation.
  167.    outer_char *underline_prefix,*underline_suffix; /* Bracket underlined entry
  168. with these. (``\.{\\[}''), (``\.]'') */
  169.    outer_char *language_prefix,*language_suffix; /* Bracket language entry
  170. with these. (``\.{\\(}''), (``\.)'') */
  171.    outer_char *tex; // Name of \TeX\ output file for index. (``\.{INDEX.tex}'')
  172.    ASCII *collate; // Collation order.
  173.     } INDEX;
  174.  
  175. typedef struct
  176.     {
  177.    outer_char *preamble; /* \TeX\ string to start the module list.
  178. (``\.{\\Wmods}'') */ 
  179.    outer_char *postamble; // \TeX\ string to end the module list. (empty)
  180.    outer_char *tex; /* Name of \TeX\ output file for module names.
  181. (``\.{MODULES.tex}'') */
  182.    outer_char *info; // The \.{\\Winfo} macro.
  183.     } MODULES;
  184.  
  185. typedef struct
  186.     {
  187.    outer_char *tex; /* Name of \TeX\ output file for table of contents.
  188. (``\.{CONTENTS.tex}'') */
  189.    outer_char *preamble;  // Start the table of contents. (``\.{\\n\\Wcon}'').
  190.    outer_char *postamble; // Optional string after above. (\It{Empty}).
  191.     } CONTENTS;
  192.  
  193. typedef struct
  194.     {
  195.     outer_char *begin,*end;
  196.     } STR_INSERT;
  197.  
  198. typedef struct
  199.     {
  200.     STR_INSERT TeX,code;
  201.     } W_META;  // For \FWEAVE.
  202.  
  203. typedef struct
  204.     {
  205.     outer_char *def; // Begin an \.{@@d}.
  206.     outer_char *undef; // Begin an \.{@@u}.
  207.     } T_OUTER;
  208.  
  209. typedef struct
  210.     {
  211.     outer_char *top; // Start the meta-comment.
  212.     outer_char *prefx; // Generalization of comment char.
  213.     outer_char *bottom; // Finish the meta-comment.
  214.     } T_META0;
  215.  
  216. typedef struct
  217.     {
  218.     T_META0 hdr; // For bracketing the header info at top of file.
  219.     T_META0 msg; // For everything else.
  220.     } T_META; // For \FTANGLE.
  221.  
  222. typedef struct
  223.     {
  224.    outer_char *macros; // Name of the macro package. (``\.{fwebmac.sty}'')
  225.    FORMAT format;
  226.    outer_char *limbo; // Default limbo material.
  227.    outer_char *unnamed_preamble,*named_preamble; // Default stuff at mod start.
  228.    MARK_DEFINED mark;
  229.    outer_char *TeXindent,*codeindent;
  230.    W_META meta;
  231.    LATEX LaTeX;
  232.     } W_MISC;
  233.  
  234. typedef union
  235.     {
  236.     outer_char *name;
  237.     COLOR value;
  238.     } ACOLOR;
  239.  
  240. typedef struct
  241.     {
  242. /* The following fields are initially set to a default value like |RED|.
  243. Later, these are changed into actual escape sequences. */
  244.     ACOLOR ordinary;
  245.     ACOLOR program_name;
  246.     ACOLOR info,warning,error,fatal;
  247.     ACOLOR module_num,line_num;
  248.     ACOLOR in_file,out_file,include_file;
  249.     ACOLOR timing;
  250. /* These are set to abbreviations strings for escape sequences. */
  251.     outer_char HUGE *_NORMAL;
  252.     outer_char HUGE *_RED,HUGE *_GREEN,HUGE *_BLUE,
  253.         HUGE *_YELLOW,HUGE *_ORANGE;
  254.     } COLORS;
  255.  
  256. typedef enum
  257.     {
  258.     NO_COLOR,BILEVEL,TRUE_COLOR
  259.     } COLOR_MODE;
  260.  
  261. /* Parameters common to both \FTANGLE\ and \FWEAVE. */
  262. typedef struct
  263.     { // Allowable input file extensions.
  264.    outer_char HUGE *web,HUGE *change,HUGE *hweb,HUGE *hchange; 
  265.     } INPUT_EXT;
  266.  
  267. typedef struct
  268.     { // Default output file extensions.
  269.    outer_char HUGE *C_,HUGE *Cpp_,HUGE *M_,HUGE *N_,HUGE *N90_,
  270.         HUGE *R_,HUGE *R90_,HUGE *X_;
  271.     } OUTPUT_EXT;
  272.  
  273. typedef struct
  274.     { // Delimiters for dot constants.
  275.     ASCII begin,end;
  276.     } DOT_DELIMITER;
  277.  
  278. typedef struct
  279.     {
  280.     outer_char *xchr; // Translation table for scrambling |ASCII|.
  281.     outer_char ext_delimiter; // Delimiter for file extensions.
  282.     INPUT_EXT input_ext; // Default input file extensions.
  283.     OUTPUT_EXT output_ext; // Default output file extensions.    
  284.     outer_char *null_file_name; // Name of the null file.
  285.     DOT_DELIMITER dot_delimiter; // Delimiters for dot constants.
  286.     COLOR_MODE color_mode;    // Do we allow color?
  287.     COLORS color;    // Output colors.
  288.     } COMMON_PRMS;
  289.  
  290. typedef struct
  291.     {
  292.     INDEX indx;         // Index-related parameters.
  293.     MODULES modules;     // Stuff for module name printout.
  294.     CONTENTS contents;     // Stuff for table of contents.
  295.     W_MISC misc;         // Miscellaneous parameters.
  296.     } W_STYLE;
  297.  
  298. typedef struct
  299.     {
  300.    outer_char cchar; // Continuation character for \Fortran.
  301.    int output_line_length; // Length of \Fortran's output line.
  302.    outer_char *cdir_start[NUM_LANGUAGES]; /* Insert at the beginning of
  303. compiler directive. */
  304.    ASCII *ASCII_fcn; /* \.{@@"\dots"} is replaced by ``|ASCII_fcn|(\dots)''.
  305. (``\.{ASCIIstr}'') */
  306.    T_OUTER outer_start[NUM_LANGUAGES]; // Start an outer definition.
  307.    T_META meta[NUM_LANGUAGES]; // Handle meta-comments.
  308.     } T_STYLE;
  309.  
  310. @ The default definitions.
  311.  
  312. @f YSET $_EXPR
  313.  
  314. @d MAX_OUTPUT_LINE_LENGTH 100
  315. @d LONG_OUTPUT_LINE_LENGTH 80
  316. @d STANDARD_OUTPUT_LINE_LENGTH 72
  317. @d MIN_OUTPUT_LINE_LENGTH 60
  318.  
  319. @<Glob...@>=
  320.  
  321. IN_STYLE W_STYLE w_style YSET(`{
  322.     {OC("\\Winx"),OC("\n\\Wfin"),OC("\n\\Windexspace\n"),
  323.     OC(""),OC(""),0,     // Let-heads
  324.     OC("\\:"),         // Begin index entry
  325.     OC(", "),OC(", "),     // Delimiters.
  326.     OC(""),OC(""),OC(""),    // Encapsulation.
  327.     OC("\\["),OC("]"),     // Underlining.
  328.     OC("\\("),OC(")"),     // Language entries.
  329.     OC("INDEX.tex"),    // |INDEX|.
  330.     (ASCII *)" \1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\
  331. \20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37\
  332. !\42#$%&'()*+,-./:;<=>?@@[\\]^`{|}~_\
  333. abcdefghijklmnopqrstuvwxyz0123456789"}, // Collation order.
  334.     {OC("\\Wmods"),OC(""),OC("MODULES.tex"),OC("\\Winfo")}, // |MODULES|.
  335.     {OC("CONTENTS.tex"),OC("\n\\Wcon"),OC("")}, // |CONTENTS|.
  336.     {OC("fwebmac.sty"),
  337.     {OC("\\&"),OC("\\|"),OC("\\\\"),OC("\\\\"),OC("\\\\"),OC("\\@@"),
  338.         OC("\\."),OC("\\."),OC("\\9")},
  339.     OC(""),OC(""),OC(""),
  340.     {YES,NO,NO,NO,YES,NO}, // |MARK_DEFINED|
  341.     OC("1em"),OC("1em"),    // |TeXindent|, |codeindent|
  342.     {{OC("\\Begintt"),OC("\\Endtt")},
  343.      {OC("\\WBM\\Begintt\n"),OC("\\Endtt\\WEM")}}, // |W_META|
  344.     {OC(""),OC("article")}    // |LaTeX|
  345.     } // |W_MISC|.
  346.     }`);
  347.  
  348. IN_STYLE FORMAT *pfmt YSET(&w_style.misc.format);
  349.  
  350. /* --- Parameters common to both \FWEAVE\ and \FTANGLE. --- */
  351.  
  352. @#if 0 // The identity map; a template for filling in scrambled character set.
  353. "\000\001\002\003\004\005\006\007\
  354. \010\011\012\013\014\015\016\017\
  355. \020\021\022\023\024\025\026\027\
  356. \030\031\032\033\034\035\036\037\
  357. \040\041\042\043\044\045\046\047\
  358. \050\051\052\053\054\055\056\057\
  359. \060\061\062\063\064\065\066\067\
  360. \070\071\072\073\074\075\076\077\
  361. \100\101\102\103\104\105\106\107\
  362. \110\111\112\113\114\115\116\117\
  363. \120\121\122\123\124\125\126\127\
  364. \130\131\132\133\134\135\136\137\
  365. \140\141\142\143\144\145\146\147\
  366. \150\151\152\153\154\155\156\157\
  367. \160\161\162\163\164\165\166\167\
  368. \170\171\172\173\174\175\176\177\
  369. \200\201\202\203\204\205\206\207\
  370. \210\211\212\213\214\215\216\217\
  371. \220\221\222\223\224\225\226\227\
  372. \230\231\232\233\234\235\236\237\
  373. \240\241\242\243\244\245\246\247\
  374. \250\251\252\253\254\255\256\257\
  375. \260\261\262\263\264\265\266\267\
  376. \270\271\272\273\274\275\276\277\
  377. \300\301\302\303\304\305\306\307\
  378. \310\311\312\313\314\315\316\317\
  379. \320\321\322\323\324\325\326\327\
  380. \330\331\332\333\334\335\336\337\
  381. \340\341\342\343\344\345\346\347\
  382. \350\351\352\353\354\355\356\357\
  383. \360\361\362\363\364\365\366\367\
  384. \370\371\372\373\374\375\376\377"
  385. @#endif
  386.  
  387. @#if 0
  388. "\000\001\003\004\005\006\007\
  389. \010\011\012\013\014\015\016\017\
  390. \020\021\022\023\024\025\026\027\
  391. \030\031\032\033\034\035\036\037\
  392. \040\041\042\043\044\045\046\047\
  393. \050\051\052\053\054\055\056\057\
  394. \060\061\062\063\064\065\066\067\
  395. \070\071\072\073\074\075\076\077\
  396. \100\101\102\103\104\105\106\107\
  397. \110\111\112\113\114\115\116\117\
  398. \120\121\122\123\124\125\126\127\
  399. \130\131\132\133\134\135\136\137\
  400. \140\141\142\143\144\145\146\147\
  401. \150\151\152\153\154\155\156\157\
  402. \160\161\162\163\164\165\166\167\
  403. \170\171\172\173\174\175\176\002\177\
  404. \200\201\202\203\204\205\206\207\
  405. \210\211\212\213\214\215\216\217\
  406. \220\221\222\223\224\225\226\227\
  407. \230\231\232\233\234\235\236\237\
  408. \240\241\242\243\244\245\246\247\
  409. \250\251\252\253\254\255\256\257\
  410. \260\261\262\263\264\265\266\267\
  411. \270\271\272\273\274\275\276\277\
  412. \300\301\302\303\304\305\306\307\
  413. \310\311\312\313\314\315\316\317\
  414. \320\321\322\323\324\325\326\327\
  415. \330\331\332\333\334\335\336\337\
  416. \340\341\342\343\344\345\346\347\
  417. \350\351\352\353\354\355\356\357\
  418. \360\361\362\363\364\365\366\367\
  419. \370\371\372\373\374\375\376\377"
  420. @#endif
  421.  
  422. IN_STYLE COMMON_PRMS wt_style YSET(`{
  423. OC("\000\001\003\004\005\006\007\
  424. \010\011\012\013\014\015\016\017\
  425. \020\021\022\023\024\025\026\027\
  426. \030\031\032\033\034\035\036\037\
  427. \040\041\042\043\044\045\046\047\
  428. \050\051\052\053\054\055\056\057\
  429. \060\061\062\063\064\065\066\067\
  430. \070\071\072\073\074\075\076\077\
  431. \100\101\102\103\104\105\106\107\
  432. \110\111\112\113\114\115\116\117\
  433. \120\121\122\123\124\125\126\127\
  434. \130\131\132\133\134\135\136\137\
  435. \140\141\142\143\144\145\146\147\
  436. \150\151\152\153\154\155\156\157\
  437. \160\161\162\163\164\165\166\167\
  438. \170\171\172\173\174\175\176\002\177\
  439. \200\201\202\203\204\205\206\207\
  440. \210\211\212\213\214\215\216\217\
  441. \220\221\222\223\224\225\226\227\
  442. \230\231\232\233\234\235\236\237\
  443. \240\241\242\243\244\245\246\247\
  444. \250\251\252\253\254\255\256\257\
  445. \260\261\262\263\264\265\266\267\
  446. \270\271\272\273\274\275\276\277\
  447. \300\301\302\303\304\305\306\307\
  448. \310\311\312\313\314\315\316\317\
  449. \320\321\322\323\324\325\326\327\
  450. \330\331\332\333\334\335\336\337\
  451. \340\341\342\343\344\345\346\347\
  452. \350\351\352\353\354\355\356\357\
  453. \360\361\362\363\364\365\366\367\
  454. \370\371\372\373\374\375\376\377"
  455. ), // Scrambled |xchr|.
  456.     '.',    // Usual delimiter for file extensions.
  457.     {OC("web"),OC("ch"),OC("hweb"),OC("hch")}, // Input file extensions.
  458.     {OC(C_EXT),OC(Cpp_EXT),OC(M_EXT),OC(N_EXT),OC(N90_EXT),OC(R_EXT),
  459.         OC(R90_EXT),OC(X_EXT)}, // Output file extensions.
  460.     OC(NULL_FILE_NAME), // Name of the null file.
  461.     {'.','.'},    // Delimiters for dot constants.
  462.     NO_COLOR    // |color_mode|.
  463.     }`);
  464.  
  465. IN_STYLE T_STYLE t_style YSET(`{
  466.     CCHAR,        // Continuation character for \Fortran.
  467.     STANDARD_OUTPUT_LINE_LENGTH, // Length of \Fortran's output line.
  468.     {OC("#pragma "),OC("C"),OC("C"),OC(""),OC(""),
  469.      OC("#pragma "),OC("C"),OC("C")}, 
  470.         // Compiler directive prefixes. 
  471.     (ASCII *)"ASCIIstr",    // For \.{@@"\dots"} in \Fortran\ or \Ratfor.
  472. /* |outer_start| */
  473.     {{OC("#define"),OC("#undef")},    // |C|
  474.      {OC("define"),OC("undef")},    // |RATFOR|
  475.      {OC("define"),OC("undef")},    // |FORTRAN|
  476.      {OC("\\def"),OC("\\undef")},    // |TEX|
  477.      {OC("#define"),OC("#undef")},    // |MAKE|
  478.      {OC("#define"),OC("#undef")},    // |C_PLUS_PLUS|
  479.      {OC("define"),OC("undef")},    // |RATFOR_90|
  480.      {OC("define"),OC("undef")}},    // |FORTRAN_90|
  481. /*  |T_META| */
  482.     {{OC("#if(0)"),OC(""),OC("\n#endif")},
  483.         {OC("/*"),OC(""),OC("*/")},     // |C|
  484.      {{OC(""),OC("C"),OC("\n")},
  485.         {OC(""),OC("C"),OC("")},    // |RATFOR|
  486.      {{OC(""),OC("C"),OC("\n")},
  487.         {OC(""),OC("C"),OC("")},    // |FORTRAN|
  488.      {{OC(""),OC("%"),OC("\n")},
  489.         {OC(""),OC("%"),OC("")},    // |TEX|
  490.      {{OC("#if(0)"),OC(""),OC("\n#endif")},
  491.         {OC(""),OC(""),OC("")},        // |MAKE|
  492.      {{OC("#if(0)"),OC(""),OC("\n#endif")},
  493.         {OC("/*"),OC(""),OC("*/")},    // |C_PLUS_PLUS|
  494.      {{OC(""),OC("C"),OC("\n")},
  495.         {OC(""),OC("C"),OC("")},    // |RATFOR_90|
  496.      {{OC(""),OC("C"),OC("\n")},
  497.         {OC(""),OC("C"),OC("")}}     // |FORTRAN_90|
  498.     }`);
  499.  
  500. @ It's convenient to use a macro to relate the keywords to the parameters
  501. by creating |S_MAP| entries.  For example, the first entry associates
  502. |w_style.indx.preamble| with the keyword ``\.{index\_preamble}'', so one
  503. can say in the style file ``\.{index.preamble = "..."}''.  (Dots in a
  504. keyword are replaced by underscores by the style-file parser.)
  505.  
  506. @m WMAP(keyword,type,var,field,init) 
  507.     {OC(#keyword),S_##type,(void *)&w_style.var.field,init}
  508. @m IMAP(keyword,type,field,init) WMAP(keyword,type,indx,field,init)
  509.  
  510. @<Mappings for \FWEAVE's index@>=
  511.  
  512. IMAP(index_preamble,STRING,preamble,set_str),
  513. IMAP(index_postamble,STRING,postamble,set_str),
  514. IMAP(group_skip,STRING,group_skip,set_str),
  515. IMAP(lethead_prefix,STRING,lethead_prefix,set_str),
  516. IMAP(lethead_suffix,STRING,lethead_suffix,set_str),
  517. IMAP(lethead_flag,INT,lethead_flag,set_int),
  518. IMAP(item_0,STRING,item_0,set_str),
  519. IMAP(delim_0,STRING,delim_0,set_str),
  520. IMAP(delim_n,STRING,delim_n,set_str),
  521. IMAP(encap_prefix,STRING,encap_prefix,set_str),
  522. IMAP(encap_infix,STRING,encap_infix,set_str),
  523. IMAP(encap_suffix,STRING,encap_suffix,set_str),
  524. IMAP(underline_prefix,STRING,underline_prefix,set_str),
  525. IMAP(underline_suffix,STRING,underline_suffix,set_str),
  526. IMAP(language_prefix,STRING,language_prefix,set_str),
  527. IMAP(language_suffix,STRING,language_suffix,set_str),
  528. IMAP(index_tex,STRING,tex,set_str),
  529. IMAP(collate,STRING,collate,set_str)
  530.  
  531. @
  532. @m DMAP(keyword,type,field,init) WMAP(keyword,type,modules,field,init)
  533.  
  534. @<Mappings for \FWEAVE's module list@>=
  535.  
  536. DMAP(modules_preamble,STRING,preamble,set_str),
  537. DMAP(modules_postamble,STRING,postamble,set_str),
  538. DMAP(modules_tex,STRING,tex,set_str),
  539. DMAP(info,STRING,info,set_str)
  540.  
  541. @
  542. @m OMAP(keyword,type,field,init) WMAP(keyword,type,contents,field,init)
  543.  
  544. @<Mappings for \FWEAVE's table of contents@>=
  545.  
  546. OMAP(contents_tex,STRING,tex,set_str),
  547. OMAP(contents_preamble,STRING,preamble,set_str),
  548. OMAP(contents_postamble,STRING,postamble,set_str)
  549.  
  550. @
  551. @m MMAP(keyword,type,field,init) WMAP(keyword,type,misc,field,init)
  552.  
  553. @<Mappings for miscellaneous \FWEAVE\ parameters@>=
  554.  
  555. MMAP(macros,STRING,macros,set_str),
  556. MMAP(format_reserved,STRING,format.reserved,set_str),
  557. MMAP(format_identifier,STRING,format.id,set_str),
  558. MMAP(format_short_identifier,STRING,format.short_id,set_str),
  559. MMAP(format_outer_macro,STRING,format.id_outer,set_str),
  560. MMAP(format_WEB_macro,STRING,format.id_inner,set_str),
  561. MMAP(format_intrinsic,STRING,format.intrinsic,set_str),
  562. MMAP(format_keyword,STRING,format.keyword,set_str),
  563. MMAP(format_typewriter,STRING,format.typewritr,set_str),
  564. MMAP(format_wildcard,STRING,format.wildcrd,set_str),
  565. MMAP(unnamed_preamble,STRING,unnamed_preamble,set_str),
  566. MMAP(named_preamble,STRING,named_preamble,set_str),
  567. MMAP(limbo,STRING,limbo,add_str),
  568. MMAP(mark_defined_generic_name,INT,mark.generic_name,set_int),
  569. MMAP(mark_defined_fcn_name,INT,mark.fcn_name,set_int),
  570. MMAP(mark_defined_WEB_macro,INT,mark.WEB_macro,set_int),
  571. MMAP(mark_defined_outer_macro,INT,mark.outer_macro,set_int),
  572. MMAP(mark_defined_exp_type,INT,mark.imp_reserved_name,set_int),
  573. MMAP(mark_defined_typedef_name,INT,mark.typedef_name,set_int),
  574. MMAP(indent_TeX,STRING,TeXindent,set_str),
  575. MMAP(indent_code,STRING,codeindent,set_str),
  576. MMAP(meta_TeX_begin,STRING,meta.TeX.begin,set_str),
  577. MMAP(meta_TeX_end,STRING,meta.TeX.end,set_str),
  578. MMAP(meta_code_begin,STRING,meta.code.begin,set_str),
  579. MMAP(meta_code_end,STRING,meta.code.end,set_str),
  580. MMAP(LaTeX_options,STRING,LaTeX.options,set_str),
  581. MMAP(LaTeX_style,STRING,LaTeX.style,set_str)
  582.  
  583. @ Some parameters apply exclusively to \FTANGLE.
  584.  
  585. @m TMAP(keyword,type,field,init) 
  586.     {OC(#keyword),S_##type,(void *)&t_style.field,init} 
  587.  
  588. @<Mappings for miscellaneous \FTANGLE\ parameters@>=
  589.  
  590. TMAP(cchar,CHAR,cchar,ini_cchar),
  591. TMAP(line_length_N,INT,output_line_length,ini_output_line_length),@/
  592. TMAP(ASCII_fcn,STRING,ASCII_fcn,set_str),
  593. TMAP(outer_def_C,STRING,outer_start[0].def,set_str),
  594. TMAP(outer_def_R,STRING,outer_start[1].def,set_str),
  595. TMAP(outer_def_N,STRING,outer_start[2].def,set_str),
  596. TMAP(outer_def_X,STRING,outer_start[3].def,set_str),
  597. TMAP(outer_def_K,STRING,outer_start[4].def,set_str),
  598. TMAP(outer_def_Cpp,STRING,outer_start[5].def,set_str),
  599. TMAP(outer_def_R90,STRING,outer_start[6].def,set_str),
  600. TMAP(outer_def_N90,STRING,outer_start[7].def,set_str),
  601. TMAP(outer_undef_C,STRING,outer_def[0].undef,set_str),
  602. TMAP(outer_undef_R,STRING,outer_start[1].undef,set_str),
  603. TMAP(outer_undef_N,STRING,outer_def[2].undef,set_str),
  604. TMAP(outer_undef_X,STRING,outer_start[3].undef,set_str),
  605. TMAP(outer_undef_K,STRING,outer_def[4].undef,set_str),
  606. TMAP(outer_undef_Cpp,STRING,outer_start[5].undef,set_str),
  607. TMAP(outer_undef_R90,STRING,outer_def[6].undef,set_str),
  608. TMAP(outer_undef_N90,STRING,outer_start[7].undef,set_str),
  609. TMAP(cdir_start_C,STRING,cdir_start[0],set_str),
  610. TMAP(cdir_start_R,STRING,cdir_start[1],set_str),
  611. TMAP(cdir_start_N,STRING,cdir_start[2],set_str),
  612. TMAP(cdir_start_X,STRING,cdir_start[3],set_str),
  613. TMAP(cdir_start_K,STRING,cdir_start[4],set_str),
  614. TMAP(cdir_start_Cpp,STRING,cdir_start[5],set_str),
  615. TMAP(cdir_start_R90,STRING,cdir_start[6],set_str),
  616. TMAP(cdir_start_N90,STRING,cdir_start[7],set_str),
  617. TMAP(meta_top_C,STRING,meta[0].msg.top,set_str),
  618. TMAP(meta_top_R,STRING,meta[1].msg.top,set_str),
  619. TMAP(meta_top_N,STRING,meta[2].msg.top,set_str),
  620. TMAP(meta_top_X,STRING,meta[3].msg.top,set_str),
  621. TMAP(meta_top_K,STRING,meta[4].msg.top,set_str),
  622. TMAP(meta_top_Cpp,STRING,meta[5].msg.top,set_str),
  623. TMAP(meta_top_R90,STRING,meta[6].msg.top,set_str),
  624. TMAP(meta_top_N90,STRING,meta[7].msg.top,set_str),
  625. TMAP(meta_prefix_C,STRING,meta[0].msg.prefx,set_str),
  626. TMAP(meta_prefix_R,STRING,meta[1].msg.prefx,set_str),
  627. TMAP(meta_prefix_N,STRING,meta[2].msg.prefx,set_str),
  628. TMAP(meta_prefix_X,STRING,meta[3].msg.prefx,set_str),
  629. TMAP(meta_prefix_K,STRING,meta[4].msg.prefx,set_str),
  630. TMAP(meta_prefix_Cpp,STRING,meta[5].msg.prefx,set_str),
  631. TMAP(meta_prefix_R90,STRING,meta[6].msg.prefx,set_str),
  632. TMAP(meta_prefix_N90,STRING,meta[7].msg.prefx,set_str),
  633. TMAP(meta_bottom_C,STRING,meta[0].msg.bottom,set_str),
  634. TMAP(meta_bottom_R,STRING,meta[1].msg.bottom,set_str),
  635. TMAP(meta_bottom_N,STRING,meta[2].msg.bottom,set_str),
  636. TMAP(meta_bottom_X,STRING,meta[3].msg.bottom,set_str),
  637. TMAP(meta_bottom_K,STRING,meta[4].msg.bottom,set_str),
  638. TMAP(meta_bottom_Cpp,STRING,meta[5].msg.bottom,set_str),
  639. TMAP(meta_bottom_R90,STRING,meta[6].msg.bottom,set_str),
  640. TMAP(meta_bottom_N90,STRING,meta[7].msg.bottom,set_str),
  641. TMAP(meta_top_hdr_C,STRING,meta[0].hdr.top,set_str),
  642. TMAP(meta_top_hdr_R,STRING,meta[1].hdr.top,set_str),
  643. TMAP(meta_top_hdr_N,STRING,meta[2].hdr.top,set_str),
  644. TMAP(meta_top_hdr_X,STRING,meta[3].hdr.top,set_str),
  645. TMAP(meta_top_hdr_K,STRING,meta[4].hdr.top,set_str),
  646. TMAP(meta_top_hdr_Cpp,STRING,meta[5].hdr.top,set_str),
  647. TMAP(meta_top_hdr_R90,STRING,meta[6].hdr.top,set_str),
  648. TMAP(meta_top_hdr_N90,STRING,meta[7].hdr.top,set_str),
  649. TMAP(meta_prefix_hdr_C,STRING,meta[0].hdr.prefx,set_str),
  650. TMAP(meta_prefix_hdr_R,STRING,meta[1].hdr.prefx,set_str),
  651. TMAP(meta_prefix_hdr_N,STRING,meta[2].hdr.prefx,set_str),
  652. TMAP(meta_prefix_hdr_X,STRING,meta[3].hdr.prefx,set_str),
  653. TMAP(meta_prefix_hdr_K,STRING,meta[4].hdr.prefx,set_str),
  654. TMAP(meta_prefix_hdr_Cpp,STRING,meta[5].hdr.prefx,set_str),
  655. TMAP(meta_prefix_hdr_R90,STRING,meta[6].hdr.prefx,set_str),
  656. TMAP(meta_prefix_hdr_N90,STRING,meta[7].hdr.prefx,set_str),
  657. TMAP(meta_bottom_hdr_C,STRING,meta[0].hdr.bottom,set_str),
  658. TMAP(meta_bottom_hdr_R,STRING,meta[1].hdr.bottom,set_str),
  659. TMAP(meta_bottom_hdr_N,STRING,meta[2].hdr.bottom,set_str),
  660. TMAP(meta_bottom_hdr_X,STRING,meta[3].hdr.bottom,set_str),
  661. TMAP(meta_bottom_hdr_K,STRING,meta[4].hdr.bottom,set_str),
  662. TMAP(meta_bottom_hdr_Cpp,STRING,meta[5].hdr.bottom,set_str),
  663. TMAP(meta_bottom_hdr_R90,STRING,meta[6].hdr.bottom,set_str),
  664. TMAP(meta_bottom_hdr_N90,STRING,meta[7].hdr.bottom,set_str)@/
  665.  
  666. @ When a field such as |program_name| is set via ``\.{program.name =
  667. "red"}'', the initialization routine |ini_aclr| is run to convert the
  668. string the value~|RED|.
  669.  
  670. @m PMAP(keyword,type,field,init) 
  671.     {OC(#keyword),S_##type,(void *)&wt_style.field,init}
  672. @m CLR_MAP(keyword,field) PMAP(keyword,STRING,color.field.name,ini_aclr)
  673. @m CLINK(keyword,field) PMAP(keyword,STRING,color._##field,ini_bilevel)
  674.  
  675. @<Mappings for parameters common to \FWEAVE\ and \FTANGLE@>=
  676.  
  677. PMAP(xchr,STRING,xchr,set_str),
  678. PMAP(ext_delimiter,CHAR,ext_delimiter,set_char),
  679. PMAP(ext_web,STRING,input_ext.web,ini_ext),
  680. PMAP(ext_change,STRING,input_ext.change,ini_ext),
  681. PMAP(ext_hweb,STRING,input_ext.hweb,ini_ext),
  682. PMAP(ext_hchange,STRING,input_ext.hchange,ini_ext),@/
  683. PMAP(suffix_C,STRING,output_ext.C_,set_str),
  684. PMAP(suffix_Cpp,STRING,output_ext.Cpp_,set_str),
  685. PMAP(suffix_MAKE,STRING,output_ext.M_,set_str),
  686. PMAP(suffix_K,STRING,output_ext.M_,set_str),
  687. PMAP(suffix_FORTRAN,STRING,output_ext.N_,set_str),
  688. PMAP(suffix_N,STRING,output_ext.N_,set_str),
  689. PMAP(suffix_FORTRAN90,STRING,output_ext.N90_,set_str),
  690. PMAP(suffix_N90,STRING,output_ext.N90_,set_str),
  691. PMAP(suffix_RATFOR,STRING,output_ext.R_,set_str),
  692. PMAP(suffix_R,STRING,output_ext.R_,set_str),
  693. PMAP(suffix_RATFOR90,STRING,output_ext.R90_,set_str),
  694. PMAP(suffix_R90,STRING,output_ext.R90_,set_str),
  695. PMAP(suffix_TEX,STRING,output_ext.X_,set_str),
  696. PMAP(suffix_X,STRING,output_ext.X_,set_str),
  697. PMAP(null_file,STRING,null_file_name,set_str),
  698. PMAP(dot_constant_begin,CHAR,dot_delimiter.begin,ini_dot),
  699. PMAP(dot_constant_end,CHAR,dot_delimiter.end,ini_dot),
  700. PMAP(color_mode,INT,color_mode,ini_clr),@/
  701. CLR_MAP(color_ordinary,ordinary),
  702. CLR_MAP(color_program,program_name),
  703. CLR_MAP(color_info,info),
  704. CLR_MAP(color_warning,warning),
  705. CLR_MAP(color_error,error),
  706. CLR_MAP(color_fatal,fatal),
  707. CLR_MAP(color_module_num,module_num),
  708. CLR_MAP(color_line_num,line_num),
  709. CLR_MAP(color_input_file,in_file),
  710. CLR_MAP(color_include_file,include_file),
  711. CLR_MAP(color_output_file,out_file),
  712. CLR_MAP(color_timing,timing),@/
  713. CLINK(color_default,NORMAL),
  714. CLINK(color_red,RED),
  715. CLINK(color_green,GREEN),
  716. CLINK(color_blue,BLUE),
  717. CLINK(color_yellow,YELLOW),
  718. CLINK(color_orange,ORANGE)
  719.  
  720. @ Here are the actual mappings that relate the keywords to the parameter
  721. structures. 
  722. @<Glob...@>=
  723.  
  724. IN_STYLE S_MAP fweb_map[] 
  725. @#ifdef _STYLE_
  726.  = {
  727.     @<Mappings for \FWEAVE's index@>,@/
  728.     @<Mappings for \FWEAVE's module list@>,@/
  729.     @<Mappings for \FWEAVE's table of contents@>,@/
  730.     @<Mappings for miscellaneous \FWEAVE\ parameters@>,@/
  731.     @<Mappings for miscellaneous \FTANGLE\ parameters@>,@/
  732.     @<Mappings for parameters common to \FWEAVE\ and \FTANGLE@>,@/
  733.     @<Mappings for the \FWEB\ control codes@>,@/
  734.     {OC("")}
  735.    }
  736. @#endif /* |_STYLE_| */
  737. ;
  738.