home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / c2latex / src / c2latex.c next >
Encoding:
C/C++ Source or Header  |  1992-02-21  |  62.6 KB  |  1,953 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* scanner skeleton version:
  4.  * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.10 90/03/27 12:03:55 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. #ifdef __cplusplus
  13. #include <stdlib.h>
  14. #include <osfcn.h>
  15.  
  16. #define index strchr
  17.  
  18. /* use prototypes in function declarations */
  19. #define YY_USE_PROTOS
  20.  
  21. /* the "const" storage-class-modifier is valid */
  22. #define YY_USE_CONST
  23.  
  24. #endif
  25.  
  26. #ifdef __STDC__
  27. #define YY_USE_PROTOS
  28. #define YY_USE_CONST
  29. #endif
  30.  
  31. #ifdef __TURBOC__
  32. #define YY_USE_CONST
  33. #endif
  34.  
  35.  
  36. #ifndef YY_USE_CONST
  37. #define const
  38. #endif
  39.  
  40. #ifdef YY_USE_PROTOS
  41. #define YY_PROTO(proto) proto
  42. /*
  43. char *malloc( unsigned size );
  44. int free( char * );
  45. */
  46. #else
  47. #define YY_PROTO(proto) ()
  48. /* there's no standard place to get these definitions */
  49. char *malloc();
  50. int free();
  51. int read();
  52. #endif
  53.  
  54. /* amount of stuff to slurp up with each read */
  55. #ifndef YY_READ_BUF_SIZE
  56. #define YY_READ_BUF_SIZE 8192
  57. #endif
  58.  
  59. /* returned upon end-of-file */
  60. #define YY_END_TOK 0
  61.  
  62. /* copy whatever the last rule matched to the standard output */
  63.  
  64. /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
  65. /* this used to be an fputs(), but since the string might contain NUL's,
  66.  * we now use fwrite()
  67.  */
  68. #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
  69.  
  70. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  71.  * is returned in "result".
  72.  */
  73. #define YY_INPUT(buf,result,max_size) \
  74.         if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  75.             YY_FATAL_ERROR( "read() in flex scanner failed" );
  76. #define YY_NULL 0
  77.  
  78. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  79.  * we don't want an extra ';' after the "return" because that will cause
  80.  * some compilers to complain about unreachable statements.
  81.  */
  82. #define yyterminate() return ( YY_NULL )
  83.  
  84. /* report a fatal error */
  85. #define YY_FATAL_ERROR(msg) \
  86.         { \
  87.         (void) fputs( msg, stderr ); \
  88.         (void) putc( '\n', stderr ); \
  89.         exit( 1 ); \
  90.         }
  91.  
  92. /* default yywrap function - always treat EOF as an EOF */
  93. #define yywrap() 1
  94.  
  95. /* enter a start condition.  This macro really ought to take a parameter,
  96.  * but we do it the disgusting crufty way forced on us by the ()-less
  97.  * definition of BEGIN
  98.  */
  99. #define BEGIN yy_start = 1 + 2 *
  100.  
  101. /* action number for EOF rule of a given start state */
  102. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  103.  
  104. /* special action meaning "start processing a new file" */
  105. #define YY_NEW_FILE { \
  106.         yy_init_buffer( yy_current_buffer, yyin ); \
  107.         yy_load_buffer_state(); \
  108.         }
  109.  
  110. /* default declaration of generated scanner - a define so the user can
  111.  * easily add parameters
  112.  */
  113. #define YY_DECL int yylex YY_PROTO(( void )) 
  114.  
  115. /* code executed at the end of each rule */
  116. #define YY_BREAK break;
  117.  
  118. #define YY_END_OF_BUFFER_CHAR 0
  119.  
  120. #ifndef YY_BUF_SIZE
  121. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
  122. #endif
  123.  
  124. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  125.  
  126. #define YY_CHAR char
  127. #define INITIAL 0
  128. #define STRING 1
  129. #define BCOMMENT 2
  130. #define INCLUDE 3
  131. #define CPLUSPLUS 4
  132. #define KEY     printf ("{\\%s %s}", keyword_font, yytext)
  133. #define CPP     printf ("{\\%s \\%s}", cpp_font, yytext)
  134. #define SYM(x)  printf ("$\\%s$", x)
  135. #define OUT(x)  printf ("%s", x)
  136. #define SUB(x)  substitute(x)
  137. #define IND     indent(yytext)
  138.  
  139. #include <stdio.h>
  140.  
  141. int cplusplus_mode = 0;
  142.  
  143. int complete_file = 0;
  144. int header = 0;
  145. int tabtotab = 8;
  146. int piped = 0;
  147. char * font_size = "11";
  148. char * indentation = "0.5em";
  149. char * comment_font = "it";
  150. char * keyword_font = "bf";
  151. char * header_font = "sl";
  152. char * cpp_font = "tt";
  153. char * string_font = "tt";
  154. void substitute(const char *);
  155. void indent(const char *); 
  156. void newpage(int);
  157. void usage(const char *);
  158.  
  159. /* done after the current pattern has been matched and before the
  160.  * corresponding action - sets up yytext
  161.  */
  162. #define YY_DO_BEFORE_ACTION \
  163.         yytext = yy_bp; \
  164.         yyleng = yy_cp - yy_bp; \
  165.         yy_hold_char = *yy_cp; \
  166.         *yy_cp = '\0'; \
  167.         yy_c_buf_p = yy_cp;
  168.  
  169. #define EOB_ACT_CONTINUE_SCAN 0
  170. #define EOB_ACT_END_OF_FILE 1
  171. #define EOB_ACT_LAST_MATCH 2
  172.  
  173. /* return all but the first 'n' matched characters back to the input stream */
  174. #define yyless(n) \
  175.         { \
  176.         /* undo effects of setting up yytext */ \
  177.         *yy_cp = yy_hold_char; \
  178.         yy_c_buf_p = yy_cp = yy_bp + n; \
  179.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  180.         }
  181.  
  182. #define unput(c) yyunput( c, yytext )
  183.  
  184.  
  185. struct yy_buffer_state
  186.     {
  187.     FILE *yy_input_file;
  188.  
  189.     YY_CHAR *yy_ch_buf;         /* input buffer */
  190.     YY_CHAR *yy_buf_pos;        /* current position in input buffer */
  191.  
  192.     /* size of input buffer in bytes, not including room for EOB characters*/
  193.     int yy_buf_size;    
  194.  
  195.     /* number of characters read into yy_ch_buf, not including EOB characters */
  196.     int yy_n_chars;
  197.  
  198.     int yy_eof_status;          /* whether we've seen an EOF on this buffer */
  199. #define EOF_NOT_SEEN 0
  200.     /* "pending" happens when the EOF has been seen but there's still
  201.      * some text process
  202.      */
  203. #define EOF_PENDING 1
  204. #define EOF_DONE 2
  205.     };
  206.  
  207. static YY_BUFFER_STATE yy_current_buffer;
  208.  
  209. /* we provide macros for accessing buffer states in case in the
  210.  * future we want to put the buffer states in a more general
  211.  * "scanner state"
  212.  */
  213. #define YY_CURRENT_BUFFER yy_current_buffer
  214.  
  215.  
  216. /* yy_hold_char holds the character lost when yytext is formed */
  217. static YY_CHAR yy_hold_char;
  218.  
  219. static int yy_n_chars;          /* number of characters read into yy_ch_buf */
  220.  
  221.  
  222.  
  223. #ifndef YY_USER_ACTION
  224. #define YY_USER_ACTION
  225. #endif
  226.  
  227. extern YY_CHAR *yytext;
  228. extern int yyleng;
  229. extern FILE *yyin, *yyout;
  230.  
  231. YY_CHAR *yytext;
  232. int yyleng;
  233.  
  234. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  235.  
  236. #define YY_END_OF_BUFFER 139
  237. typedef int yy_state_type;
  238. static const short int yy_accept[535] =
  239.     {   0,
  240.         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  241.       139,  138,  135,  137,  136,   95,  115,  138,   86,   85,
  242.       138,  103,  104,   73,   97,   92,   96,   93,   77,  126,
  243.       126,   90,   94,   78,   91,   79,   89,  109,  109,  105,
  244.       138,  106,   74,  109,  109,  109,  109,  109,  109,  109,
  245.       109,  109,  109,  109,  109,  109,  109,  109,   83,   75,
  246.        84,   72,  134,  121,  119,  118,  121,  120,  114,  112,
  247.       114,  113,   14,   12,   13,   14,   14,  108,   96,   93,
  248.        90,  108,  108,  108,  108,  108,  108,  108,  108,  108,
  249.       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
  250.  
  251.       108,  135,  136,   64,    0,    0,    0,    0,    0,   81,
  252.        80,   82,    0,    0,   67,  100,  101,   87,  102,   59,
  253.         0,  122,  110,   98,  123,  126,  126,    0,  126,    0,
  254.        60,   62,   99,   63,   61,  109,  115,    0,  133,   70,
  255.       109,  109,  109,  109,  109,  109,   43,  109,  109,  109,
  256.       109,  109,  109,   44,  109,  109,  109,  109,  109,  109,
  257.       109,  109,  109,  109,  109,   71,   65,  134,  117,  116,
  258.       120,  111,  113,   12,    0,   11,    0,   10,  108,   59,
  259.        88,  107,  108,  108,  108,  108,  108,  108,  108,  108,
  260.        43,  108,  108,  108,  108,  108,  108,  108,   44,  108,
  261.  
  262.       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
  263.       108,  108,  108,  108,  108,  108,  108,    0,    0,    0,
  264.         4,    0,    0,  127,    0,  127,    0,    0,   66,    0,
  265.       122,  122,    0,  123,  126,    0,  124,  132,   68,   69,
  266.       109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
  267.       109,   36,  109,   17,  109,  109,  109,  109,  109,  109,
  268.       109,  109,  109,  109,  109,  109,  109,  109,  109,   76,
  269.       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
  270.       108,  108,  108,   36,  108,  108,  108,   17,  108,   47,
  271.       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
  272.  
  273.       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
  274.       108,    0,    0,    0,    0,    0,    0,    0,    0,  128,
  275.       129,    0,    0,    0,  124,  122,    0,  125,  132,   15,
  276.       109,   23,   27,  109,  109,  109,  109,   20,   24,  109,
  277.       109,   40,   21,  109,  109,  109,  109,  109,  109,  109,
  278.       109,  109,  109,  109,   38,  109,  109,   15,  108,   23,
  279.        27,  108,  108,  108,  108,  108,  108,   20,   24,  108,
  280.       108,  108,   40,  108,   21,  108,  108,  108,  108,  108,
  281.       108,  108,  108,  108,  108,  108,  108,  108,   49,  108,
  282.       108,  108,  108,   38,  108,  108,    0,    7,    8,    0,
  283.  
  284.         0,    0,    0,    0,    0,  130,    0,   19,   31,  109,
  285.       109,  109,  109,   32,  109,  109,   33,  109,  109,  109,
  286.       109,  109,  109,   30,  109,  109,   46,   19,   51,   31,
  287.       108,  108,  108,  108,  108,   32,  108,  108,  108,  108,
  288.       108,  108,  108,  108,  108,   33,  108,  108,  108,  108,
  289.       108,  108,   30,  108,  108,  108,   46,    0,    9,    5,
  290.         0,    0,    3,  109,  109,   16,   28,  109,   29,   37,
  291.        41,   45,   18,   22,  109,  109,  109,  108,  108,   48,
  292.        16,   28,   56,   57,  108,  108,  108,  108,   52,  108,
  293.        29,   37,   41,   45,   18,   22,  108,  108,  108,  108,
  294.  
  295.         2,    6,    0,  109,   39,  109,   26,  109,  109,  108,
  296.        39,  108,  108,   54,  108,  108,   26,  108,   55,  108,
  297.         1,   35,   25,   34,   42,   35,   50,   58,  108,   25,
  298.        34,   42,   53,    0
  299.     } ;
  300.  
  301. static const YY_CHAR yy_ec[128] =
  302.     {   0,
  303.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  304.         1,    4,    1,    1,    1,    1,    1,    1,    1,    1,
  305.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  306.         1,    5,    6,    7,    8,    9,   10,   11,   12,   13,
  307.        14,   15,   16,   17,   18,   19,   20,   21,   22,   22,
  308.        22,   22,   22,   22,   22,   23,   23,   24,   25,   26,
  309.        27,   28,   29,   30,   31,   31,   31,   31,   32,   33,
  310.        34,   34,   34,   34,   34,   35,   34,   34,   34,   34,
  311.        34,   34,   34,   34,   36,   34,   34,   34,   34,   34,
  312.        37,   38,   39,   40,   34,   30,   41,   42,   43,   44,
  313.  
  314.        45,   46,   47,   48,   49,   34,   50,   51,   52,   53,
  315.        54,   55,   34,   56,   57,   58,   59,   60,   61,   62,
  316.        63,   64,   65,   66,   67,   68,    1
  317.     } ;
  318.  
  319. static const YY_CHAR yy_meta[69] =
  320.     {   0,
  321.         1,    1,    1,    1,    2,    2,    3,    2,    4,    2,
  322.         2,    5,    2,    2,    2,    2,    2,    2,    2,    2,
  323.         6,    6,    7,    2,    2,    2,    2,    2,    3,    2,
  324.         7,    7,    7,    8,    8,    8,    2,    3,    2,    2,
  325.         6,    6,    7,    7,    7,    6,    8,    8,    8,    8,
  326.         8,    8,    9,    8,    8,    9,    8,    9,    8,    9,
  327.         8,    9,    8,    8,    2,    2,    2,    2
  328.     } ;
  329.  
  330. static const short int yy_base[548] =
  331.     {   0,
  332.         0,   67,   67,   73,   68,   79,   83,   90,  108,   94,
  333.       972,  973,   96,  973,  968,  943,  973,  129,  942,   62,
  334.       930,  973,  973,  940,   75,  973,   85,   85,   95,  170,
  335.       163,  973,  973,   88,  939,   91,  973,    0,  113,  973,
  336.       962,  973,  937,  904,  906,   82,   79,   84,   94,  907,
  337.        75,  906,  914,  152,  895,  904,  902,  907,  973,  111,
  338.       973,  973,  174,  973,  973,  973,  197,  178,  973,  973,
  339.       934,  185,  973,  192,  973,  946,  924,    0,  189,  204,
  340.       927,  941,  221,   70,   91,  211,  202,  187,  215,  194,
  341.       222,  209,  225,  227,  232,  228,  235,  237,  233,  245,
  342.  
  343.       203,  256,  973,  973,  262,  904,  221,  244,  895,  973,
  344.       973,  973,  935,  280,  973,  973,  973,  973,  973,  973,
  345.       927,  282,  973,  973,  302,  322,  340,  348,  973,    0,
  346.       918,  973,  973,  973,  917,    0,  973,  905,  973,  973,
  347.       884,  896,  883,  898,  885,  891,  877,  878,  875,  875,
  348.       878,  875,  872,    0,  871,  875,  231,  873,  213,  239,
  349.       877,  870,  259,  230,  875,  973,  973,  307,  973,  973,
  350.       308,  973,  317,  324,  916,  973,  894,  973,    0,  906,
  351.       973,  973,  911,  321,  311,  289,  309,  327,  329,  342,
  352.       330,  323,  331,  340,  343,  322,  346,  351,  910,  356,
  353.  
  354.       365,  368,  374,  375,  377,  383,  385,  387,  391,  392,
  355.       378,  393,  394,  395,  397,  396,  401,  872,  359,  873,
  356.       368,  873,  871,  973,  902,  901,  401,    0,  973,  438,
  357.       973,  441,  449,  973,  973,  413,  456,  445,  973,  973,
  358.       858,  870,  865,  853,  382,  867,  865,  861,  853,  859,
  359.       862,    0,  848,    0,  854,  851,  840,  842,  844,  851,
  360.       837,  835,  835,  847,  837,  841,  845,  847,  836,  973,
  361.       415,  442,  421,  402,  428,  437,  448,  466,  459,  473,
  362.       475,  479,  481,  877,  484,  482,  488,  876,  491,  875,
  363.       489,  490,  493,  494,  496,  499,  497,  498,  504,  505,
  364.  
  365.       500,  501,  503,  506,  510,  508,  516,  511,  507,  523,
  366.       517,  834,  836,  836,  831,  834,  834,  826,  831,  973,
  367.       973,  509,  863,  512,  518,  973,  521,  549,  973,    0,
  368.       824,    0,    0,  815,  823,  812,  819,    0,    0,  813,
  369.       810,    0,    0,  810,  810,  807,  819,  809,  813,  818,
  370.       817,  815,  805,  810,    0,  798,  810,  845,  540,  844,
  371.       843,  519,  550,  557,  514,  558,  566,  842,  841,  565,
  372.       568,  569,  840,  570,  839,  571,  573,  572,  574,  576,
  373.       575,  577,  578,  582,  580,  579,  586,  587,  838,  591,
  374.       584,  592,  583,  837,  585,  593,  792,  973,  973,  798,
  375.  
  376.       797,  797,  782,  794,  827,  973,  826,    0,    0,  784,
  377.       785,  790,  781,    0,  775,  779,    0,  787,  784,  786,
  378.       770,  779,  781,    0,  772,  775,    0,  814,  813,  812,
  379.       588,  589,  600,  601,  594,  811,  605,  606,  590,  596,
  380.       595,  609,  611,  598,  602,  810,  622,  635,  648,  649,
  381.       650,  651,  809,  652,  653,  654,  808,  771,  973,  973,
  382.       769,  770,  973,  754,  754,    0,    0,  766,    0,    0,
  383.         0,    0,    0,    0,  764,  764,  749,  655,  658,  790,
  384.       787,  781,  775,  712,  656,  659,  661,  660,  695,  663,
  385.       693,  692,  690,  688,  686,  684,  665,  664,  662,  666,
  386.  
  387.       973,  973,  647,  645,    0,  633,    0,  643,  639,  667,
  388.       673,  668,  671,  670,  674,  669,  419,  676,  408,  677,
  389.       973,    0,    0,    0,    0,  406,  267,  236,  679,  172,
  390.       166,   78,   68,  973,  725,  734,  743,  751,  755,  764,
  391.       773,  779,  785,  792,  796,  798,  801
  392.     } ;
  393.  
  394. static const short int yy_def[548] =
  395.     {   0,
  396.       534,    1,  535,  535,  536,  536,  537,  537,    1,    9,
  397.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  398.       538,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  399.       534,  534,  534,  534,  534,  534,  534,  539,  539,  534,
  400.       534,  534,  534,  539,  539,  539,  539,  539,  539,  539,
  401.       539,  539,  539,  539,  539,  539,  539,  539,  534,  534,
  402.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  403.       534,  534,  534,  534,  534,  540,  541,  542,  534,  534,
  404.       534,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  405.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  406.  
  407.       543,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  408.       534,  534,  534,  544,  534,  534,  534,  534,  534,  534,
  409.       534,  534,  534,  534,  534,  534,  534,  534,  534,  545,
  410.       534,  534,  534,  534,  534,  539,  534,  538,  534,  534,
  411.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  412.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  413.       539,  539,  539,  539,  539,  534,  534,  534,  534,  534,
  414.       534,  534,  534,  534,  540,  534,  541,  534,  542,  534,
  415.       534,  534,  543,  543,  543,  543,  543,  543,  543,  543,
  416.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  417.  
  418.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  419.       543,  543,  543,  543,  543,  543,  543,  534,  534,  534,
  420.       534,  534,  534,  534,  534,  534,  534,  546,  534,  534,
  421.       534,  534,  534,  534,  534,  534,  534,  545,  534,  534,
  422.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  423.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  424.       539,  539,  539,  539,  539,  539,  539,  539,  539,  534,
  425.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  426.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  427.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  428.  
  429.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  430.       543,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  431.       534,  534,  547,  534,  534,  534,  534,  534,  534,  539,
  432.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  433.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  434.       539,  539,  539,  539,  539,  539,  539,  543,  543,  543,
  435.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  436.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  437.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  438.       543,  543,  543,  543,  543,  543,  534,  534,  534,  534,
  439.  
  440.       534,  534,  534,  534,  534,  534,  534,  539,  539,  539,
  441.       539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
  442.       539,  539,  539,  539,  539,  539,  539,  543,  543,  543,
  443.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  444.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  445.       543,  543,  543,  543,  543,  543,  543,  534,  534,  534,
  446.       534,  534,  534,  539,  539,  539,  539,  539,  539,  539,
  447.       539,  539,  539,  539,  539,  539,  539,  543,  543,  543,
  448.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  449.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  450.  
  451.       534,  534,  534,  539,  539,  539,  539,  539,  539,  543,
  452.       543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
  453.       534,  539,  539,  539,  539,  543,  543,  543,  543,  543,
  454.       543,  543,  543,    0,  534,  534,  534,  534,  534,  534,
  455.       534,  534,  534,  534,  534,  534,  534
  456.     } ;
  457.  
  458. static const short int yy_nxt[1042] =
  459.     {   0,
  460.        12,   13,   14,   15,   13,   16,   17,   18,   12,   19,
  461.        20,   21,   22,   23,   24,   25,   26,   27,   28,   29,
  462.        30,   31,   31,   32,   33,   34,   35,   36,   37,   12,
  463.        38,   38,   38,   38,   39,   38,   40,   41,   42,   43,
  464.        44,   45,   46,   47,   48,   49,   50,   38,   51,   38,
  465.        52,   38,   38,   38,   38,   53,   54,   55,   56,   57,
  466.        58,   38,   38,   38,   59,   60,   61,   62,   63,   65,
  467.        70,   63,  111,   66,   68,   65,  179,   68,  179,   66,
  468.        72,   70,   71,   72,   74,   75,  179,   74,  112,   76,
  469.       116,   74,   75,   71,   74,   63,   76,  102,   63,  179,
  470.  
  471.       102,  117,  118,  121,   67,  122,  122,  122,   77,  123,
  472.        67,  119,  120,  131,  132,   77,   78,  134,  135,  137,
  473.       154,  124,  143,  146,  138,   79,   80,  155,  184,  144,
  474.       105,   81,  147,  105,  148,  145,  149,  166,   82,   82,
  475.        82,   82,   83,   82,  151,  150,  185,  152,   84,   85,
  476.        86,   87,   88,   89,   90,   82,   91,   82,   92,   82,
  477.        93,   94,   95,   96,   97,   98,   99,  100,  101,   82,
  478.        82,   82,  106,  107,  179,  168,  167,  108,  168,  171,
  479.       179,  125,  171,  127,  127,  127,  173,  109,  125,  173,
  480.       126,  126,  127,  174,  128,  179,  174,  129,  129,  158,
  481.  
  482.       159,  128,  179,  169,  129,  129,  118,  128,  169,  160,
  483.       179,  179,  161,  129,  128,  119,  180,  179,  181,  179,
  484.       129,  129,  121,  179,  122,  122,  122,  137,  129,  179,
  485.       179,  130,  138,  179,  170,  179,  179,  192,  169,  193,
  486.       179,  179,  169,  179,  179,  179,  190,  198,  194,  169,
  487.       217,  186,  169,  179,  169,  191,  169,  102,  187,  259,
  488.       102,  188,  201,  105,  189,  195,  105,  199,  196,  202,
  489.       197,  219,  207,  220,  200,  179,  260,  256,  267,  261,
  490.       268,  203,  208,  209,  212,  214,  204,  205,  257,  221,
  491.       206,  226,  210,  215,  262,  211,  222,  179,  216,  213,
  492.  
  493.       227,  227,  122,  122,  122,  106,  107,  265,  168,  171,
  494.       108,  168,  171,  230,  231,  266,  231,  179,  173,  179,
  495.       109,  173,  232,  232,  232,  174,  230,  231,  174,  179,
  496.       179,  179,  231,  233,  234,  179,  234,  179,  179,  179,
  497.       125,  228,  126,  126,  127,  273,  233,  234,  179,  274,
  498.       179,  179,  234,  128,  179,  272,  235,  235,  125,  179,
  499.       127,  127,  127,  236,  179,  236,  128,  275,  237,  237,
  500.       237,  128,  235,  179,  129,  129,  179,  284,  271,  280,
  501.       235,  276,  179,  179,  128,  179,  179,  277,  279,  281,
  502.       129,  179,  278,  179,  285,  179,  283,  282,  129,  179,
  503.  
  504.       179,  179,  179,  179,  179,  179,  287,  313,  286,  179,
  505.       179,  316,  321,  288,  179,  314,  179,  289,  291,  292,
  506.       317,  322,  322,  179,  295,  293,  303,  179,  290,  179,
  507.       294,  296,  301,  237,  237,  237,  179,  299,  334,  335,
  508.       298,  304,  297,  306,  309,  179,  310,  302,  305,  311,
  509.       179,  307,  308,  324,  300,  324,  179,  361,  325,  325,
  510.       325,  232,  232,  232,  327,  360,  327,  179,  358,  328,
  511.       328,  328,  128,  326,  179,  326,  237,  237,  237,  329,
  512.       329,  179,  359,  179,  362,  128,  326,  179,  365,  179,
  513.       179,  326,  179,  363,  364,  329,  179,  179,  179,  179,
  514.  
  515.       367,  179,  179,  329,  179,  179,  179,  179,  179,  179,
  516.       366,  179,  179,  179,  179,  179,  179,  368,  179,  179,
  517.       321,  371,  179,  370,  179,  179,  369,  179,  372,  405,
  518.       405,  179,  325,  325,  325,  373,  374,  375,  325,  325,
  519.       325,  328,  328,  328,  376,  377,  380,  381,  179,  385,
  520.       394,  379,  378,  383,  390,  382,  384,  386,  179,  387,
  521.       388,  391,  389,  395,  392,  179,  179,  396,  393,  328,
  522.       328,  328,  432,  179,  179,  429,  179,  179,  179,  179,
  523.       179,  179,  179,  179,  179,  179,  179,  179,  179,  428,
  524.       179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
  525.  
  526.       179,  179,  179,  179,  179,  431,  179,  430,  179,  179,
  527.       179,  439,  441,  179,  179,  433,  434,  179,  442,  179,
  528.       435,  437,  438,  440,  443,  436,  447,  449,  450,  451,
  529.       179,  444,  445,  448,  452,  446,  453,  457,  454,  479,
  530.       478,  455,  456,  179,  480,  481,  482,  485,  483,  486,
  531.       484,  488,  487,  489,  491,  490,  179,  179,  179,  179,
  532.       179,  179,  179,  179,  179,  492,  179,  179,  179,  179,
  533.       179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
  534.       493,  179,  179,  525,  179,  179,  524,  179,  523,  522,
  535.       494,  521,  179,  499,  179,  497,  179,  496,  179,  513,
  536.  
  537.       179,  179,  500,  179,  498,  514,  495,  516,  518,  512,
  538.       517,  526,  519,  510,  528,  511,  520,  515,  529,  531,
  539.       179,  532,  533,  527,  530,   64,   64,   64,   64,   64,
  540.        64,   64,   64,   64,   69,   69,   69,   69,   69,   69,
  541.        69,   69,   69,   73,   73,   73,   73,   73,   73,   73,
  542.        73,   73,  113,  113,  113,  113,  113,  113,  113,  113,
  543.       136,  136,  136,  136,  175,  175,  175,  175,  175,  175,
  544.       175,  175,  175,  177,  177,  177,  177,  177,  177,  177,
  545.       177,  177,  179,  179,  179,  179,  179,  179,  183,  179,
  546.       183,  183,  183,  183,  225,  179,  225,  225,  179,  509,
  547.  
  548.       225,  238,  238,  323,  323,  407,  407,  407,  508,  507,
  549.       506,  505,  504,  503,  502,  501,  179,  179,  179,  179,
  550.       179,  179,  179,  477,  476,  475,  474,  473,  472,  471,
  551.       470,  469,  468,  467,  466,  465,  464,  406,  321,  463,
  552.       462,  461,  460,  459,  458,  179,  179,  179,  179,  179,
  553.       179,  179,  179,  179,  427,  426,  425,  424,  423,  422,
  554.       421,  420,  419,  418,  417,  416,  415,  414,  413,  412,
  555.       411,  410,  409,  408,  406,  404,  403,  402,  401,  400,
  556.       399,  398,  397,  179,  179,  179,  357,  356,  355,  354,
  557.       353,  352,  351,  350,  349,  348,  347,  346,  345,  344,
  558.  
  559.       343,  342,  341,  340,  339,  338,  337,  336,  333,  332,
  560.       331,  330,  320,  320,  319,  318,  315,  312,  179,  179,
  561.       270,  178,  176,  269,  264,  263,  258,  255,  254,  253,
  562.       252,  251,  250,  249,  248,  247,  246,  245,  244,  243,
  563.       242,  241,  114,  240,  239,  229,  224,  223,  218,  179,
  564.       182,  178,  176,  172,  165,  164,  163,  162,  157,  156,
  565.       153,  142,  141,  140,  139,  133,  115,  114,  110,  104,
  566.       103,  534,   11,  534,  534,  534,  534,  534,  534,  534,
  567.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  568.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  569.  
  570.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  571.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  572.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  573.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  574.       534
  575.     } ;
  576.  
  577. static const short int yy_chk[1042] =
  578.     {   0,
  579.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  580.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  581.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  582.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  583.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  584.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  585.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  586.         5,    2,   20,    3,    4,    4,  533,    4,   84,    4,
  587.         6,    6,    5,    6,    7,    7,  532,    7,   20,    7,
  588.        25,    8,    8,    6,    8,   10,    8,   13,   10,   85,
  589.  
  590.        13,   25,   27,   28,    3,   28,   28,   28,    7,   29,
  591.         4,   27,   27,   34,   34,    8,    9,   36,   36,   39,
  592.        51,   29,   46,   47,   39,    9,    9,   51,   84,   46,
  593.        18,    9,   47,   18,   48,   46,   48,   60,    9,    9,
  594.         9,    9,    9,    9,   49,   48,   85,   49,    9,    9,
  595.         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
  596.         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
  597.         9,    9,   18,   18,  531,   63,   60,   18,   63,   68,
  598.       530,   31,   68,   31,   31,   31,   72,   18,   30,   72,
  599.        30,   30,   30,   74,   31,   88,   74,   31,   31,   54,
  600.  
  601.        54,   30,   90,   67,   30,   30,   79,   31,   67,   54,
  602.        87,  101,   54,   31,   30,   79,   79,   92,   80,   86,
  603.        30,   31,   80,   89,   80,   80,   80,   83,   30,   83,
  604.        91,   30,   83,   93,   67,   94,   96,   88,   67,   88,
  605.        95,   99,   67,   97,  528,   98,   87,   90,   88,   67,
  606.       101,   86,   67,  100,   67,   87,   67,  102,   86,  159,
  607.       102,   86,   92,  105,   86,   89,  105,   91,   89,   93,
  608.        89,  107,   96,  107,   91,  527,  159,  157,  164,  160,
  609.       164,   94,   97,   97,   98,   99,   94,   95,  157,  108,
  610.        95,  114,   97,  100,  160,   97,  108,  186,  100,   98,
  611.  
  612.       114,  114,  122,  122,  122,  105,  105,  163,  168,  171,
  613.       105,  168,  171,  122,  122,  163,  122,  187,  173,  185,
  614.       105,  173,  125,  125,  125,  174,  122,  122,  174,  184,
  615.       196,  192,  122,  125,  125,  188,  125,  189,  191,  193,
  616.       126,  114,  126,  126,  126,  186,  125,  125,  194,  187,
  617.       190,  195,  125,  126,  197,  185,  126,  126,  127,  198,
  618.       127,  127,  127,  128,  200,  128,  126,  188,  128,  128,
  619.       128,  127,  126,  201,  127,  127,  202,  196,  184,  192,
  620.       126,  189,  203,  204,  127,  205,  211,  190,  191,  193,
  621.       127,  206,  190,  207,  197,  208,  195,  194,  127,  209,
  622.  
  623.       210,  212,  213,  214,  216,  215,  200,  219,  198,  217,
  624.       274,  221,  227,  200,  526,  219,  519,  201,  203,  204,
  625.       221,  227,  227,  271,  206,  205,  211,  517,  202,  273,
  626.       205,  207,  210,  236,  236,  236,  275,  209,  245,  245,
  627.       208,  212,  207,  214,  216,  276,  216,  210,  213,  217,
  628.       272,  214,  215,  230,  209,  230,  277,  274,  230,  230,
  629.       230,  232,  232,  232,  233,  273,  233,  279,  271,  233,
  630.       233,  233,  232,  232,  278,  232,  237,  237,  237,  238,
  631.       238,  280,  272,  281,  275,  232,  232,  282,  277,  283,
  632.       286,  232,  285,  276,  276,  238,  287,  291,  292,  289,
  633.  
  634.       279,  293,  294,  238,  295,  297,  298,  296,  301,  302,
  635.       278,  303,  299,  300,  304,  309,  306,  280,  305,  308,
  636.       322,  283,  365,  282,  307,  311,  281,  362,  285,  322,
  637.       322,  310,  324,  324,  324,  286,  287,  289,  325,  325,
  638.       325,  327,  327,  327,  291,  292,  295,  296,  359,  300,
  639.       309,  294,  293,  298,  305,  297,  299,  301,  363,  302,
  640.       303,  306,  304,  310,  307,  364,  366,  311,  308,  328,
  641.       328,  328,  365,  370,  367,  362,  371,  372,  374,  376,
  642.       378,  377,  379,  381,  380,  382,  383,  386,  385,  359,
  643.       384,  393,  391,  395,  387,  388,  431,  432,  439,  390,
  644.  
  645.       392,  396,  435,  441,  440,  364,  444,  363,  433,  434,
  646.       445,  376,  378,  437,  438,  366,  367,  442,  379,  443,
  647.       370,  372,  374,  377,  380,  371,  384,  386,  387,  388,
  648.       447,  381,  382,  385,  390,  383,  391,  396,  392,  432,
  649.       431,  393,  395,  448,  433,  434,  435,  439,  437,  440,
  650.       438,  442,  441,  443,  445,  444,  449,  450,  451,  452,
  651.       454,  455,  456,  478,  485,  447,  479,  486,  488,  487,
  652.       499,  490,  498,  497,  500,  510,  512,  516,  514,  513,
  653.       448,  511,  515,  509,  518,  520,  508,  529,  506,  504,
  654.       449,  503,  496,  455,  495,  452,  494,  451,  493,  486,
  655.  
  656.       492,  491,  456,  489,  454,  487,  450,  490,  498,  485,
  657.       497,  510,  499,  478,  513,  479,  500,  488,  515,  518,
  658.       484,  520,  529,  512,  516,  535,  535,  535,  535,  535,
  659.       535,  535,  535,  535,  536,  536,  536,  536,  536,  536,
  660.       536,  536,  536,  537,  537,  537,  537,  537,  537,  537,
  661.       537,  537,  538,  538,  538,  538,  538,  538,  538,  538,
  662.       539,  539,  539,  539,  540,  540,  540,  540,  540,  540,
  663.       540,  540,  540,  541,  541,  541,  541,  541,  541,  541,
  664.       541,  541,  542,  483,  542,  542,  542,  542,  543,  482,
  665.       543,  543,  543,  543,  544,  481,  544,  544,  480,  477,
  666.  
  667.       544,  545,  545,  546,  546,  547,  547,  547,  476,  475,
  668.       468,  465,  464,  462,  461,  458,  457,  453,  446,  436,
  669.       430,  429,  428,  426,  425,  423,  422,  421,  420,  419,
  670.       418,  416,  415,  413,  412,  411,  410,  407,  405,  404,
  671.       403,  402,  401,  400,  397,  394,  389,  375,  373,  369,
  672.       368,  361,  360,  358,  357,  356,  354,  353,  352,  351,
  673.       350,  349,  348,  347,  346,  345,  344,  341,  340,  337,
  674.       336,  335,  334,  331,  323,  319,  318,  317,  316,  315,
  675.       314,  313,  312,  290,  288,  284,  269,  268,  267,  266,
  676.       265,  264,  263,  262,  261,  260,  259,  258,  257,  256,
  677.  
  678.       255,  253,  251,  250,  249,  248,  247,  246,  244,  243,
  679.       242,  241,  226,  225,  223,  222,  220,  218,  199,  183,
  680.       180,  177,  175,  165,  162,  161,  158,  156,  155,  153,
  681.       152,  151,  150,  149,  148,  147,  146,  145,  144,  143,
  682.       142,  141,  138,  135,  131,  121,  113,  109,  106,   82,
  683.        81,   77,   76,   71,   58,   57,   56,   55,   53,   52,
  684.        50,   45,   44,   43,   41,   35,   24,   21,   19,   16,
  685.        15,   11,  534,  534,  534,  534,  534,  534,  534,  534,
  686.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  687.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  688.  
  689.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  690.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  691.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  692.       534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
  693.       534
  694.     } ;
  695.  
  696. /* the intent behind this definition is that it'll catch
  697.  * any uses of REJECT which flex missed
  698.  */
  699. #define REJECT reject_used_but_not_detected
  700. #define yymore() yymore_used_but_not_detected
  701. #define YY_MORE_ADJ 0
  702.  
  703. /* these variables are all declared out here so that section 3 code can
  704.  * manipulate them
  705.  */
  706. /* points to current character in buffer */
  707. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  708. static int yy_init = 1;         /* whether we need to initialize */
  709. static int yy_start = 0;        /* start state number */
  710.  
  711. static yy_state_type yy_last_accepting_state;
  712. static YY_CHAR *yy_last_accepting_cpos;
  713.  
  714. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  715. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  716. static int yy_get_next_buffer YY_PROTO(( void ));
  717. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  718. void yyrestart YY_PROTO(( FILE *input_file ));
  719. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  720. void yy_load_buffer_state YY_PROTO(( void ));
  721. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  722. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  723. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  724.  
  725. #ifdef __cplusplus
  726. static int yyinput YY_PROTO(( void ));
  727. #else
  728. static int input YY_PROTO(( void ));
  729. #endif
  730.  
  731. YY_DECL
  732.     {
  733.     register yy_state_type yy_current_state;
  734.     register YY_CHAR *yy_cp, *yy_bp;
  735.     register int yy_act;
  736.  
  737.  
  738.  
  739.         if (cplusplus_mode)
  740.           BEGIN (CPLUSPLUS);
  741.  
  742.  
  743.  
  744.     if ( yy_init )
  745.         {
  746.         if ( ! yy_start )
  747.             yy_start = 1;       /* first start state */
  748.  
  749.         if ( ! yyin )
  750.             yyin = stdin;
  751.  
  752.         if ( ! yyout )
  753.             yyout = stdout;
  754.  
  755.         if ( yy_current_buffer )
  756.             yy_init_buffer( yy_current_buffer, yyin );
  757.         else
  758.             yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  759.  
  760.         yy_load_buffer_state();
  761.  
  762.         yy_init = 0;
  763.         }
  764.  
  765.     while ( 1 )         /* loops until end-of-file is reached */
  766.         {
  767.         yy_cp = yy_c_buf_p;
  768.  
  769.         /* support of yytext */
  770.         *yy_cp = yy_hold_char;
  771.  
  772.         /* yy_bp points to the position in yy_ch_buf of the start of the
  773.          * current run.
  774.          */
  775.         yy_bp = yy_cp;
  776.  
  777.         yy_current_state = yy_start;
  778.         if ( yy_bp[-1] == '\n' )
  779.             ++yy_current_state;
  780. yy_match:
  781.         do
  782.             {
  783.             register YY_CHAR yy_c = yy_ec[*yy_cp];
  784.             if ( yy_accept[yy_current_state] )
  785.                 {
  786.                 yy_last_accepting_state = yy_current_state;
  787.                 yy_last_accepting_cpos = yy_cp;
  788.                 }
  789.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  790.                 {
  791.                 yy_current_state = yy_def[yy_current_state];
  792.                 if ( yy_current_state >= 535 )
  793.                     yy_c = yy_meta[yy_c];
  794.                 }
  795.             yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  796.             ++yy_cp;
  797.             }
  798.         while ( yy_current_state != 534 );
  799.         yy_cp = yy_last_accepting_cpos;
  800.         yy_current_state = yy_last_accepting_state;
  801.  
  802. yy_find_action:
  803.         yy_act = yy_accept[yy_current_state];
  804.  
  805.         YY_DO_BEFORE_ACTION;
  806.         YY_USER_ACTION;
  807.  
  808. do_action:      /* this label is used only to access EOF actions */
  809.  
  810.  
  811.         switch ( yy_act )
  812.             {
  813.             case 0: /* must backtrack */
  814.             /* undo the effects of YY_DO_BEFORE_ACTION */
  815.             *yy_cp = yy_hold_char;
  816.             yy_cp = yy_last_accepting_cpos;
  817.             yy_current_state = yy_last_accepting_state;
  818.             goto yy_find_action;
  819.  
  820. case 1:
  821. { CPP; BEGIN (INCLUDE); }
  822.         YY_BREAK
  823. case 2:
  824. case 3:
  825. case 4:
  826. case 5:
  827. case 6:
  828. case 7:
  829. case 8:
  830. case 9:
  831. CPP;
  832.         YY_BREAK
  833. case 10:
  834. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  835. yy_c_buf_p = yy_cp -= 1;
  836. YY_DO_BEFORE_ACTION; /* set up yytext again */
  837. { OUT ("$<${\\"); OUT (string_font);
  838.                           OUT ("{}"); SUB (yytext+1); OUT ("}$>$");
  839.                           input(); BEGIN (INITIAL); }
  840.         YY_BREAK
  841. case 11:
  842. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  843. yy_c_buf_p = yy_cp -= 1;
  844. YY_DO_BEFORE_ACTION; /* set up yytext again */
  845. { OUT ("\"{\\"); OUT (string_font);
  846.                           OUT ("{}"); SUB (yytext+1); OUT ("}\"");
  847.                           input(); BEGIN (INITIAL); }
  848.         YY_BREAK
  849. case 12:
  850. ECHO;
  851.         YY_BREAK
  852. case 13:
  853. OUT ("\\mbox{}\\\\\n");
  854.         YY_BREAK
  855. case 14:
  856. { yyless (0); BEGIN (INITIAL); }
  857.         YY_BREAK
  858. case 15:
  859. case 16:
  860. case 17:
  861. case 18:
  862. case 19:
  863. case 20:
  864. case 21:
  865. case 22:
  866. case 23:
  867. case 24:
  868. case 25:
  869. case 26:
  870. case 27:
  871. case 28:
  872. case 29:
  873. case 30:
  874. case 31:
  875. case 32:
  876. case 33:
  877. case 34:
  878. case 35:
  879. case 36:
  880. case 37:
  881. case 38:
  882. case 39:
  883. case 40:
  884. case 41:
  885. case 42:
  886. case 43:
  887. case 44:
  888. case 45:
  889. case 46:
  890. case 47:
  891. case 48:
  892. case 49:
  893. case 50:
  894. case 51:
  895. case 52:
  896. case 53:
  897. case 54:
  898. case 55:
  899. case 56:
  900. case 57:
  901. case 58:
  902. KEY;
  903.         YY_BREAK
  904. case 59:
  905. SYM ("rightarrow");
  906.         YY_BREAK
  907. case 60:
  908. SYM ("ll");
  909.         YY_BREAK
  910. case 61:
  911. SYM ("gg");
  912.         YY_BREAK
  913. case 62:
  914. SYM ("leq");
  915.         YY_BREAK
  916. case 63:
  917. SYM ("geq");
  918.         YY_BREAK
  919. case 64:
  920. SYM ("neq");
  921.         YY_BREAK
  922. case 65:
  923. SYM ("mid\\mid");
  924.         YY_BREAK
  925. case 66:
  926. SYM ("ldots");
  927.         YY_BREAK
  928. case 67:
  929. SYM ("ast=");
  930.         YY_BREAK
  931. case 68:
  932. SYM ("ll=");
  933.         YY_BREAK
  934. case 69:
  935. SYM ("gg=");
  936.         YY_BREAK
  937. case 70:
  938. SYM ("vee=");
  939.         YY_BREAK
  940. case 71:
  941. SYM ("mid=");
  942.         YY_BREAK
  943. case 72:
  944. SYM ("sim");
  945.         YY_BREAK
  946. case 73:
  947. SYM ("ast");
  948.         YY_BREAK
  949. case 74:
  950. SYM ("wedge");
  951.         YY_BREAK
  952. case 75:
  953. SYM ("mid");
  954.         YY_BREAK
  955. case 76:
  956. SYM ("rightarrow\\ast");
  957.         YY_BREAK
  958. case 77:
  959. OUT ("$/$");
  960.         YY_BREAK
  961. case 78:
  962. OUT ("$<$");
  963.         YY_BREAK
  964. case 79:
  965. OUT ("$>$");
  966.         YY_BREAK
  967. case 80:
  968. OUT ("\\&\\&");
  969.         YY_BREAK
  970. case 81:
  971. OUT ("\\%=");
  972.         YY_BREAK
  973. case 82:
  974. OUT ("\\&=");
  975.         YY_BREAK
  976. case 83:
  977. OUT ("\\{");
  978.         YY_BREAK
  979. case 84:
  980. OUT ("\\}");
  981.         YY_BREAK
  982. case 85:
  983. OUT ("\\&");
  984.         YY_BREAK
  985. case 86:
  986. OUT ("\\%");
  987.         YY_BREAK
  988. case 87:
  989. OUT ("-{}-");
  990.         YY_BREAK
  991. case 88:
  992. OUT (".$\\ast$");
  993.         YY_BREAK
  994. case 89:
  995. case 90:
  996. case 91:
  997. case 92:
  998. case 93:
  999. case 94:
  1000. case 95:
  1001. case 96:
  1002. case 97:
  1003. case 98:
  1004. case 99:
  1005. case 100:
  1006. case 101:
  1007. case 102:
  1008. case 103:
  1009. case 104:
  1010. case 105:
  1011. case 106:
  1012. case 107:
  1013. ECHO;
  1014.         YY_BREAK
  1015. case 108:
  1016. case 109:
  1017. SUB (yytext);
  1018.         YY_BREAK
  1019. case 110:
  1020. { BEGIN (BCOMMENT); OUT ("{$/\\ast$\\");
  1021.                                   OUT (comment_font); OUT ("{}"); }
  1022.         YY_BREAK
  1023. case 111:
  1024. { BEGIN (INITIAL); OUT ("$\\ast/$}"); }
  1025.         YY_BREAK
  1026. case 112:
  1027. OUT ("\\mbox{}\\\\\n");
  1028.         YY_BREAK
  1029. case 113:
  1030. IND;
  1031.         YY_BREAK
  1032. case 114:
  1033. SUB (yytext);
  1034.         YY_BREAK
  1035. case 115:
  1036. { BEGIN (STRING); OUT ("{\\");
  1037.                                   OUT (string_font); OUT ("\""); }
  1038.         YY_BREAK
  1039. case 116:
  1040. OUT ("$\\backslash\\backslash$");
  1041.         YY_BREAK
  1042. case 117:
  1043. { OUT ("$\\backslash$"); SUB (yytext+1); }
  1044.         YY_BREAK
  1045. case 118:
  1046. { BEGIN (INITIAL); OUT ("\"}"); }
  1047.         YY_BREAK
  1048. case 119:
  1049. OUT ("\\mbox{}\\\\\n");
  1050.         YY_BREAK
  1051. case 120:
  1052. IND;
  1053.         YY_BREAK
  1054. case 121:
  1055. SUB (yytext);
  1056.         YY_BREAK
  1057. case 122:
  1058. case 123:
  1059. case 124:
  1060. case 125:
  1061. ECHO;
  1062.         YY_BREAK
  1063. case 126:
  1064. ECHO;
  1065.         YY_BREAK
  1066. case 127:
  1067. SUB (yytext);
  1068.         YY_BREAK
  1069. case 128:
  1070. case 129:
  1071. case 130:
  1072. ECHO;
  1073.         YY_BREAK
  1074. case 131:
  1075. ECHO;
  1076.         YY_BREAK
  1077. case 132:
  1078. ECHO;
  1079.         YY_BREAK
  1080. case 133:
  1081. OUT ("$\\backslash$\\\\\n");
  1082.         YY_BREAK
  1083. case 134:
  1084. IND;
  1085.         YY_BREAK
  1086. case 135:
  1087. ECHO;
  1088.         YY_BREAK
  1089. case 136:
  1090. OUT ("\\newpage\n");
  1091.         YY_BREAK
  1092. case 137:
  1093. OUT ("\\mbox{}\\\\\n");
  1094.         YY_BREAK
  1095. case 138:
  1096. ECHO;
  1097.         YY_BREAK
  1098. case YY_STATE_EOF(INITIAL):
  1099. case YY_STATE_EOF(STRING):
  1100. case YY_STATE_EOF(BCOMMENT):
  1101. case YY_STATE_EOF(INCLUDE):
  1102. case YY_STATE_EOF(CPLUSPLUS):
  1103.     yyterminate();
  1104.  
  1105.             case YY_END_OF_BUFFER:
  1106.                 {
  1107.                 /* amount of text matched not including the EOB char */
  1108.                 int yy_amount_of_matched_text = yy_cp - yytext - 1;
  1109.  
  1110.                 /* undo the effects of YY_DO_BEFORE_ACTION */
  1111.                 *yy_cp = yy_hold_char;
  1112.  
  1113.                 /* note that here we test for yy_c_buf_p "<=" to the position
  1114.                  * of the first EOB in the buffer, since yy_c_buf_p will
  1115.                  * already have been incremented past the NUL character
  1116.                  * (since all states make transitions on EOB to the end-
  1117.                  * of-buffer state).  Contrast this with the test in yyinput().
  1118.                  */
  1119.                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1120.                     /* this was really a NUL */
  1121.                     {
  1122.                     yy_state_type yy_next_state;
  1123.  
  1124.                     yy_c_buf_p = yytext + yy_amount_of_matched_text;
  1125.  
  1126.                     yy_current_state = yy_get_previous_state();
  1127.  
  1128.                     /* okay, we're now positioned to make the
  1129.                      * NUL transition.  We couldn't have
  1130.                      * yy_get_previous_state() go ahead and do it
  1131.                      * for us because it doesn't know how to deal
  1132.                      * with the possibility of jamming (and we
  1133.                      * don't want to build jamming into it because
  1134.                      * then it will run more slowly)
  1135.                      */
  1136.  
  1137.                     yy_next_state = yy_try_NUL_trans( yy_current_state );
  1138.  
  1139.                     yy_bp = yytext + YY_MORE_ADJ;
  1140.  
  1141.                     if ( yy_next_state )
  1142.                         {
  1143.                         /* consume the NUL */
  1144.                         yy_cp = ++yy_c_buf_p;
  1145.                         yy_current_state = yy_next_state;
  1146.                         goto yy_match;
  1147.                         }
  1148.  
  1149.                     else
  1150.                         {
  1151.                             yy_cp = yy_last_accepting_cpos;
  1152.                             yy_current_state = yy_last_accepting_state;
  1153.                         goto yy_find_action;
  1154.                         }
  1155.                     }
  1156.  
  1157.                 else switch ( yy_get_next_buffer() )
  1158.                     {
  1159.                     case EOB_ACT_END_OF_FILE:
  1160.                         {
  1161.                         if ( yywrap() )
  1162.                             {
  1163.                             /* note: because we've taken care in
  1164.                              * yy_get_next_buffer() to have set up yytext,
  1165.                              * we can now set up yy_c_buf_p so that if some
  1166.                              * total hoser (like flex itself) wants
  1167.                              * to call the scanner after we return the
  1168.                              * YY_NULL, it'll still work - another YY_NULL
  1169.                              * will get returned.
  1170.                              */
  1171.                             yy_c_buf_p = yytext + YY_MORE_ADJ;
  1172.  
  1173.                             yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  1174.                             goto do_action;
  1175.                             }
  1176.  
  1177.                         else
  1178.                             YY_NEW_FILE;
  1179.                         }
  1180.                         break;
  1181.  
  1182.                     case EOB_ACT_CONTINUE_SCAN:
  1183.                         yy_c_buf_p = yytext + yy_amount_of_matched_text;
  1184.  
  1185.                         yy_current_state = yy_get_previous_state();
  1186.  
  1187.                         yy_cp = yy_c_buf_p;
  1188.                         yy_bp = yytext + YY_MORE_ADJ;
  1189.                         goto yy_match;
  1190.  
  1191.                     case EOB_ACT_LAST_MATCH:
  1192.                         yy_c_buf_p =
  1193.                             &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1194.  
  1195.                         yy_current_state = yy_get_previous_state();
  1196.  
  1197.                         yy_cp = yy_c_buf_p;
  1198.                         yy_bp = yytext + YY_MORE_ADJ;
  1199.                         goto yy_find_action;
  1200.                     }
  1201.                 break;
  1202.                 }
  1203.  
  1204.             default:
  1205. #ifdef FLEX_DEBUG
  1206.                 printf( "action # %d\n", yy_act );
  1207. #endif
  1208.                 YY_FATAL_ERROR(
  1209.                         "fatal flex scanner internal error--no action found" );
  1210.             }
  1211.         }
  1212.     }
  1213.  
  1214.  
  1215. /* yy_get_next_buffer - try to read in a new buffer
  1216.  *
  1217.  * synopsis
  1218.  *     int yy_get_next_buffer();
  1219.  *     
  1220.  * returns a code representing an action
  1221.  *     EOB_ACT_LAST_MATCH - 
  1222.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1223.  *     EOB_ACT_END_OF_FILE - end of file
  1224.  */
  1225.  
  1226. static int yy_get_next_buffer()
  1227.  
  1228.     {
  1229.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  1230.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  1231.     register int number_to_move, i;
  1232.     int ret_val;
  1233.  
  1234.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1235.         YY_FATAL_ERROR(
  1236.                 "fatal flex scanner internal error--end of buffer missed" );
  1237.  
  1238.     /* try to read more data */
  1239.  
  1240.     /* first move last chars to start of buffer */
  1241.     number_to_move = yy_c_buf_p - yytext;
  1242.  
  1243.     for ( i = 0; i < number_to_move; ++i )
  1244.         *(dest++) = *(source++);
  1245.  
  1246.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  1247.         /* don't do the read, it's not guaranteed to return an EOF,
  1248.          * just force an EOF
  1249.          */
  1250.         yy_n_chars = 0;
  1251.  
  1252.     else
  1253.         {
  1254.         int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  1255.  
  1256.         if ( num_to_read > YY_READ_BUF_SIZE )
  1257.             num_to_read = YY_READ_BUF_SIZE;
  1258.  
  1259.         else if ( num_to_read <= 0 )
  1260.             YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  1261.  
  1262.         /* read in more data */
  1263.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1264.                   yy_n_chars, num_to_read );
  1265.         }
  1266.  
  1267.     if ( yy_n_chars == 0 )
  1268.         {
  1269.         if ( number_to_move == 1 )
  1270.             {
  1271.             ret_val = EOB_ACT_END_OF_FILE;
  1272.             yy_current_buffer->yy_eof_status = EOF_DONE;
  1273.             }
  1274.  
  1275.         else
  1276.             {
  1277.             ret_val = EOB_ACT_LAST_MATCH;
  1278.             yy_current_buffer->yy_eof_status = EOF_PENDING;
  1279.             }
  1280.         }
  1281.  
  1282.     else
  1283.         ret_val = EOB_ACT_CONTINUE_SCAN;
  1284.  
  1285.     yy_n_chars += number_to_move;
  1286.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1287.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1288.  
  1289.     /* yytext begins at the second character in yy_ch_buf; the first
  1290.      * character is the one which preceded it before reading in the latest
  1291.      * buffer; it needs to be kept around in case it's a newline, so
  1292.      * yy_get_previous_state() will have with '^' rules active
  1293.      */
  1294.  
  1295.     yytext = &yy_current_buffer->yy_ch_buf[1];
  1296.  
  1297.     return ( ret_val );
  1298.     }
  1299.  
  1300.  
  1301. /* yy_get_previous_state - get the state just before the EOB char was reached
  1302.  *
  1303.  * synopsis
  1304.  *     yy_state_type yy_get_previous_state();
  1305.  */
  1306.  
  1307. static yy_state_type yy_get_previous_state()
  1308.  
  1309.     {
  1310.     register yy_state_type yy_current_state;
  1311.     register YY_CHAR *yy_cp;
  1312.  
  1313.     register YY_CHAR *yy_bp = yytext;
  1314.  
  1315.     yy_current_state = yy_start;
  1316.     if ( yy_bp[-1] == '\n' )
  1317.         ++yy_current_state;
  1318.  
  1319.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1320.         {
  1321.         register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  1322.         if ( yy_accept[yy_current_state] )
  1323.             {
  1324.             yy_last_accepting_state = yy_current_state;
  1325.             yy_last_accepting_cpos = yy_cp;
  1326.             }
  1327.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1328.             {
  1329.             yy_current_state = yy_def[yy_current_state];
  1330.             if ( yy_current_state >= 535 )
  1331.                 yy_c = yy_meta[yy_c];
  1332.             }
  1333.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1334.         }
  1335.  
  1336.     return ( yy_current_state );
  1337.     }
  1338.  
  1339.  
  1340. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1341.  *
  1342.  * synopsis
  1343.  *     next_state = yy_try_NUL_trans( current_state );
  1344.  */
  1345.  
  1346. #ifdef YY_USE_PROTOS
  1347. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  1348. #else
  1349. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1350. register yy_state_type yy_current_state;
  1351. #endif
  1352.  
  1353.     {
  1354.     register int yy_is_jam;
  1355.     register YY_CHAR *yy_cp = yy_c_buf_p;
  1356.  
  1357.     register YY_CHAR yy_c = 1;
  1358.     if ( yy_accept[yy_current_state] )
  1359.         {
  1360.         yy_last_accepting_state = yy_current_state;
  1361.         yy_last_accepting_cpos = yy_cp;
  1362.         }
  1363.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1364.         {
  1365.         yy_current_state = yy_def[yy_current_state];
  1366.         if ( yy_current_state >= 535 )
  1367.             yy_c = yy_meta[yy_c];
  1368.         }
  1369.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1370.     yy_is_jam = (yy_current_state == 534);
  1371.  
  1372.     return ( yy_is_jam ? 0 : yy_current_state );
  1373.     }
  1374.  
  1375.  
  1376. #ifdef YY_USE_PROTOS
  1377. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  1378. #else
  1379. static void yyunput( c, yy_bp )
  1380. YY_CHAR c;
  1381. register YY_CHAR *yy_bp;
  1382. #endif
  1383.  
  1384.     {
  1385.     register YY_CHAR *yy_cp = yy_c_buf_p;
  1386.  
  1387.     /* undo effects of setting up yytext */
  1388.     *yy_cp = yy_hold_char;
  1389.  
  1390.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1391.         { /* need to shift things up to make room */
  1392.         register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  1393.         register YY_CHAR *dest =
  1394.             &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  1395.         register YY_CHAR *source =
  1396.             &yy_current_buffer->yy_ch_buf[number_to_move];
  1397.  
  1398.         while ( source > yy_current_buffer->yy_ch_buf )
  1399.             *--dest = *--source;
  1400.  
  1401.         yy_cp += dest - source;
  1402.         yy_bp += dest - source;
  1403.         yy_n_chars = yy_current_buffer->yy_buf_size;
  1404.  
  1405.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1406.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1407.         }
  1408.  
  1409.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  1410.         yy_cp[-2] = '\n';
  1411.  
  1412.     *--yy_cp = c;
  1413.  
  1414.     /* note: the formal parameter *must* be called "yy_bp" for this
  1415.      *       macro to now work correctly
  1416.      */
  1417.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  1418.     }
  1419.  
  1420.  
  1421. #ifdef __cplusplus
  1422. static int yyinput()
  1423. #else
  1424. static int input()
  1425. #endif
  1426.  
  1427.     {
  1428.     int c;
  1429.     YY_CHAR *yy_cp = yy_c_buf_p;
  1430.  
  1431.     *yy_cp = yy_hold_char;
  1432.  
  1433.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1434.         {
  1435.         /* yy_c_buf_p now points to the character we want to return.
  1436.          * If this occurs *before* the EOB characters, then it's a
  1437.          * valid NUL; if not, then we've hit the end of the buffer.
  1438.          */
  1439.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1440.             /* this was really a NUL */
  1441.             *yy_c_buf_p = '\0';
  1442.  
  1443.         else
  1444.             { /* need more input */
  1445.             yytext = yy_c_buf_p;
  1446.             ++yy_c_buf_p;
  1447.  
  1448.             switch ( yy_get_next_buffer() )
  1449.                 {
  1450.                 case EOB_ACT_END_OF_FILE:
  1451.                     {
  1452.                     if ( yywrap() )
  1453.                         {
  1454.                         yy_c_buf_p = yytext + YY_MORE_ADJ;
  1455.                         return ( EOF );
  1456.                         }
  1457.  
  1458.                     YY_NEW_FILE;
  1459.  
  1460. #ifdef __cplusplus
  1461.                     return ( yyinput() );
  1462. #else
  1463.                     return ( input() );
  1464. #endif
  1465.                     }
  1466.                     break;
  1467.  
  1468.                 case EOB_ACT_CONTINUE_SCAN:
  1469.                     yy_c_buf_p = yytext + YY_MORE_ADJ;
  1470.                     break;
  1471.  
  1472.                 case EOB_ACT_LAST_MATCH:
  1473. #ifdef __cplusplus
  1474.                     YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  1475. #else
  1476.                     YY_FATAL_ERROR( "unexpected last match in input()" );
  1477. #endif
  1478.                 }
  1479.             }
  1480.         }
  1481.  
  1482.     c = *yy_c_buf_p;
  1483.     yy_hold_char = *++yy_c_buf_p;
  1484.  
  1485.     return ( c );
  1486.     }
  1487.  
  1488.  
  1489. #ifdef YY_USE_PROTOS
  1490. void yyrestart( FILE *input_file )
  1491. #else
  1492. void yyrestart( input_file )
  1493. FILE *input_file;
  1494. #endif
  1495.  
  1496.     {
  1497.     yy_init_buffer( yy_current_buffer, input_file );
  1498.     yy_load_buffer_state();
  1499.     }
  1500.  
  1501.  
  1502. #ifdef YY_USE_PROTOS
  1503. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1504. #else
  1505. void yy_switch_to_buffer( new_buffer )
  1506. YY_BUFFER_STATE new_buffer;
  1507. #endif
  1508.  
  1509.     {
  1510.     if ( yy_current_buffer == new_buffer )
  1511.         return;
  1512.  
  1513.     if ( yy_current_buffer )
  1514.         {
  1515.         /* flush out information for old buffer */
  1516.         *yy_c_buf_p = yy_hold_char;
  1517.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1518.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1519.         }
  1520.  
  1521.     yy_current_buffer = new_buffer;
  1522.     yy_load_buffer_state();
  1523.     }
  1524.  
  1525.  
  1526. #ifdef YY_USE_PROTOS
  1527. void yy_load_buffer_state( void )
  1528. #else
  1529. void yy_load_buffer_state()
  1530. #endif
  1531.  
  1532.     {
  1533.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1534.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1535.     yyin = yy_current_buffer->yy_input_file;
  1536.     yy_hold_char = *yy_c_buf_p;
  1537.     }
  1538.  
  1539.  
  1540. #ifdef YY_USE_PROTOS
  1541. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1542. #else
  1543. YY_BUFFER_STATE yy_create_buffer( file, size )
  1544. FILE *file;
  1545. int size;
  1546. #endif
  1547.  
  1548.     {
  1549.     YY_BUFFER_STATE b;
  1550.  
  1551.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  1552.  
  1553.     if ( ! b )
  1554.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1555.  
  1556.     b->yy_buf_size = size;
  1557.  
  1558.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1559.      * we need to put in 2 end-of-buffer characters.
  1560.      */
  1561.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1562.  
  1563.     if ( ! b->yy_ch_buf )
  1564.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1565.  
  1566.     yy_init_buffer( b, file );
  1567.  
  1568.     return ( b );
  1569.     }
  1570.  
  1571.  
  1572. #ifdef YY_USE_PROTOS
  1573. void yy_delete_buffer( YY_BUFFER_STATE b )
  1574. #else
  1575. void yy_delete_buffer( b )
  1576. YY_BUFFER_STATE b;
  1577. #endif
  1578.  
  1579.     {
  1580.     if ( b == yy_current_buffer )
  1581.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  1582.  
  1583.     free( (char *) b->yy_ch_buf );
  1584.     free( (char *) b );
  1585.     }
  1586.  
  1587.  
  1588. #ifdef YY_USE_PROTOS
  1589. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1590. #else
  1591. void yy_init_buffer( b, file )
  1592. YY_BUFFER_STATE b;
  1593. FILE *file;
  1594. #endif
  1595.  
  1596.     {
  1597.     b->yy_input_file = file;
  1598.  
  1599.     /* we put in the '\n' and start reading from [1] so that an
  1600.      * initial match-at-newline will be true.
  1601.      */
  1602.  
  1603.     b->yy_ch_buf[0] = '\n';
  1604.     b->yy_n_chars = 1;
  1605.  
  1606.     /* we always need two end-of-buffer characters.  The first causes
  1607.      * a transition to the end-of-buffer state.  The second causes
  1608.      * a jam in that state.
  1609.      */
  1610.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1611.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1612.  
  1613.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1614.  
  1615.     b->yy_eof_status = EOF_NOT_SEEN;
  1616.     }
  1617.  
  1618.  
  1619. void substitute (const char * input)
  1620. {
  1621.   while (*input)
  1622.     {
  1623.       switch (*input)
  1624.         {
  1625.         case '_':
  1626.         case '&':
  1627.         case '#':
  1628.         case '$':
  1629.         case '%':
  1630.         case '{':
  1631.         case '}':
  1632.           printf ("\\%c", *input);
  1633.           break;
  1634.         case '+':
  1635.         case '=':
  1636.         case '<':
  1637.         case '>':
  1638.           printf ("$%c$", *input);
  1639.           break;
  1640.         case '*':
  1641.           printf ("$\\ast$");
  1642.           break;
  1643.         case '|':
  1644.           printf ("$\\mid$");
  1645.           break;
  1646.         case '\\':
  1647.           printf ("$\\backslash$");
  1648.           break;
  1649.         case '^':
  1650.           printf ("$\\wedge$");
  1651.           break;
  1652.         case '~':
  1653.           printf ("$\\sim$");
  1654.           break;
  1655.         default:
  1656.           printf ("%c", *input);
  1657.           break;
  1658.         }
  1659.       input++;
  1660.     }
  1661. }
  1662.  
  1663. void
  1664. indent(const char * blanks)
  1665. {
  1666.   int i;
  1667.   
  1668.   i = 0;
  1669.   while (*blanks)
  1670.     {
  1671.       if (*blanks == ' ')
  1672.         {
  1673.           i++;
  1674.         }
  1675.       else                      /* *blanks == '\t' */
  1676.         {
  1677.           while (++i % tabtotab) ;
  1678.         }
  1679.       blanks++;
  1680.     }
  1681.   printf ("\\hspace*{%d\\indentation}", i);
  1682. }
  1683.  
  1684. #include "getopt.h"
  1685. #include <string.h>
  1686. #include <fcntl.h>
  1687. #ifndef ATARI
  1688. #include <malloc.h>      /* Not needed for GCC on Atari ST (14-2-92 AB) */
  1689. #endif
  1690.  
  1691. extern char * version_string;
  1692.  
  1693. static struct option opts[] =
  1694. {
  1695.   {"ansi-c", 0, 0, 'a'},
  1696.   {"c-plusplus", 0, 0, 'p'},
  1697.   {"complete-file", 0, 0, 'c'},
  1698.   {"font-size", 1, 0, 's'},
  1699.   {"indentation", 1, 0, 'i'},
  1700.   {"header", 0, 0, 'h'},
  1701.   {"piped", 0, 0, 't'},
  1702.   {"output", 1, 0, 'o'},
  1703.   {"tabstop", 1, 0, 'T'},
  1704.   {"comment-font", 1, 0, 'C'},
  1705.   {"string-font", 1, 0, 'S'},
  1706.   {"keyword-font", 1, 0, 'K'},
  1707.   {"header-font", 1, 0, 'H'},
  1708.   {"cpp-font", 1, 0, 'P'},
  1709.   {"version", 0, 0, 'V'},
  1710.   {0, 0, 0, 0}
  1711. };
  1712.  
  1713.  
  1714. main (int argc, char** argv)
  1715. {
  1716.   int c;
  1717.   int index;
  1718.   int i;
  1719.   int has_filename;
  1720.   char * input_name;
  1721.   char * output_name;
  1722.   char * program_name;
  1723.  
  1724.   input_name = "Standard Input";
  1725.   output_name = 0;
  1726.  
  1727.   program_name = strrchr (argv[0], '/');
  1728.   if (program_name == NULL)     /* no pathname */
  1729.     {
  1730.       program_name = argv[0];
  1731.     }
  1732.   else
  1733.     {
  1734.       program_name++;
  1735.     }
  1736.   
  1737.   
  1738.   while ((c = getopt_long (argc, argv,
  1739.                            "acpo:s:i:thT:C:H:S:K:P:V", opts, &index))
  1740.          != EOF)
  1741.     {
  1742.       if (c == 0)               /* Long option */
  1743.         {
  1744.           c = opts[index].val;
  1745.         }
  1746.       switch (c)
  1747.         {
  1748.         case 'a':
  1749.           cplusplus_mode = 0;
  1750.           break;
  1751.         case 'p':
  1752.           cplusplus_mode = 1;
  1753.           break;
  1754.         case 'c':
  1755.           complete_file = 1;
  1756.           break;
  1757.         case 'o':
  1758.           if (piped)
  1759.             {
  1760.               fprintf (stderr,
  1761.                        "%s: Can't use {-t,+pipe} and {-o,+output} together\n",
  1762.                        program_name);
  1763.               exit(5);
  1764.             }
  1765.           output_name = optarg;
  1766.           break;
  1767.         case 's':
  1768.           font_size = optarg;
  1769.           break;
  1770.         case 'i':
  1771.           indentation = optarg;
  1772.           break;
  1773.         case 'T':
  1774.           tabtotab = atoi(optarg);
  1775.           break;
  1776.             case 't':
  1777.               if (output_name != 0)
  1778.             {
  1779.               fprintf (stderr,
  1780.                        "%s: Can't use {-t,+pipe} and {-o,+output} together\n",
  1781.                        program_name);
  1782.               exit(5);
  1783.             }
  1784.           piped = 1;
  1785.           break;
  1786.         case 'h':
  1787.           header = 1;
  1788.           complete_file = 1;    /* header implies complete-file */
  1789.           break;
  1790.         case 'C':
  1791.           comment_font = optarg;
  1792.           break;
  1793.         case 'H':
  1794.           header_font = optarg;
  1795.           break;
  1796.         case 'P':
  1797.           cpp_font = optarg;
  1798.           break;
  1799.         case 'S':
  1800.           string_font = optarg;
  1801.           break;
  1802.         case 'K':
  1803.           keyword_font = optarg;
  1804.           break;
  1805.         case 'V':
  1806.           fprintf (stderr, "%s\n", version_string);
  1807.           break;
  1808.         default:
  1809.           usage(program_name);
  1810.         }
  1811.     }
  1812.   has_filename = (argc - optind == 1);
  1813.   if (has_filename)             /* last argument is input file name */
  1814.     {
  1815.       input_name = argv[optind];
  1816.       if (freopen (input_name, "r", stdin) == NULL)
  1817.         {
  1818.           fprintf (stderr, "%s: Can't open `%s' for reading\n",
  1819.                    program_name, input_name);
  1820.           exit (2);
  1821.         }
  1822.     }
  1823.   if ((output_name == 0) && !piped)
  1824.     {
  1825.       char * tmp;
  1826.       if (has_filename)
  1827.         {
  1828.           char * point;
  1829.           
  1830.           point = strrchr (input_name, '/');
  1831.           if (point == 0)       /* plain filename */
  1832.             {
  1833.               point = input_name;
  1834.             }
  1835.           else
  1836.             {
  1837.               point++;
  1838.             }
  1839.           tmp = malloc (strlen (point) + 1);
  1840.           if (tmp == 0)
  1841.             {
  1842.               fprintf (stderr, "%s: Virtual memory exhausted\n", program_name);
  1843.               exit (3);
  1844.             }
  1845.           strcpy (tmp, point);
  1846.           point = strrchr (tmp, '.');
  1847.           if (point != 0)
  1848.             {
  1849.               *point = '\0';
  1850.             }
  1851.         }
  1852.       else
  1853.         {
  1854.           tmp = program_name;
  1855.         }
  1856.       output_name = malloc (strlen (tmp) + 4);
  1857.       if (output_name == 0)
  1858.         {
  1859.           fprintf (stderr, "%s: Virtual memory exhausted\n", program_name);
  1860.           exit (3);
  1861.         }
  1862.       strcpy (output_name, tmp);
  1863.       strcat (output_name, ".tex");
  1864.     }
  1865.   if (!piped)
  1866.     {
  1867.       if (freopen (output_name, "w", stdout) == NULL)
  1868.         {
  1869.           fprintf (stderr, "%s: Can't open `%s' for writing\n",
  1870.                    program_name, output_name);
  1871.           exit (4);
  1872.         }
  1873.     }
  1874.   printf ("\
  1875. %%\n\
  1876. %% This file was automatically produced at " __DATE__ ", " __TIME__" by\n\
  1877. %% %s", program_name);
  1878.   for (i = 1; i < argc; i++)
  1879.     {
  1880.       printf(" %s", argv[i]);
  1881.     }
  1882.   if (!has_filename)
  1883.     {
  1884.       printf(" (from Standard Input)");
  1885.     }
  1886.   printf("\n%%\n");
  1887.   if (complete_file)
  1888.     {
  1889.       if (header)
  1890.         {
  1891.           if (strcmp (font_size, "10") == 0)
  1892.             {
  1893.               printf ("\\documentstyle[fancyheadings]{article}\n");
  1894.             }
  1895.           else
  1896.             {
  1897.               printf ("\\documentstyle[%spt,fancyheadings]{article}\n",
  1898.                       font_size);
  1899.             }
  1900.         }
  1901.       else
  1902.         {
  1903.           if (strcmp (font_size, "10") == 0)
  1904.             {
  1905.               printf ("\\documentstyle{article}\n");
  1906.             }
  1907.           else
  1908.             {
  1909.               printf ("\\documentstyle[%spt]{article}\n", font_size);
  1910.             }
  1911.         }
  1912.       printf ("\\setlength{\\textwidth}{15cm}\n");
  1913.       printf ("\\setlength{\\textheight}{22.5cm}\n");
  1914.       printf ("\\setlength{\\hoffset}{-2cm}\n");
  1915.       printf ("\\setlength{\\voffset}{-2cm}\n");
  1916.       if (header)
  1917.         {
  1918.           printf ("\\chead{\\%s Produced from ", header_font);
  1919.           substitute(input_name);
  1920.           printf (" at " __DATE__ ", " __TIME__"}\n");
  1921.           printf ("\\cfoot{\\rm\\thepage}\n");
  1922.           printf ("\\addtolength{\\headheight}{14pt}\n");
  1923.           printf ("\\pagestyle{fancy}\n");
  1924.         }
  1925.       printf ("\\begin{document}\n");
  1926.     }
  1927.   printf ("\\expandafter\\ifx\\csname indentation\\endcsname\\relax%\n");
  1928.   printf ("\\newlength{\\indentation}\\fi\n");
  1929.   printf ("\\setlength{\\indentation}{%s}\n", indentation);
  1930.   printf ("\\begin{flushleft}\n");
  1931.   yylex();
  1932.   printf ("\\end{flushleft}\n");
  1933.   if (complete_file)
  1934.     {
  1935.       printf ("\\end{document}\n");
  1936.     }
  1937. }
  1938.  
  1939. void
  1940. usage(const char * name)
  1941. {
  1942.   fprintf (stderr, "%s\n", version_string);
  1943.   fprintf (stderr, "\
  1944. Usage: %s [-a] [-c] [-h] [-i length] [-o path] [-p] [-s size] [-t]\n\
  1945.        [-C font][-H font] [-K font] [-P font] [-S font] [-T wide] [-V]\n\
  1946.        [+ansi-c] [+complete-file] [+header] [+indentation length]\n\
  1947.        [+output path] [+c-plusplus] [+font-size size] [+pipe]\n\
  1948.        [+comment-font font] [+keyword-font font] [+cpp-font font]\n\
  1949.        [+header-font font] [+string-font font] [+tabstop wide]\n\
  1950.        [+version] [path]\n", name);
  1951.   exit (1);
  1952. }
  1953.