home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 329_01 / st_lexyy.c < prev    next >
C/C++ Source or Header  |  1990-11-29  |  32KB  |  1,080 lines

  1. #define FLEX_COMPRESSED
  2. /* A lexical scanner generated by flex */
  3.  
  4. /* scanner skeleton version:
  5.  * $Header: flex.skl,v 2.0.0.1 89/07/30 23:20:47 pcd Exp Locker: pcd $
  6.  */
  7.  
  8. #include <stdio.h>
  9.  
  10. #define FLEX_SCANNER
  11.  
  12. /* define PROTOTYPES */
  13. #if 0
  14. #ifdef __STDC__
  15. #ifndef MWC /* Mark Williams thinks it's __STDC__, how strange
  16.         --HdeF
  17.         */
  18. #define PROTOTYPES
  19. #endif
  20. #endif
  21. #endif
  22.  
  23. /* amount of stuff to slurp up with each read */
  24. #ifndef YY_READ_BUF_SIZE
  25. #define YY_READ_BUF_SIZE 8192
  26. #endif
  27.  
  28. #ifndef YY_BUF_SIZE
  29. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of input buffer */
  30. #endif
  31.  
  32. /* returned upon end-of-file */
  33. #define YY_END_TOK 0
  34.  
  35. /* copy whatever the last rule matched to the standard output */
  36.  
  37. #define ECHO fputs( yytext, yyout )
  38.  
  39. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  40.  * is returned in "result".
  41.  */
  42. #define YY_INPUT(buf,result,max_size) \
  43.     if ( (result = read( fileno(yyin), buf, max_size )) < 0 ) \
  44.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  45. #define YY_NULL 0
  46. #define yyterminate() return ( YY_NULL )
  47.  
  48. /* report a fatal error */
  49. #define YY_FATAL_ERROR(msg) \
  50.     { \
  51.     fputs( msg, stderr ); \
  52.     putc( '\n', stderr ); \
  53.     exit( 1 ); \
  54.     }
  55.  
  56. /* default yywrap function - always treat EOF as an EOF */
  57. #define yywrap() 1
  58.  
  59. /* enter a start condition.  This macro really ought to take a parameter,
  60.  * but we do it the disgusting crufty way forced on us by the ()-less
  61.  * definition of BEGIN
  62.  */
  63. #define BEGIN yy_start = 1 + 2 *
  64.  
  65. /* action number for EOF rule of a given start state */
  66. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  67.  
  68. /* special action meaning "start processing a new file" */
  69. #define YY_NEW_FILE goto new_file
  70.  
  71. /* default declaration of generated scanner - a define so the user can
  72.  * easily add parameters
  73.  */
  74.  
  75. #ifdef PROTOTYPES
  76. #define YY_DECL int yylex(/* void */ )/*Mark Williams thinks it's standard!! */
  77. #else
  78. #define YY_DECL int yylex()
  79. #endif
  80.  
  81. /* code executed at the end of each rule */
  82. #define YY_BREAK break;
  83.  
  84. #define YY_END_OF_BUFFER_CHAR 0
  85.  
  86. /* done after the current pattern has been matched and before the
  87.  * corresponding action - sets up yytext
  88.  */
  89. #define YY_DO_BEFORE_ACTION \
  90.     yytext = yy_bp; \
  91.     yy_hold_char = *yy_cp; \
  92.     *yy_cp = '\0'; \
  93.     yy_c_buf_p = yy_cp;
  94.  
  95. /* returns the length of the matched text */
  96. #define yyleng (yy_cp - yy_bp)
  97.  
  98. #define EOB_ACT_RESTART_SCAN 0
  99. #define EOB_ACT_END_OF_FILE 1
  100. #define EOB_ACT_LAST_MATCH 2
  101.  
  102. /* return all but the first 'n' matched characters back to the input stream */
  103. #define yyless(n) \
  104.     { \
  105.     *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
  106.     yy_c_buf_p = yy_cp = yy_bp + n; \
  107.     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  108.     }
  109.  
  110. #define unput(c) yyunput( c, yy_bp )
  111.  
  112. #define YY_USER_ACTION
  113.  
  114. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  115. char *yytext;
  116.  
  117. #ifndef PROTOTYPES
  118. #define const
  119. #endif
  120.  
  121. #define INITIAL 0
  122. /* csubst.l */
  123. /* lex source of csubst utility.
  124. This programme is shareware.
  125. If you found this programme useful then send me a colourful postcard
  126. with the words "Happy Birthday" (or equivalent) so that it arrives
  127. at my address around the first of January 1991.
  128.  
  129. Henri de Feraudy
  130. 27 rue Chef de Ville
  131. 92140 Clamart 
  132. France
  133. */
  134. extern int  Mode, Truncation;
  135. extern char *lookup_subst();
  136. #include <stdio.h>
  137. #include "csubst.h"
  138. #define cond_putchar(C) if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)putchar(C);
  139.  
  140. #ifdef yywrap
  141. #undef yywrap
  142. #define yywrap() (!next_yyin())
  143. #endif
  144.  
  145. void action_keyword(), default_action(), action_symbol(), read_comment();
  146. #define CPP_MACRO 1
  147. #define YY_END_OF_BUFFER 46
  148. typedef int yy_state_type;
  149. static const short int yy_accept[337] =
  150.     {   0,
  151.         0,    0,    0,    0,   46,   44,   42,   44,   44,   44,
  152.        44,   44,   41,   41,   41,   41,   41,   41,   41,   41,
  153.        41,   41,   41,   41,   41,   41,   41,   41,   40,   40,
  154.        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  155.        40,   40,   40,   40,    0,   38,    0,    0,    5,    5,
  156.         5,    0,    0,    1,    0,   41,   41,   41,   41,   41,
  157.        41,   41,   13,   41,   41,   41,   41,   41,   41,   21,
  158.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  159.        41,   40,   40,   40,   40,   40,   40,   40,   13,   40,
  160.        40,   40,   40,   40,   40,   21,   40,   40,   40,   40,
  161.  
  162.        40,   40,   40,   40,   40,   40,   40,    5,    5,    5,
  163.         5,   39,   43,   41,   41,   41,   41,   41,   41,   41,
  164.        41,   41,   41,   41,   19,   41,   22,   41,   41,   41,
  165.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  166.        41,   41,   40,   40,   40,   40,   40,   40,   40,   40,
  167.        40,   40,   40,   19,   40,   22,   40,   40,   40,   40,
  168.        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  169.        40,    5,    5,    5,    5,    6,   41,    8,    9,   41,
  170.        41,   41,   41,   15,   16,   41,   41,   20,   23,   41,
  171.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  172.  
  173.        35,   41,   41,    6,   40,    8,    9,   40,   40,   40,
  174.        40,   15,   16,   40,   40,   20,   23,   40,   40,   40,
  175.        40,   40,   40,   40,   40,   40,   40,   40,   35,   40,
  176.        40,    5,    5,    5,    5,    7,   10,   41,   41,   41,
  177.        41,   18,   41,   41,   26,   41,   41,   41,   41,   41,
  178.        41,   33,   41,   41,   37,    7,   10,   40,   40,   40,
  179.        40,   18,   40,   40,   26,   40,   40,   40,   40,   40,
  180.        40,   33,   40,   40,   37,    5,    3,    5,    5,   41,
  181.        41,   14,   17,   41,   25,   27,   28,   29,   30,   31,
  182.        41,   41,   41,   40,   40,   14,   17,   40,   25,   27,
  183.  
  184.        28,   29,   30,   31,   40,   40,   40,    4,    5,   41,
  185.        12,   41,   32,   41,   41,   40,   12,   40,   32,   40,
  186.        40,    4,    5,   11,   24,   34,   36,   11,   24,   34,
  187.        36,    0,    0,    0,    2,    0
  188.     } ;
  189.  
  190. static const char yy_ec[128] =
  191.     {   0,
  192.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  193.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  194.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  195.         1,    2,    1,    4,    5,    1,    1,    1,    6,    1,
  196.         1,    7,    1,    1,    1,    8,    9,   10,   11,   11,
  197.        11,   11,   11,   11,   11,   11,   11,    1,    1,   12,
  198.         1,   13,    1,    1,   14,   14,   14,   14,   14,   14,
  199.        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
  200.        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
  201.         1,   16,    1,    1,   17,    1,   18,   19,   20,   21,
  202.  
  203.        22,   23,   24,   25,   26,   15,   27,   28,   29,   30,
  204.        31,   32,   15,   33,   34,   35,   36,   37,   38,   39,
  205.        40,   41,    1,    1,    1,    1,    1
  206.     } ;
  207.  
  208. static const char yy_meta[42] =
  209.     {   0,
  210.         1,    2,    1,    1,    1,    3,    1,    4,    4,    5,
  211.         5,    1,    1,    6,    7,    4,    8,    6,    6,    6,
  212.         6,    6,    6,    7,    7,    7,    7,    7,    7,    7,
  213.         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
  214.         7
  215.     } ;
  216.  
  217. static const short int yy_base[345] =
  218.     {   0,
  219.         0,    0,   41,    0,  415,  416,  416,   79,   82,  398,
  220.       406,  373,    0,  375,  377,   67,   65,   58,   62,  378,
  221.        71,  377,  385,   74,  366,  375,  373,  378,    0,  366,
  222.       368,   86,   83,   85,   79,  369,   93,  368,  376,   93,
  223.       357,  366,  364,  369,  116,  416,  390,  100,    0,  370,
  224.        99,  119,  124,  416,    0,    0,  356,  368,  355,  370,
  225.       357,  363,  349,  350,  347,  347,  350,  347,  344,    0,
  226.       343,  347,  109,  345,   65,  116,  349,  342,  111,  110,
  227.       347,    0,  337,  349,  336,  351,  338,  344,  330,  331,
  228.       328,  328,  331,  328,  325,    0,  324,  328,  115,  326,
  229.  
  230.       116,  123,  330,  323,  117,  120,  328,    0,  330,  131,
  231.       332,  416,  416,  320,  332,  327,  315,  119,  329,  327,
  232.       323,  315,  321,  324,    0,  310,    0,  316,  313,  302,
  233.       304,  306,  313,  299,  297,  297,  309,  299,  303,  307,
  234.       309,  298,  294,  306,  301,  289,  124,  303,  301,  297,
  235.       289,  295,  298,    0,  284,    0,  290,  287,  276,  278,
  236.       280,  287,  273,  271,  271,  283,  273,  277,  281,  283,
  237.       272,  273,  276,  276,  268,    0,  268,    0,    0,  259,
  238.       267,  256,  263,    0,    0,  257,  254,    0,    0,  254,
  239.       254,  251,  263,  253,  257,  262,  261,  259,  249,  254,
  240.  
  241.         0,  242,  254,    0,  248,    0,    0,  239,  247,  236,
  242.       243,    0,    0,  237,  234,    0,    0,  234,  234,  231,
  243.       243,  233,  237,  242,  241,  239,  229,  234,    0,  222,
  244.       234,  225,  231,  231,  216,    0,    0,  221,  222,  227,
  245.       218,    0,  212,  216,    0,  224,  221,  223,  207,  216,
  246.       218,    0,  209,  212,    0,    0,    0,  207,  208,  213,
  247.       204,    0,  198,  202,    0,  210,  207,  209,  193,  202,
  248.       204,    0,  195,  198,    0,  201,    0,  199,  200,  184,
  249.       184,    0,    0,  196,    0,    0,    0,    0,    0,    0,
  250.       194,  194,  187,  178,  178,    0,    0,  190,    0,    0,
  251.  
  252.         0,    0,    0,    0,  188,  165,  154,  179,  158,  147,
  253.         0,  135,    0,  146,  144,  142,    0,  130,    0,  141,
  254.       125,  140,  153,    0,    0,    0,    0,    0,    0,    0,
  255.         0,  158,    0,   78,  416,  416,  170,  177,  184,  188,
  256.       192,  196,  200,  203
  257.     } ;
  258.  
  259. static const short int yy_def[345] =
  260.     {   0,
  261.       336,    1,  336,    3,  336,  336,  336,  337,  338,  339,
  262.       336,  336,  340,  340,  340,  340,  340,  340,  340,  340,
  263.       340,  340,  340,  340,  340,  340,  340,  340,  341,  341,
  264.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  265.       341,  341,  341,  341,  337,  336,  337,  338,  342,  342,
  266.       342,  339,  339,  336,  343,  340,  340,  340,  340,  340,
  267.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  268.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  269.       340,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  270.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  271.  
  272.       341,  341,  341,  341,  341,  341,  341,  342,  342,  342,
  273.       342,  336,  336,  340,  340,  340,  340,  340,  340,  340,
  274.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  275.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  276.       340,  340,  341,  341,  341,  341,  341,  341,  341,  341,
  277.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  278.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  279.       341,  342,  342,  342,  342,  340,  340,  340,  340,  340,
  280.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  281.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  282.  
  283.       340,  340,  340,  341,  341,  341,  341,  341,  341,  341,
  284.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  285.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  286.       341,  342,  342,  342,  342,  340,  340,  340,  340,  340,
  287.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  288.       340,  340,  340,  340,  340,  341,  341,  341,  341,  341,
  289.       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
  290.       341,  341,  341,  341,  341,  342,  342,  342,  342,  340,
  291.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  292.       340,  340,  340,  341,  341,  341,  341,  341,  341,  341,
  293.  
  294.       341,  341,  341,  341,  341,  341,  341,  342,  342,  340,
  295.       340,  340,  340,  340,  340,  341,  341,  341,  341,  341,
  296.       341,  336,  342,  340,  340,  340,  340,  341,  341,  341,
  297.       341,  336,  344,  344,  336,    0,  336,  336,  336,  336,
  298.       336,  336,  336,  336
  299.     } ;
  300.  
  301. static const short int yy_nxt[458] =
  302.     {   0,
  303.         6,    6,    7,    8,    9,   10,    6,    6,   11,   12,
  304.         6,    6,    6,   13,   13,    6,    6,   14,   15,   16,
  305.        17,   18,   19,   20,   13,   21,   13,   22,   13,   13,
  306.        13,   13,   23,   24,   25,   26,   27,   28,   13,   13,
  307.        13,    6,    6,    7,    8,    9,   10,    6,    6,   11,
  308.        12,    6,    6,    6,   29,   29,    6,    6,   30,   31,
  309.        32,   33,   34,   35,   36,   29,   37,   29,   38,   29,
  310.        29,   29,   29,   39,   40,   41,   42,   43,   44,   29,
  311.        29,   29,   46,   48,   59,   64,   62,   65,  132,   67,
  312.       335,   60,   68,   70,   47,   63,   66,   61,   74,   75,
  313.  
  314.        71,   48,   50,   85,   88,  133,   93,   51,   76,   94,
  315.        86,   77,   90,   89,   91,   96,   87,  100,  101,   46,
  316.        50,  110,   97,   92,  112,   51,  336,  102,  111,   52,
  317.       103,   47,  129,  134,   53,  140,  138,  141,  158,  161,
  318.       163,  322,  167,  130,  139,  169,  331,  170,  135,  159,
  319.       168,  173,  180,  181,  332,  164,  162,  208,  209,  332,
  320.       174,  330,  329,  328,  333,  327,  326,  325,  324,  333,
  321.        45,   45,   45,   45,   45,   45,   45,   45,   49,  323,
  322.       322,  321,   49,   49,   52,   52,  320,   52,   52,   52,
  323.        52,   52,   56,   56,   56,   56,   82,   82,   82,   82,
  324.  
  325.       108,  108,  108,  108,  113,  113,  334,  334,  334,  334,
  326.       319,  318,  317,  316,  315,  314,  313,  312,  311,  310,
  327.       309,  277,  308,  307,  306,  305,  304,  303,  302,  301,
  328.       300,  299,  298,  297,  296,  295,  294,  293,  292,  291,
  329.       290,  289,  288,  287,  286,  285,  284,  283,  282,  281,
  330.       280,  279,  278,  277,  276,  275,  274,  273,  272,  271,
  331.       270,  269,  268,  267,  266,  265,  264,  263,  262,  261,
  332.       260,  259,  258,  257,  256,  255,  254,  253,  252,  251,
  333.       250,  249,  248,  247,  246,  245,  244,  243,  242,  241,
  334.       240,  239,  238,  237,  236,  235,  234,  233,  232,  231,
  335.  
  336.       230,  229,  228,  227,  226,  225,  224,  223,  222,  221,
  337.       220,  219,  218,  217,  216,  215,  214,  213,  212,  211,
  338.       210,  207,  206,  205,  204,  203,  202,  201,  200,  199,
  339.       198,  197,  196,  195,  194,  193,  192,  191,  190,  189,
  340.       188,  187,  186,  185,  184,  183,  182,  179,  178,  177,
  341.       176,  175,  172,  171,  166,  165,  160,  157,  156,  155,
  342.       154,  153,  152,  151,  150,  149,  148,  147,  146,  145,
  343.       144,  143,  142,  137,  136,  131,  128,  127,  126,  125,
  344.       124,  123,  122,  121,  120,  119,  118,  117,  116,  115,
  345.       114,  109,  336,  107,  106,  105,  104,   99,   98,   95,
  346.  
  347.        84,   83,   81,   80,   79,   78,   73,   72,   69,   58,
  348.        57,   55,   54,   53,  336,    5,  336,  336,  336,  336,
  349.       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
  350.       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
  351.       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
  352.       336,  336,  336,  336,  336,  336,  336
  353.     } ;
  354.  
  355. static const short int yy_chk[458] =
  356.     {   0,
  357.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  358.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  359.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  360.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  361.         1,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  362.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  363.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  364.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  365.         3,    3,    8,    9,   16,   18,   17,   18,   75,   19,
  366.       334,   16,   19,   21,    8,   17,   18,   16,   24,   24,
  367.  
  368.        21,   48,    9,   32,   33,   75,   35,    9,   24,   35,
  369.        32,   24,   34,   33,   34,   37,   32,   40,   40,   45,
  370.        48,   51,   37,   34,   52,   48,   53,   40,   51,   53,
  371.        40,   45,   73,   76,   52,   80,   79,   80,   99,  101,
  372.       102,  322,  105,   73,   79,  106,  321,  106,   76,   99,
  373.       105,  110,  118,  118,  323,  102,  101,  147,  147,  332,
  374.       110,  320,  318,  316,  323,  315,  314,  312,  310,  332,
  375.       337,  337,  337,  337,  337,  337,  337,  337,  338,  309,
  376.       308,  307,  338,  338,  339,  339,  306,  339,  339,  339,
  377.       339,  339,  340,  340,  340,  340,  341,  341,  341,  341,
  378.  
  379.       342,  342,  342,  342,  343,  343,  344,  344,  344,  344,
  380.       305,  298,  295,  294,  293,  292,  291,  284,  281,  280,
  381.       279,  278,  276,  274,  273,  271,  270,  269,  268,  267,
  382.       266,  264,  263,  261,  260,  259,  258,  254,  253,  251,
  383.       250,  249,  248,  247,  246,  244,  243,  241,  240,  239,
  384.       238,  235,  234,  233,  232,  231,  230,  228,  227,  226,
  385.       225,  224,  223,  222,  221,  220,  219,  218,  215,  214,
  386.       211,  210,  209,  208,  205,  203,  202,  200,  199,  198,
  387.       197,  196,  195,  194,  193,  192,  191,  190,  187,  186,
  388.       183,  182,  181,  180,  177,  175,  174,  173,  172,  171,
  389.  
  390.       170,  169,  168,  167,  166,  165,  164,  163,  162,  161,
  391.       160,  159,  158,  157,  155,  153,  152,  151,  150,  149,
  392.       148,  146,  145,  144,  143,  142,  141,  140,  139,  138,
  393.       137,  136,  135,  134,  133,  132,  131,  130,  129,  128,
  394.       126,  124,  123,  122,  121,  120,  119,  117,  116,  115,
  395.       114,  111,  109,  107,  104,  103,  100,   98,   97,   95,
  396.        94,   93,   92,   91,   90,   89,   88,   87,   86,   85,
  397.        84,   83,   81,   78,   77,   74,   72,   71,   69,   68,
  398.        67,   66,   65,   64,   63,   62,   61,   60,   59,   58,
  399.        57,   50,   47,   44,   43,   42,   41,   39,   38,   36,
  400.  
  401.        31,   30,   28,   27,   26,   25,   23,   22,   20,   15,
  402.        14,   12,   11,   10,    5,  336,  336,  336,  336,  336,
  403.       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
  404.       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
  405.       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
  406.       336,  336,  336,  336,  336,  336,  336
  407.     } ;
  408.  
  409. /* the intent behind this definition is that it'll catch
  410.  * any uses of REJECT which flex missed
  411.  */
  412. #define REJECT reject_used_but_not_detected
  413. #define yymore() yymore_used_but_not_detected
  414.  
  415. /* these variables are all declared out here so that section 3 code can
  416.  * manipulate them
  417.  */
  418. static char *yy_c_buf_p;    /* points to current character in buffer */
  419. static int yy_init = 1;        /* whether we need to initialize */
  420. static int yy_start = 0;    /* start state number */
  421. #ifndef ORIGINAL
  422. static char *yy_cp, *yy_bp;
  423. #endif
  424.  
  425. /* true when we've seen an EOF for the current input file */
  426. static int yy_eof_has_been_seen;
  427.  
  428. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  429.  
  430. /* yy_ch_buf has to be 2 characters longer than YY_BUF_SIZE because we need
  431.  * to put in 2 end-of-buffer characters (this is explained where it is
  432.  * done) at the end of yy_ch_buf
  433.  */
  434. static char yy_ch_buf[YY_BUF_SIZE + 2];
  435.  
  436. /* yy_hold_char holds the character lost when yytext is formed */
  437. static char yy_hold_char;
  438.  
  439. static yy_state_type yy_last_accepting_state;
  440. static char *yy_last_accepting_cpos;
  441.  
  442. #ifdef PROTOTYPES
  443. static yy_state_type yy_get_previous_state( void );
  444. static int yy_get_next_buffer( void );
  445. static void yyunput( int c, char *buf_ptr );
  446. static int input( void );
  447. static void yyrestart( FILE *input_file );
  448. #else
  449. static yy_state_type yy_get_previous_state();
  450. static int yy_get_next_buffer();
  451. static void yyunput();
  452. static int input();
  453. static void yyrestart();
  454. #endif
  455.  
  456. YY_DECL
  457.     {
  458.     register yy_state_type yy_current_state;
  459. #ifdef ORIGINAL
  460.     register char *yy_cp, *yy_bp;
  461. #endif
  462.     register int yy_act;
  463.  
  464.  
  465.  
  466.  
  467.     if ( yy_init )
  468.     {
  469.     if ( ! yy_start )
  470.         yy_start = 1;    /* first start state */
  471.  
  472.     if ( ! yyin )
  473.         yyin = stdin;
  474.  
  475.     if ( ! yyout )
  476.         yyout = stdout;
  477.  
  478. new_file:
  479.     /* this is where we enter upon encountering an end-of-file and
  480.      * yywrap() indicating that we should continue processing
  481.      */
  482.  
  483.     /* we put in the '\n' and start reading from [1] so that an
  484.      * initial match-at-newline will be true.
  485.      */
  486.  
  487.     yy_ch_buf[0] = '\n';
  488.     yy_n_chars = 1;
  489.  
  490.     /* we always need two end-of-buffer characters.  The first causes
  491.      * a transition to the end-of-buffer state.  The second causes
  492.      * a jam in that state.
  493.      */
  494.     yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  495.     yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  496.  
  497.     yy_eof_has_been_seen = 0;
  498.  
  499.     yytext = yy_c_buf_p = &yy_ch_buf[1];
  500.     yy_hold_char = *yy_c_buf_p;
  501.     yy_init = 0;
  502.     }
  503.  
  504.     while ( 1 )        /* loops until end-of-file is reached */
  505.     {
  506.     yy_cp = yy_c_buf_p;
  507.  
  508.     /* support of yytext */
  509.     *yy_cp = yy_hold_char;
  510.  
  511.     /* yy_bp points to the position in yy_ch_buf of the start of the
  512.      * current run.
  513.      */
  514.     yy_bp = yy_cp;
  515.  
  516.     yy_current_state = yy_start;
  517.     do
  518.         {
  519.         register char yy_c = yy_ec[*yy_cp];
  520.         if ( yy_accept[yy_current_state] )
  521.         {
  522.         yy_last_accepting_state = yy_current_state;
  523.         yy_last_accepting_cpos = yy_cp;
  524.         }
  525.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  526.         {
  527.         yy_current_state = yy_def[yy_current_state];
  528.         if ( yy_current_state >= 337 )
  529.             yy_c = yy_meta[yy_c];
  530.         }
  531.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  532.         ++yy_cp;
  533.         }
  534.     while ( yy_current_state != 336 );
  535.     yy_cp = yy_last_accepting_cpos;
  536.     yy_current_state = yy_last_accepting_state;
  537.  
  538.     /* bogus while loop to let YY_BACK_TRACK, EOB_ACT_LAST_MATCH,
  539.      * and EOF actions branch here without introducing an optimizer-
  540.      * daunting goto
  541.      */
  542.     while ( 1 )
  543.         {
  544.         yy_act = yy_accept[yy_current_state];
  545.  
  546.         YY_DO_BEFORE_ACTION;
  547.         YY_USER_ACTION;
  548.  
  549. #ifdef FLEX_DEBUG
  550.         fprintf( stderr, "--accepting rule #%d (\"%s\")\n",
  551.              yy_act, yytext );
  552. #endif
  553.  
  554. do_action:    /* this label is used only to access EOF actions */
  555.         switch ( yy_act )
  556.         {
  557.         case 0: /* must backtrack */
  558.         /* undo the effects of YY_DO_BEFORE_ACTION */
  559.         *yy_cp = yy_hold_char;
  560.         yy_cp = yy_last_accepting_cpos;
  561.         yy_current_state = yy_last_accepting_state;
  562.         continue; /* go to "YY_DO_BEFORE_ACTION" */
  563.  
  564. case 1:
  565. {read_comment();}
  566.     YY_BREAK
  567. case 2:
  568. {default_action();}
  569.     YY_BREAK
  570. case 3:
  571. {default_action();BEGIN CPP_MACRO;}
  572.     YY_BREAK
  573. case 4:
  574. {default_action();BEGIN CPP_MACRO;}
  575.     YY_BREAK
  576. case 5:
  577. {default_action();}
  578.     YY_BREAK
  579. case 6:
  580. {action_keyword();}
  581.     YY_BREAK
  582. case 7:
  583. {action_keyword();}
  584.     YY_BREAK
  585. case 8:
  586. {action_keyword();}
  587.     YY_BREAK
  588. case 9:
  589. {action_keyword();}
  590.     YY_BREAK
  591. case 10:
  592. {action_keyword();}
  593.     YY_BREAK
  594. case 11:
  595. {action_keyword();}
  596.     YY_BREAK
  597. case 12:
  598. {action_keyword();}
  599.     YY_BREAK
  600. case 13:
  601. {action_keyword();}
  602.     YY_BREAK
  603. case 14:
  604. {action_keyword();}
  605.     YY_BREAK
  606. case 15:
  607. {action_keyword();}
  608.     YY_BREAK
  609. case 16:
  610. {action_keyword();}
  611.     YY_BREAK
  612. case 17:
  613. {action_keyword();}
  614.     YY_BREAK
  615. case 18:
  616. {action_keyword();}
  617.     YY_BREAK
  618. case 19:
  619. {action_keyword();}
  620.     YY_BREAK
  621. case 20:
  622. {action_keyword();}
  623.     YY_BREAK
  624. case 21:
  625. {action_keyword();}
  626.     YY_BREAK
  627. case 22:
  628. {action_keyword();}
  629.     YY_BREAK
  630. case 23:
  631. {action_keyword();}
  632.     YY_BREAK
  633. case 24:
  634. {action_keyword();}
  635.     YY_BREAK
  636. case 25:
  637. {action_keyword();}
  638.     YY_BREAK
  639. case 26:
  640. {action_keyword();}
  641.     YY_BREAK
  642. case 27:
  643. {action_keyword();}
  644.     YY_BREAK
  645. case 28:
  646. {action_keyword();}
  647.     YY_BREAK
  648. case 29:
  649. {action_keyword();}
  650.     YY_BREAK
  651. case 30:
  652. {action_keyword();}
  653.     YY_BREAK
  654. case 31:
  655. {action_keyword();}
  656.     YY_BREAK
  657. case 32:
  658. {action_keyword();}
  659.     YY_BREAK
  660. case 33:
  661. {action_keyword();}
  662.     YY_BREAK
  663. case 34:
  664. {action_keyword();}
  665.     YY_BREAK
  666. case 35:
  667. {action_keyword();}
  668.     YY_BREAK
  669. case 36:
  670. {action_keyword();}
  671.     YY_BREAK
  672. case 37:
  673. {action_keyword();}
  674.     YY_BREAK
  675. case 38:
  676. {action_symbol(TYPE_STRING);}
  677.     YY_BREAK
  678. case 39:
  679. {default_action();}
  680.     YY_BREAK
  681. case 40:
  682. {action_symbol(TYPE_MACRO);BEGIN 0;}
  683.     YY_BREAK
  684. case 41:
  685. {action_symbol(TYPE_IDENTIFIER);BEGIN 0;}
  686.     YY_BREAK
  687. case 42:
  688. {cond_putchar('\n');}
  689.     YY_BREAK
  690. case 43:
  691. {default_action();}
  692.     YY_BREAK
  693. case 44:
  694. {default_action();}
  695.     YY_BREAK
  696. case 45:
  697. ECHO;
  698.     YY_BREAK
  699. case YY_STATE_EOF(INITIAL):
  700. case YY_STATE_EOF(CPP_MACRO):
  701.     yyterminate();
  702.  
  703.         case YY_END_OF_BUFFER:
  704.             /* undo the effects of YY_DO_BEFORE_ACTION */
  705.             *yy_cp = yy_hold_char;
  706.  
  707.             yytext = yy_bp;
  708.  
  709.             switch ( yy_get_next_buffer() )
  710.             {
  711.             case EOB_ACT_END_OF_FILE:
  712.                 {
  713.                 if ( yywrap() )
  714.                 {
  715.                 /* note: because we've taken care in
  716.                  * yy_get_next_buffer() to have set up yytext,
  717.                  * we can now set up yy_c_buf_p so that if some
  718.                  * total hoser (like flex itself) wants
  719.                  * to call the scanner after we return the
  720.                  * YY_NULL, it'll still work - another YY_NULL
  721.                  * will get returned.
  722.                  */
  723.                 yy_c_buf_p = yytext;
  724.  
  725.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  726.                 goto do_action;
  727.                 }
  728.  
  729.                 else
  730.                 YY_NEW_FILE;
  731.                 }
  732.                 break;
  733.  
  734.             case EOB_ACT_RESTART_SCAN:
  735.                 yy_c_buf_p = yytext;
  736.                 yy_hold_char = *yy_c_buf_p;
  737.                 break;
  738.  
  739.             case EOB_ACT_LAST_MATCH:
  740.                 yy_c_buf_p = &yy_ch_buf[yy_n_chars];
  741.  
  742.                 yy_current_state = yy_get_previous_state();
  743.  
  744.                 yy_cp = yy_c_buf_p;
  745.                 yy_bp = yytext;
  746.                 continue; /* go to "YY_DO_BEFORE_ACTION" */
  747.             }
  748.             break;
  749.  
  750.         default:
  751.             printf( "action # %d\n", yy_act );
  752.             YY_FATAL_ERROR( "fatal flex scanner internal error" );
  753.         }
  754.  
  755.         break; /* exit bogus while loop */
  756.         }
  757.     }
  758.     }
  759.  
  760.  
  761. /* yy_get_next_buffer - try to read in new buffer
  762.  *
  763.  * synopsis
  764.  *     int yy_get_next_buffer();
  765.  *     
  766.  * returns a code representing an action
  767.  *     EOB_ACT_LAST_MATCH - 
  768.  *     EOB_ACT_RESTART_SCAN - restart the scanner
  769.  *     EOB_ACT_END_OF_FILE - end of file
  770.  */
  771.  
  772. static int yy_get_next_buffer()
  773.  
  774.     {
  775.     register char *dest = yy_ch_buf;
  776.     register char *source = yytext - 1; /* copy prev. char, too */
  777.     register int number_to_move, i;
  778.     int ret_val;
  779.     
  780.     if ( yy_c_buf_p != &yy_ch_buf[yy_n_chars + 1] )
  781.     {
  782.     YY_FATAL_ERROR( "NULL in input" );
  783.     /*NOTREACHED*/
  784.     }
  785.  
  786.     /* try to read more data */
  787.  
  788.     /* first move last chars to start of buffer */
  789.     number_to_move = yy_c_buf_p - yytext;
  790.  
  791.     for ( i = 0; i < number_to_move; ++i )
  792.     *(dest++) = *(source++);
  793.  
  794.     if ( yy_eof_has_been_seen )
  795.     /* don't do the read, it's not guaranteed to return an EOF,
  796.      * just force an EOF
  797.      */
  798.     yy_n_chars = 0;
  799.  
  800.     else
  801.     {
  802.     int num_to_read = YY_BUF_SIZE - number_to_move - 1;
  803.  
  804.     if ( num_to_read > YY_READ_BUF_SIZE )
  805.         num_to_read = YY_READ_BUF_SIZE;
  806.  
  807.     /* read in more data */
  808.     YY_INPUT( (&yy_ch_buf[number_to_move]), yy_n_chars, num_to_read );
  809.     }
  810.  
  811.     if ( yy_n_chars == 0 )
  812.     {
  813.     if ( number_to_move == 1 )
  814.         ret_val = EOB_ACT_END_OF_FILE;
  815.     else
  816.         ret_val = EOB_ACT_LAST_MATCH;
  817.  
  818.     yy_eof_has_been_seen = 1;
  819.     }
  820.  
  821.     else
  822.     ret_val = EOB_ACT_RESTART_SCAN;
  823.  
  824.     yy_n_chars += number_to_move;
  825.     yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  826.     yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  827.  
  828.     /* yytext begins at the second character in
  829.      * yy_ch_buf; the first character is the one which
  830.      * preceded it before reading in the latest buffer;
  831.      * it needs to be kept around in case it's a
  832.      * newline, so yy_get_previous_state() will have
  833.      * with '^' rules active
  834.      */
  835.  
  836.     yytext = &yy_ch_buf[1];
  837.  
  838.     return ( ret_val );
  839.     }
  840.  
  841.  
  842. /* yy_get_previous_state - get the state just before the EOB char was reached
  843.  *
  844.  * synopsis
  845.  *     yy_state_type yy_get_previous_state();
  846.  */
  847.  
  848. static yy_state_type yy_get_previous_state()
  849.  
  850.     {
  851.     register yy_state_type yy_current_state;
  852.     register char *yy_cp;
  853.  
  854.     yy_current_state = yy_start;
  855.  
  856.     for ( yy_cp = yytext; yy_cp < yy_c_buf_p; ++yy_cp )
  857.     {
  858.     register char yy_c = yy_ec[*yy_cp];
  859.     if ( yy_accept[yy_current_state] )
  860.         {
  861.         yy_last_accepting_state = yy_current_state;
  862.         yy_last_accepting_cpos = yy_cp;
  863.         }
  864.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  865.         {
  866.         yy_current_state = yy_def[yy_current_state];
  867.         if ( yy_current_state >= 337 )
  868.         yy_c = yy_meta[yy_c];
  869.         }
  870.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  871.     }
  872.  
  873.     return ( yy_current_state );
  874.     }
  875.  
  876.  
  877. #ifdef PROTOTYPES
  878. static void yyunput( int c, register char *yy_bp )
  879. #else
  880. static void yyunput( c, yy_bp )
  881. int c;
  882. register char *yy_bp;
  883. #endif
  884.  
  885.     {
  886.     register char *yy_cp = yy_c_buf_p;
  887.  
  888.     *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  889.  
  890.     if ( yy_cp < yy_ch_buf + 2 )
  891.     { /* need to shift things up to make room */
  892.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  893.     register char *dest = &yy_ch_buf[YY_BUF_SIZE + 2];
  894.     register char *source = &yy_ch_buf[number_to_move];
  895.  
  896.     while ( source > yy_ch_buf )
  897.         *--dest = *--source;
  898.  
  899.     yy_cp += dest - source;
  900.     yy_bp += dest - source;
  901.     yy_n_chars += dest - source;
  902.  
  903.     if ( yy_cp < yy_ch_buf + 2 )
  904.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  905.     }
  906.  
  907.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  908.     yy_cp[-2] = '\n';
  909.  
  910.     *--yy_cp = c;
  911.  
  912.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  913.     }
  914.  
  915.  
  916. static int input()
  917.  
  918.     {
  919.     int c;
  920.     char *yy_cp = yy_c_buf_p;
  921.  
  922.     *yy_cp = yy_hold_char;
  923.  
  924.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  925.     { /* need more input */
  926.     yytext = yy_c_buf_p;
  927.     ++yy_c_buf_p;
  928.  
  929.     switch ( yy_get_next_buffer() )
  930.         {
  931.         /* this code, unfortunately, is somewhat redundant with
  932.          * that above
  933.          */
  934.         case EOB_ACT_END_OF_FILE:
  935.         {
  936.         if ( yywrap() )
  937.             {
  938.             yy_c_buf_p = yytext;
  939.             return ( EOF );
  940.             }
  941.  
  942.         yy_ch_buf[0] = '\n';
  943.         yy_n_chars = 1;
  944.         yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  945.         yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  946.         yy_eof_has_been_seen = 0;
  947.         yytext = yy_c_buf_p = &yy_ch_buf[1];
  948.         yy_hold_char = *yy_c_buf_p;
  949.  
  950.         return ( input() );
  951.         }
  952.         break;
  953.  
  954.         case EOB_ACT_RESTART_SCAN:
  955.         yy_c_buf_p = yytext;
  956.         break;
  957.  
  958.         case EOB_ACT_LAST_MATCH:
  959.         YY_FATAL_ERROR( "unexpected last match in input()" );
  960.         }
  961.     }
  962.  
  963.     c = *yy_c_buf_p;
  964.     yy_hold_char = *++yy_c_buf_p;
  965.  
  966.     return ( c );
  967.     }
  968.  
  969.  
  970. #ifdef PROTOTYPES
  971. static void yyrestart( FILE *input_file )
  972. #else
  973. static void yyrestart( input_file )
  974. FILE *input_file;
  975. #endif
  976.  
  977.     {
  978.     if ( yyin != stdin )
  979.     fclose( yyin );
  980.  
  981.     yyin = input_file;
  982.     yy_init = 1;
  983.     }
  984.  
  985.  
  986. #ifndef yywrap /* flex defines this as a macro */
  987. /* this is the action yylex() executes on end of file 
  988.    if it returns 0 then processing continues.
  989.  */
  990. yywrap()
  991. {
  992. return (!next_yyin());
  993. }
  994. #endif
  995.  
  996. void action_symbol(type_flag)
  997. symbol_type_t type_flag;
  998. extern  char O_string_buffer[];
  999. static int reading_original_string = 1;
  1000. char *o_string;
  1001.  
  1002.   switch(Mode)
  1003.   {
  1004.   case PRINT_TRUNCATED:
  1005.     if(!symbol_lookup(yytext) && type_flag == TYPE_IDENTIFIER)
  1006.         printf("%.*s", Truncation, yytext);
  1007.     else
  1008.       printf("%s", yytext);
  1009.     break;
  1010.  
  1011.   case APPLY_SUBSTS:
  1012.   o_string =  lookup_subst(yytext);
  1013.   if(o_string == NULL)
  1014.    printf("%s", yytext);
  1015.   else
  1016.    printf("%s", o_string);
  1017.   break;
  1018.  
  1019.   case READ_IGNORES:
  1020.   case EXTRACT_SYMBOLS:
  1021.     symbol_install(yytext, type_flag);
  1022.   break;
  1023.  
  1024.   case READ_SUBSTS:
  1025.     if(reading_original_string)
  1026.       {
  1027.       strncpy(O_string_buffer,yytext,SYMBOL_SIZE);
  1028.       }
  1029.     else
  1030.       {
  1031.       install_subst(O_string_buffer,yytext);
  1032.       }
  1033.     reading_original_string = !reading_original_string;
  1034.   }
  1035.  
  1036. }   
  1037.  
  1038.  
  1039. void read_comment()
  1040. {
  1041. int c, previous;
  1042.  
  1043. previous = '*';
  1044.  
  1045. if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)
  1046.    printf("/*");
  1047.  
  1048. for(;;){
  1049.     c = input();
  1050.     if(c == EOF)
  1051.       fatal("EOF in comment");
  1052.         else 
  1053.     cond_putchar(c);
  1054.     if(c == '/'){
  1055.       if(previous == '*')
  1056.         break;
  1057.       }
  1058.     previous = c;
  1059.     }
  1060.  
  1061. }
  1062.  
  1063. void default_action()
  1064. {
  1065. if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)
  1066.   printf("%s", yytext);
  1067. }
  1068.  
  1069. void action_keyword()
  1070. {
  1071. if(Mode == READ_SUBSTS)
  1072.   fatal1("Cannot use %s in a replacement", yytext);
  1073. if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)
  1074.    printf("%s", yytext);
  1075. }
  1076.  
  1077. /* end of file */
  1078.  
  1079.