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

  1. #define YY_DEFAULT_ACTION ECHO;
  2. #define FLEX_USE_ECS
  3. #define FLEX_USE_MECS
  4. /* A lexical scanner generated by flex */
  5.  
  6. #include "skeleton.h"
  7.  
  8. # line 1 "csubst.l"
  9. #define INITIAL 0
  10. /* csubst.l */
  11. /* lex source of csubst utility.
  12. This programme is shareware.
  13. If you found this programme useful then send me a colourful postcard
  14. with the words "Happy Birthday" (or equivalent) so that it arrives
  15. at my address around the first of January 1991.
  16.  
  17. Henri de Feraudy
  18. 27 rue Chef de Ville
  19. 92140 Clamart 
  20. France
  21. */
  22. # line 14 "csubst.l"
  23. extern int  Mode, Truncation;
  24. extern char *lookup_subst();
  25. #include <stdio.h>
  26. #include "csubst.h"
  27. #define cond_putchar(C) if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)putchar(C);
  28.  
  29. #ifdef yywrap
  30. #undef yywrap
  31. #define yywrap() (!next_yyin())
  32. #endif
  33.  
  34. void action_keyword(), default_action(), action_symbol(), read_comment();
  35. #define CPP_MACRO 2
  36. # line 37 "csubst.l"
  37. #define YY_JAM 335
  38. #define YY_JAM_BASE 414
  39. #define YY_TEMPLATE 336
  40. static char l[336] =
  41.     {   0,
  42.        -2,   -2,   -2,   -2,   44,   42,   44,   44,   44,   44,
  43.        44,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  44.        41,   41,   41,   41,   41,   41,   41,   40,   40,   40,
  45.        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  46.        40,   40,   40,    0,   38,    0,    0,    5,    5,    5,
  47.         0,    0,    1,    0,   41,   41,   41,   41,   41,   41,
  48.        41,   13,   41,   41,   41,   41,   41,   41,   21,   41,
  49.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  50.        40,   40,   40,   40,   40,   40,   40,   13,   40,   40,
  51.        40,   40,   40,   40,   21,   40,   40,   40,   40,   40,
  52.  
  53.        40,   40,   40,   40,   40,   40,    5,    5,    5,    5,
  54.        39,   43,   41,   41,   41,   41,   41,   41,   41,   41,
  55.        41,   41,   41,   19,   41,   22,   41,   41,   41,   41,
  56.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  57.        41,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  58.        40,   40,   19,   40,   22,   40,   40,   40,   40,   40,
  59.        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  60.         5,    5,    5,    5,    6,   41,    8,    9,   41,   41,
  61.        41,   41,   15,   16,   41,   41,   20,   23,   41,   41,
  62.        41,   41,   41,   41,   41,   41,   41,   41,   41,   35,
  63.  
  64.        41,   41,    6,   40,    8,    9,   40,   40,   40,   40,
  65.        15,   16,   40,   40,   20,   23,   40,   40,   40,   40,
  66.        40,   40,   40,   40,   40,   40,   40,   35,   40,   40,
  67.         5,    5,    5,    5,    7,   10,   41,   41,   41,   41,
  68.        18,   41,   41,   26,   41,   41,   41,   41,   41,   41,
  69.        33,   41,   41,   37,    7,   10,   40,   40,   40,   40,
  70.        18,   40,   40,   26,   40,   40,   40,   40,   40,   40,
  71.        33,   40,   40,   37,    5,    3,    5,    5,   41,   41,
  72.        14,   17,   41,   25,   27,   28,   29,   30,   31,   41,
  73.        41,   41,   40,   40,   14,   17,   40,   25,   27,   28,
  74.  
  75.        29,   30,   31,   40,   40,   40,    4,    5,   41,   12,
  76.        41,   32,   41,   41,   40,   12,   40,   32,   40,   40,
  77.         4,    5,   11,   24,   34,   36,   11,   24,   34,   36,
  78.         0,    0,    0,    2,    0
  79.     } ;
  80.  
  81. static char e[128] =
  82.     {   0,
  83.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  84.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  85.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  86.         1,    2,    1,    4,    5,    1,    1,    1,    6,    1,
  87.         1,    7,    1,    1,    1,    8,    9,   10,   11,   11,
  88.        11,   11,   11,   11,   11,   11,   11,    1,    1,   12,
  89.         1,   13,    1,    1,   14,   14,   14,   14,   14,   14,
  90.        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
  91.        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
  92.         1,   16,    1,    1,   17,    1,   18,   19,   20,   21,
  93.  
  94.        22,   23,   24,   25,   26,   15,   27,   28,   29,   30,
  95.        31,   32,   15,   33,   34,   35,   36,   37,   38,   39,
  96.        40,   41,    1,    1,    1,    1,    1
  97.     } ;
  98.  
  99. static char m[42] =
  100.     {   0,
  101.         1,    2,    1,    1,    1,    3,    1,    4,    4,    5,
  102.         5,    1,    1,    6,    7,    4,    8,    6,    6,    6,
  103.         6,    6,    6,    7,    7,    7,    7,    7,    7,    7,
  104.         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
  105.         7
  106.     } ;
  107.  
  108. static short int b[344] =
  109.     {   0,
  110.         0,    0,   41,    0,  414,  414,   79,   82,  398,  406,
  111.       373,    0,  375,  377,   67,   65,   58,   62,  378,   71,
  112.       377,  385,   74,  366,  375,  373,  378,    0,  366,  368,
  113.        86,   83,   85,   79,  369,   93,  368,  376,   93,  357,
  114.       366,  364,  369,  116,  414,  390,  100,    0,  370,   99,
  115.       119,  124,  414,    0,    0,  356,  368,  355,  370,  357,
  116.       363,  349,  350,  347,  347,  350,  347,  344,    0,  343,
  117.       347,  109,  345,   65,  116,  349,  342,  111,  110,  347,
  118.         0,  337,  349,  336,  351,  338,  344,  330,  331,  328,
  119.       328,  331,  328,  325,    0,  324,  328,  115,  326,  116,
  120.  
  121.       123,  330,  323,  117,  120,  328,    0,  330,  131,  332,
  122.       414,  414,  320,  332,  327,  315,  119,  329,  327,  323,
  123.       315,  321,  324,    0,  310,    0,  316,  313,  302,  304,
  124.       306,  313,  299,  297,  297,  309,  299,  303,  307,  309,
  125.       298,  294,  306,  301,  289,  124,  303,  301,  297,  289,
  126.       295,  298,    0,  284,    0,  290,  287,  276,  278,  280,
  127.       287,  273,  271,  271,  283,  273,  277,  281,  283,  272,
  128.       273,  276,  276,  268,    0,  268,    0,    0,  259,  267,
  129.       256,  263,    0,    0,  257,  254,    0,    0,  254,  254,
  130.       251,  263,  253,  257,  262,  261,  259,  249,  254,    0,
  131.  
  132.       242,  254,    0,  248,    0,    0,  239,  247,  236,  243,
  133.         0,    0,  237,  234,    0,    0,  234,  234,  231,  243,
  134.       233,  237,  242,  241,  239,  229,  234,    0,  222,  234,
  135.       225,  231,  231,  216,    0,    0,  221,  222,  227,  218,
  136.         0,  212,  216,    0,  224,  221,  223,  207,  216,  218,
  137.         0,  209,  212,    0,    0,    0,  207,  208,  213,  204,
  138.         0,  198,  202,    0,  210,  207,  209,  193,  202,  204,
  139.         0,  195,  198,    0,  201,    0,  199,  200,  184,  184,
  140.         0,    0,  196,    0,    0,    0,    0,    0,    0,  194,
  141.       194,  187,  178,  178,    0,    0,  190,    0,    0,    0,
  142.  
  143.         0,    0,    0,  188,  165,  154,  179,  158,  147,    0,
  144.       135,    0,  146,  144,  142,    0,  130,    0,  141,  125,
  145.       140,  153,    0,    0,    0,    0,    0,    0,    0,    0,
  146.       158,    0,   78,  414,  414,  170,  177,  184,  188,  192,
  147.       196,  200,  203
  148.     } ;
  149.  
  150. static short int d[344] =
  151.     {   0,
  152.       335,    1,  335,    3,  335,  335,  336,  337,  338,  335,
  153.       335,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  154.       339,  339,  339,  339,  339,  339,  339,  340,  340,  340,
  155.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  156.       340,  340,  340,  336,  335,  336,  337,  341,  341,  341,
  157.       338,  338,  335,  342,  339,  339,  339,  339,  339,  339,
  158.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  159.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  160.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  161.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  162.  
  163.       340,  340,  340,  340,  340,  340,  341,  341,  341,  341,
  164.       335,  335,  339,  339,  339,  339,  339,  339,  339,  339,
  165.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  166.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  167.       339,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  168.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  169.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  170.       341,  341,  341,  341,  339,  339,  339,  339,  339,  339,
  171.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  172.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  173.  
  174.       339,  339,  340,  340,  340,  340,  340,  340,  340,  340,
  175.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  176.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  177.       341,  341,  341,  341,  339,  339,  339,  339,  339,  339,
  178.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  179.       339,  339,  339,  339,  340,  340,  340,  340,  340,  340,
  180.       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
  181.       340,  340,  340,  340,  341,  341,  341,  341,  339,  339,
  182.       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
  183.       339,  339,  340,  340,  340,  340,  340,  340,  340,  340,
  184.  
  185.       340,  340,  340,  340,  340,  340,  341,  341,  339,  339,
  186.       339,  339,  339,  339,  340,  340,  340,  340,  340,  340,
  187.       335,  341,  339,  339,  339,  339,  340,  340,  340,  340,
  188.       335,  343,  343,  335,-32767,  335,  335,  335,  335,  335,
  189.       335,  335,  335
  190.     } ;
  191.  
  192. static short int n[456] =
  193.     {   0,
  194.         5,    5,    6,    7,    8,    9,    5,    5,   10,   11,
  195.         5,    5,    5,   12,   12,    5,    5,   13,   14,   15,
  196.        16,   17,   18,   19,   12,   20,   12,   21,   12,   12,
  197.        12,   12,   22,   23,   24,   25,   26,   27,   12,   12,
  198.        12,    5,    5,    6,    7,    8,    9,    5,    5,   10,
  199.        11,    5,    5,    5,   28,   28,    5,    5,   29,   30,
  200.        31,   32,   33,   34,   35,   28,   36,   28,   37,   28,
  201.        28,   28,   28,   38,   39,   40,   41,   42,   43,   28,
  202.        28,   28,   45,   47,   58,   63,   61,   64,  131,   66,
  203.       334,   59,   67,   69,   46,   62,   65,   60,   73,   74,
  204.  
  205.        70,   47,   49,   84,   87,  132,   92,   50,   75,   93,
  206.        85,   76,   89,   88,   90,   95,   86,   99,  100,   45,
  207.        49,  109,   96,   91,  111,   50,  335,  101,  110,   51,
  208.       102,   46,  128,  133,   52,  139,  137,  140,  157,  160,
  209.       162,  321,  166,  129,  138,  168,  330,  169,  134,  158,
  210.       167,  172,  179,  180,  331,  163,  161,  207,  208,  331,
  211.       173,  329,  328,  327,  332,  326,  325,  324,  323,  332,
  212.        44,   44,   44,   44,   44,   44,   44,   44,   48,  322,
  213.       321,  320,   48,   48,   51,   51,  319,   51,   51,   51,
  214.        51,   51,   55,   55,   55,   55,   81,   81,   81,   81,
  215.  
  216.       107,  107,  107,  107,  112,  112,  333,  333,  333,  333,
  217.       318,  317,  316,  315,  314,  313,  312,  311,  310,  309,
  218.       308,  276,  307,  306,  305,  304,  303,  302,  301,  300,
  219.       299,  298,  297,  296,  295,  294,  293,  292,  291,  290,
  220.       289,  288,  287,  286,  285,  284,  283,  282,  281,  280,
  221.       279,  278,  277,  276,  275,  274,  273,  272,  271,  270,
  222.       269,  268,  267,  266,  265,  264,  263,  262,  261,  260,
  223.       259,  258,  257,  256,  255,  254,  253,  252,  251,  250,
  224.       249,  248,  247,  246,  245,  244,  243,  242,  241,  240,
  225.       239,  238,  237,  236,  235,  234,  233,  232,  231,  230,
  226.  
  227.       229,  228,  227,  226,  225,  224,  223,  222,  221,  220,
  228.       219,  218,  217,  216,  215,  214,  213,  212,  211,  210,
  229.       209,  206,  205,  204,  203,  202,  201,  200,  199,  198,
  230.       197,  196,  195,  194,  193,  192,  191,  190,  189,  188,
  231.       187,  186,  185,  184,  183,  182,  181,  178,  177,  176,
  232.       175,  174,  171,  170,  165,  164,  159,  156,  155,  154,
  233.       153,  152,  151,  150,  149,  148,  147,  146,  145,  144,
  234.       143,  142,  141,  136,  135,  130,  127,  126,  125,  124,
  235.       123,  122,  121,  120,  119,  118,  117,  116,  115,  114,
  236.       113,  108,  335,  106,  105,  104,  103,   98,   97,   94,
  237.  
  238.        83,   82,   80,   79,   78,   77,   72,   71,   68,   57,
  239.        56,   54,   53,   52,  335,  335,  335,  335,  335,  335,
  240.       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
  241.       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
  242.       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
  243.       335,  335,  335,  335,  335
  244.     } ;
  245.  
  246. static short int c[456] =
  247.     {   0,
  248.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  249.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  250.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  251.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  252.         1,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  253.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  254.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  255.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  256.         3,    3,    7,    8,   15,   17,   16,   17,   74,   18,
  257.       333,   15,   18,   20,    7,   16,   17,   15,   23,   23,
  258.  
  259.        20,   47,    8,   31,   32,   74,   34,    8,   23,   34,
  260.        31,   23,   33,   32,   33,   36,   31,   39,   39,   44,
  261.        47,   50,   36,   33,   51,   47,   52,   39,   50,   52,
  262.        39,   44,   72,   75,   51,   79,   78,   79,   98,  100,
  263.       101,  321,  104,   72,   78,  105,  320,  105,   75,   98,
  264.       104,  109,  117,  117,  322,  101,  100,  146,  146,  331,
  265.       109,  319,  317,  315,  322,  314,  313,  311,  309,  331,
  266.       336,  336,  336,  336,  336,  336,  336,  336,  337,  308,
  267.       307,  306,  337,  337,  338,  338,  305,  338,  338,  338,
  268.       338,  338,  339,  339,  339,  339,  340,  340,  340,  340,
  269.  
  270.       341,  341,  341,  341,  342,  342,  343,  343,  343,  343,
  271.       304,  297,  294,  293,  292,  291,  290,  283,  280,  279,
  272.       278,  277,  275,  273,  272,  270,  269,  268,  267,  266,
  273.       265,  263,  262,  260,  259,  258,  257,  253,  252,  250,
  274.       249,  248,  247,  246,  245,  243,  242,  240,  239,  238,
  275.       237,  234,  233,  232,  231,  230,  229,  227,  226,  225,
  276.       224,  223,  222,  221,  220,  219,  218,  217,  214,  213,
  277.       210,  209,  208,  207,  204,  202,  201,  199,  198,  197,
  278.       196,  195,  194,  193,  192,  191,  190,  189,  186,  185,
  279.       182,  181,  180,  179,  176,  174,  173,  172,  171,  170,
  280.  
  281.       169,  168,  167,  166,  165,  164,  163,  162,  161,  160,
  282.       159,  158,  157,  156,  154,  152,  151,  150,  149,  148,
  283.       147,  145,  144,  143,  142,  141,  140,  139,  138,  137,
  284.       136,  135,  134,  133,  132,  131,  130,  129,  128,  127,
  285.       125,  123,  122,  121,  120,  119,  118,  116,  115,  114,
  286.       113,  110,  108,  106,  103,  102,   99,   97,   96,   94,
  287.        93,   92,   91,   90,   89,   88,   87,   86,   85,   84,
  288.        83,   82,   80,   77,   76,   73,   71,   70,   68,   67,
  289.        66,   65,   64,   63,   62,   61,   60,   59,   58,   57,
  290.        56,   49,   46,   43,   42,   41,   40,   38,   37,   35,
  291.  
  292.        30,   29,   27,   26,   25,   24,   22,   21,   19,   14,
  293.        13,   11,   10,    9,  335,  335,  335,  335,  335,  335,
  294.       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
  295.       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
  296.       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
  297.       335,  335,  335,  335,  335
  298.     } ;
  299.  
  300.  
  301. /* these declarations have to come after the section 1 code or lint gets
  302.  * confused about whether the variables are used
  303.  */
  304. FILE *yyin = stdin, *yyout = stdout;
  305.  
  306. /* these variables are all declared out here so that section 3 code can
  307.  * manipulate them
  308.  */
  309. static int yy_start, yy_b_buf_p, yy_c_buf_p, yy_e_buf_p;
  310. static int yy_saw_eof, yy_init = 1;
  311.  
  312. /* yy_ch_buf has to be 1 character longer than YY_BUF_SIZE, since when
  313.  * setting up yytext we can try to put a '\0' just past the end of the
  314.  * matched text
  315.  */
  316. static char yy_ch_buf[YY_BUF_SIZE + 1];
  317. static int yy_st_buf[YY_BUF_SIZE];
  318. static char yy_hold_char;
  319.  
  320. static char input( void) ;
  321. static void unput( char) ;
  322.  
  323. char *yytext;
  324. static int yyleng;
  325.  
  326. /*--------------------------------------------------------------------------*/
  327. /*------------------------- BEGIN LEXICAL ANALYZER -------------------------*/
  328. /*--------------------------------------------------------------------------*/
  329.  
  330. YY_DECL
  331.     {
  332.     int yy_n_chars, yy_lp, yy_iii, yy_buf_pos, yy_act;
  333. #ifdef FLEX_REJECT_ENABLED
  334.     int yy_full_match;
  335. #endif
  336.  
  337.  
  338.  
  339.  
  340.     if ( yy_init )
  341.     {
  342.     YY_INIT;
  343.     yy_start = 1;
  344.     yy_init = 0;
  345.     }
  346.  
  347.     goto get_next_token;
  348.  
  349. do_action:
  350.  
  351. #ifdef FLEX_REJECT_ENABLED
  352.     /* remember matched text in case we back up due to trailing context */
  353.     yy_full_match = yy_c_buf_p;
  354. #endif
  355.  
  356.     for ( ; ; )
  357.     {
  358.     YY_DO_BEFORE_ACTION
  359.  
  360. #ifdef FLEX_DEBUG
  361.     fprintf( stderr, "--accepting rule #%d\n", yy_act );
  362. #endif
  363.     switch ( yy_act )
  364.         {
  365. case 1:
  366. # line 39 "csubst.l"
  367. {read_comment();}
  368.     YY_BREAK
  369. case 2:
  370. # line 40 "csubst.l"
  371. {default_action();}
  372.     YY_BREAK
  373. case 3:
  374. # line 41 "csubst.l"
  375. {default_action();BEGIN CPP_MACRO;}
  376.     YY_BREAK
  377. case 4:
  378. # line 42 "csubst.l"
  379. {default_action();BEGIN CPP_MACRO;}
  380.     YY_BREAK
  381. case 5:
  382. # line 43 "csubst.l"
  383. {default_action();}
  384.     YY_BREAK
  385. case 6:
  386. # line 44 "csubst.l"
  387. {action_keyword();}
  388.     YY_BREAK
  389. case 7:
  390. # line 45 "csubst.l"
  391. {action_keyword();}
  392.     YY_BREAK
  393. case 8:
  394. # line 46 "csubst.l"
  395. {action_keyword();}
  396.     YY_BREAK
  397. case 9:
  398. # line 47 "csubst.l"
  399. {action_keyword();}
  400.     YY_BREAK
  401. case 10:
  402. # line 48 "csubst.l"
  403. {action_keyword();}
  404.     YY_BREAK
  405. case 11:
  406. # line 49 "csubst.l"
  407. {action_keyword();}
  408.     YY_BREAK
  409. case 12:
  410. # line 50 "csubst.l"
  411. {action_keyword();}
  412.     YY_BREAK
  413. case 13:
  414. # line 51 "csubst.l"
  415. {action_keyword();}
  416.     YY_BREAK
  417. case 14:
  418. # line 52 "csubst.l"
  419. {action_keyword();}
  420.     YY_BREAK
  421. case 15:
  422. # line 53 "csubst.l"
  423. {action_keyword();}
  424.     YY_BREAK
  425. case 16:
  426. # line 54 "csubst.l"
  427. {action_keyword();}
  428.     YY_BREAK
  429. case 17:
  430. # line 55 "csubst.l"
  431. {action_keyword();}
  432.     YY_BREAK
  433. case 18:
  434. # line 56 "csubst.l"
  435. {action_keyword();}
  436.     YY_BREAK
  437. case 19:
  438. # line 57 "csubst.l"
  439. {action_keyword();}
  440.     YY_BREAK
  441. case 20:
  442. # line 58 "csubst.l"
  443. {action_keyword();}
  444.     YY_BREAK
  445. case 21:
  446. # line 59 "csubst.l"
  447. {action_keyword();}
  448.     YY_BREAK
  449. case 22:
  450. # line 60 "csubst.l"
  451. {action_keyword();}
  452.     YY_BREAK
  453. case 23:
  454. # line 61 "csubst.l"
  455. {action_keyword();}
  456.     YY_BREAK
  457. case 24:
  458. # line 62 "csubst.l"
  459. {action_keyword();}
  460.     YY_BREAK
  461. case 25:
  462. # line 63 "csubst.l"
  463. {action_keyword();}
  464.     YY_BREAK
  465. case 26:
  466. # line 64 "csubst.l"
  467. {action_keyword();}
  468.     YY_BREAK
  469. case 27:
  470. # line 65 "csubst.l"
  471. {action_keyword();}
  472.     YY_BREAK
  473. case 28:
  474. # line 66 "csubst.l"
  475. {action_keyword();}
  476.     YY_BREAK
  477. case 29:
  478. # line 67 "csubst.l"
  479. {action_keyword();}
  480.     YY_BREAK
  481. case 30:
  482. # line 68 "csubst.l"
  483. {action_keyword();}
  484.     YY_BREAK
  485. case 31:
  486. # line 69 "csubst.l"
  487. {action_keyword();}
  488.     YY_BREAK
  489. case 32:
  490. # line 70 "csubst.l"
  491. {action_keyword();}
  492.     YY_BREAK
  493. case 33:
  494. # line 71 "csubst.l"
  495. {action_keyword();}
  496.     YY_BREAK
  497. case 34:
  498. # line 72 "csubst.l"
  499. {action_keyword();}
  500.     YY_BREAK
  501. case 35:
  502. # line 73 "csubst.l"
  503. {action_keyword();}
  504.     YY_BREAK
  505. case 36:
  506. # line 74 "csubst.l"
  507. {action_keyword();}
  508.     YY_BREAK
  509. case 37:
  510. # line 75 "csubst.l"
  511. {action_keyword();}
  512.     YY_BREAK
  513. case 38:
  514. # line 76 "csubst.l"
  515. {action_symbol(TYPE_STRING);}
  516.     YY_BREAK
  517. case 39:
  518. # line 77 "csubst.l"
  519. {default_action();}
  520.     YY_BREAK
  521. case 40:
  522. # line 78 "csubst.l"
  523. {action_symbol(TYPE_MACRO);BEGIN 0;}
  524.     YY_BREAK
  525. case 41:
  526. # line 79 "csubst.l"
  527. {action_symbol(TYPE_IDENTIFIER);BEGIN 0;}
  528.     YY_BREAK
  529. case 42:
  530. # line 80 "csubst.l"
  531. {cond_putchar('\n');}
  532.     YY_BREAK
  533. case 43:
  534. # line 81 "csubst.l"
  535. {default_action();}
  536.     YY_BREAK
  537. case 44:
  538. # line 82 "csubst.l"
  539. {default_action();}
  540.     YY_BREAK
  541. case 45:
  542. # line 83 "csubst.l"
  543. YY_DEFAULT_ACTION;
  544.     YY_BREAK
  545.  
  546. case YY_NEW_FILE:
  547. break; /* begin reading from new file */
  548.  
  549. case YY_END_TOK:
  550. return ( YY_END_TOK );
  551.  
  552. default:
  553. YY_FATAL_ERROR( "fatal flex scanner internal error" );
  554.         }
  555.  
  556. get_next_token:
  557.     {
  558.     register int yy_curst;
  559.     register char yy_sym;
  560.  
  561.     YY_DO_BEFORE_SCAN
  562.  
  563.     /* set up to begin running DFA */
  564.  
  565.     yy_curst = yy_start;
  566.  
  567.     if ( yy_ch_buf[yy_c_buf_p] == '\n' )
  568.         ++yy_curst;
  569.  
  570.     /* yy_b_buf_p points to the position in yy_ch_buf
  571.      * of the start of the current run.
  572.      */
  573.  
  574.     yy_b_buf_p = yy_c_buf_p + 1;
  575.  
  576.     do /* until the machine jams */
  577.         {
  578.         if ( yy_c_buf_p == yy_e_buf_p )
  579.         { /* need more input */
  580.         if ( yy_e_buf_p >= YY_BUF_LIM )
  581.             { /* not enough room to do another read */
  582.             /* see if we can make some room for more chars */
  583.  
  584.             yy_n_chars = yy_e_buf_p - yy_b_buf_p;
  585.  
  586.             if ( yy_n_chars >= 0 )
  587.             /* shift down buffer to make room */
  588.             for ( yy_iii = 0; yy_iii <= yy_n_chars; ++yy_iii )
  589.                 {
  590.                 yy_buf_pos = yy_b_buf_p + yy_iii;
  591.                 yy_ch_buf[yy_iii] = yy_ch_buf[yy_buf_pos];
  592.                 yy_st_buf[yy_iii] = yy_st_buf[yy_buf_pos];
  593.                 }
  594.  
  595.             yy_b_buf_p = 0;
  596.             yy_e_buf_p = yy_n_chars;
  597.  
  598.             if ( yy_e_buf_p >= YY_BUF_LIM )
  599.             YY_FATAL_ERROR( "flex input buffer overflowed" );
  600.  
  601.             yy_c_buf_p = yy_e_buf_p;
  602.             }
  603.  
  604.         else if ( yy_saw_eof )
  605.             {
  606. saweof:            if ( yy_b_buf_p > yy_e_buf_p )
  607.             {
  608.             if ( yywrap() )
  609.                 {
  610.                 yy_act = YY_END_TOK;
  611.                 goto do_action;
  612.                 }
  613.             
  614.             else
  615.                 {
  616.                 YY_INIT;
  617.                 yy_act = YY_NEW_FILE;
  618.                 goto do_action;
  619.                 }
  620.             }
  621.  
  622.             else /* do a jam to eat up more input */
  623.             {
  624. #ifndef FLEX_INTERACTIVE_SCANNER
  625.             /* we're going to decrement yy_c_buf_p upon doing
  626.              * the jam.  In this case, that's wrong, since
  627.              * it points to the last non-jam character.  So
  628.              * we increment it now to counter the decrement.
  629.              */
  630.             ++yy_c_buf_p;
  631. #endif
  632.             break;
  633.             }
  634.             }
  635.  
  636.         YY_INPUT( (yy_ch_buf + yy_c_buf_p + 1), yy_n_chars,
  637.               YY_MAX_LINE );
  638.  
  639.         if ( yy_n_chars == YY_NULL )
  640.             {
  641.             if ( yy_saw_eof )
  642.     YY_FATAL_ERROR( "flex scanner saw EOF twice - shouldn't happen" );
  643.             yy_saw_eof = 1;
  644.             goto saweof;
  645.             }
  646.  
  647.         yy_e_buf_p += yy_n_chars;
  648.         }
  649.  
  650.         ++yy_c_buf_p;
  651.  
  652. #ifdef FLEX_USE_ECS
  653.         yy_sym = e[yy_ch_buf[yy_c_buf_p]];
  654. #else
  655.         yy_sym = yy_ch_buf[yy_c_buf_p];
  656. #endif
  657.  
  658. #ifdef FLEX_FULL_TABLE
  659.         yy_curst = n[yy_curst][yy_sym];
  660.  
  661. #else /* get next state from compressed table */
  662.  
  663.         while ( c[b[yy_curst] + yy_sym] != yy_curst )
  664.         {
  665.         yy_curst = d[yy_curst];
  666.  
  667. #ifdef FLEX_USE_MECS
  668.         /* we've arrange it so that templates are never chained
  669.          * to one another.  This means we can afford make a
  670.          * very simple test to see if we need to convert to
  671.          * yy_sym's meta-equivalence class without worrying
  672.          * about erroneously looking up the meta-equivalence
  673.          * class twice
  674.          */
  675.  
  676.         if ( yy_curst >= YY_TEMPLATE )
  677.             yy_sym = m[yy_sym];
  678. #endif
  679.         }
  680.  
  681.         yy_curst = n[b[yy_curst] + yy_sym];
  682.  
  683. #endif
  684.  
  685.         yy_st_buf[yy_c_buf_p] = yy_curst;
  686.  
  687.         }
  688. #ifdef FLEX_INTERACTIVE_SCANNER
  689.     while ( b[yy_curst] != YY_JAM_BASE );
  690. #else
  691.     while ( yy_curst != YY_JAM );
  692.     --yy_c_buf_p; /* put back character we jammed on */
  693.  
  694. #endif
  695.  
  696.     if ( yy_c_buf_p >= yy_b_buf_p )
  697.         { /* we matched some text */
  698.         yy_curst = yy_st_buf[yy_c_buf_p];
  699.         yy_lp = l[yy_curst];
  700.  
  701. #ifdef FLEX_REJECT_ENABLED
  702. find_rule: /* we branch to this label when doing a REJECT */
  703. #endif
  704.  
  705.         for ( ; ; ) /* until we find what rule we matched */
  706.         {
  707. #ifdef FLEX_REJECT_ENABLED
  708.         if ( yy_lp && yy_lp < l[yy_curst + 1] )
  709.             {
  710.             yy_act = a[yy_lp];
  711.             goto do_action; /* "continue 2" */
  712.             }
  713. #else
  714.         if ( yy_lp )
  715.             {
  716.             yy_act = yy_lp;
  717.             goto do_action; /* "continue 2" */
  718.             }
  719. #endif
  720.  
  721.         if ( --yy_c_buf_p < yy_b_buf_p )
  722.             break;
  723.  
  724.         yy_curst = yy_st_buf[yy_c_buf_p];
  725.         yy_lp = l[yy_curst];
  726.         }
  727.         }
  728.  
  729.     YY_FATAL_ERROR( "no match in flex scanner - possible NULL in input" );
  730.     }
  731.     }
  732.  
  733.     /*NOTREACHED*/
  734.     }
  735.  
  736. #ifdef ANSI_C
  737. static  void unput(char c )
  738. #else
  739. static  void unput( c )
  740. char c;
  741. #endif
  742. {
  743.  register int i;
  744.  register int yy_buf_pos ;
  745.  
  746.     YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */
  747.  
  748.     if ( yy_c_buf_p == 0 )
  749.     {
  750.     yy_buf_pos = YY_BUF_MAX ;
  751.     for ( i = yy_e_buf_p; i >= yy_c_buf_p; --i )
  752.         {
  753.         yy_ch_buf[yy_buf_pos] = yy_ch_buf[i];
  754.         yy_st_buf[yy_buf_pos] = yy_st_buf[i];
  755.         --yy_buf_pos;
  756.         }
  757.  
  758.     yy_c_buf_p = YY_BUF_MAX - yy_e_buf_p;
  759.     yy_e_buf_p = YY_BUF_MAX;
  760.     }
  761.  
  762.     if ( yy_c_buf_p <= 0 )
  763.     YY_FATAL_ERROR( "flex scanner push-back overflow" );
  764.  
  765.     if ( yy_c_buf_p >= yy_b_buf_p && yy_ch_buf[yy_c_buf_p] == '\n' )
  766.     yy_ch_buf[yy_c_buf_p - 1] = '\n';
  767.  
  768.     yy_ch_buf[yy_c_buf_p--] =  c;
  769.  
  770.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  771.  
  772.     }
  773.  
  774.  
  775. static char input( void)
  776. {
  777.     char c;
  778.  
  779.     YY_DO_BEFORE_SCAN
  780.  
  781.     if ( yy_c_buf_p == yy_e_buf_p )
  782.     { /* need more input */
  783.     int yy_n_chars;
  784.  
  785.     /* we can throw away the entire current buffer */
  786.     if ( yy_saw_eof )
  787.         {
  788.         if ( yywrap() )
  789.         return ( EOF );
  790.  
  791.         YY_INIT;
  792.         }
  793.  
  794.     yy_b_buf_p = 0;
  795.     YY_INPUT( yy_ch_buf, yy_n_chars, YY_MAX_LINE );
  796.  
  797.     if ( yy_n_chars == YY_NULL )
  798.     {
  799.         yy_saw_eof = 1;
  800.  
  801.         if ( yywrap() )
  802.         return ( EOF );
  803.  
  804.         YY_INIT;
  805.  
  806.         return ( input() );
  807.     }
  808.  
  809.     yy_c_buf_p = -1;
  810.     yy_e_buf_p = yy_n_chars - 1;
  811.     }
  812.  
  813.     c = (unsigned char) yy_ch_buf[++yy_c_buf_p];
  814.  
  815.     YY_DO_BEFORE_ACTION;
  816.  
  817.     return ( c );
  818.     }
  819.  
  820. /*--------------------------------------------------------------------------*/
  821. /*------------------------- END OF LEXICAL ANALYZER ------------------------*/
  822. /*--------------------------------------------------------------------------*/
  823.  
  824. # line 83 "csubst.l"
  825.  
  826.  
  827. #ifndef yywrap /* flex defines this as a macro */
  828. /* this is the action yylex() executes on end of file 
  829.    if it returns 0 then processing continues.
  830.  */
  831. yywrap()
  832. {
  833. return (!next_yyin());
  834. }
  835. #endif
  836.  
  837. void action_symbol(type_flag)
  838. symbol_type_t type_flag;
  839. extern  char O_string_buffer[];
  840. static int reading_original_string = 1;
  841. char *o_string;
  842.  
  843.   switch(Mode)
  844.   {
  845.   case PRINT_TRUNCATED:
  846.     if(!symbol_lookup(yytext) && type_flag == TYPE_IDENTIFIER)
  847.         printf("%.*s", Truncation, yytext);
  848.     else
  849.       printf("%s", yytext);
  850.     break;
  851.  
  852.   case APPLY_SUBSTS:
  853.   o_string =  lookup_subst(yytext);
  854.   if(o_string == NULL)
  855.    printf("%s", yytext);
  856.   else
  857.    printf("%s", o_string);
  858.   break;
  859.  
  860.   case READ_IGNORES:
  861.   case EXTRACT_SYMBOLS:
  862.     symbol_install(yytext, type_flag);
  863.   break;
  864.  
  865.   case READ_SUBSTS:
  866.     if(reading_original_string)
  867.       {
  868.       strncpy(O_string_buffer,yytext,SYMBOL_SIZE);
  869.       }
  870.     else
  871.       {
  872.       install_subst(O_string_buffer,yytext);
  873.       }
  874.     reading_original_string = !reading_original_string;
  875.   }
  876.  
  877. }   
  878.  
  879.  
  880. void read_comment()
  881. {
  882. int c, previous;
  883.  
  884. previous = '*';
  885.  
  886. if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)
  887.    printf("/*");
  888.  
  889. for(;;){
  890.     c = input();
  891.     if(c == EOF)
  892.       fatal("EOF in comment");
  893.         else 
  894.     cond_putchar(c);
  895.     if(c == '/'){
  896.       if(previous == '*')
  897.         break;
  898.       }
  899.     previous = c;
  900.     }
  901.  
  902. }
  903.  
  904. void default_action()
  905. {
  906. if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)
  907.   printf("%s", yytext);
  908. }
  909.  
  910. void action_keyword()
  911. {
  912. if(Mode == READ_SUBSTS)
  913.   fatal1("Cannot use %s in a replacement", yytext);
  914. if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)
  915.    printf("%s", yytext);
  916. }
  917.  
  918. /* end of file */
  919.  
  920.