home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cproto.zip / cproto46 / lex_yy.c < prev    next >
C/C++ Source or Header  |  1996-04-13  |  77KB  |  3,049 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* Scanner skeleton version:
  4.  * /master/usr.bin/lex/skel.c,v 1.2 1996/05/30 12:31:07 bostic Exp
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8. #define YY_FLEX_MAJOR_VERSION 2
  9. #define YY_FLEX_MINOR_VERSION 5
  10.  
  11. #include <stdio.h>
  12.  
  13.  
  14. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  15. #ifdef c_plusplus
  16. #ifndef __cplusplus
  17. #define __cplusplus
  18. #endif
  19. #endif
  20.  
  21.  
  22. #ifdef __cplusplus
  23.  
  24. #include <stdlib.h>
  25. #include <unistd.h>
  26.  
  27. /* Use prototypes in function declarations. */
  28. #define YY_USE_PROTOS
  29.  
  30. /* The "const" storage-class-modifier is valid. */
  31. #define YY_USE_CONST
  32.  
  33. #else    /* ! __cplusplus */
  34.  
  35. #if __STDC__
  36.  
  37. #define YY_USE_PROTOS
  38. #define YY_USE_CONST
  39.  
  40. #endif    /* __STDC__ */
  41. #endif    /* ! __cplusplus */
  42.  
  43. #ifdef __TURBOC__
  44.  #pragma warn -rch
  45.  #pragma warn -use
  46. #include <io.h>
  47. #include <stdlib.h>
  48. #define YY_USE_CONST
  49. #define YY_USE_PROTOS
  50. #endif
  51.  
  52. #ifdef YY_USE_CONST
  53. #define yyconst const
  54. #else
  55. #define yyconst
  56. #endif
  57.  
  58.  
  59. #ifdef YY_USE_PROTOS
  60. #define YY_PROTO(proto) proto
  61. #else
  62. #define YY_PROTO(proto) ()
  63. #endif
  64.  
  65. /* Returned upon end-of-file. */
  66. #define YY_NULL 0
  67.  
  68. /* Promotes a possibly negative, possibly signed char to an unsigned
  69.  * integer for use as an array index.  If the signed char is negative,
  70.  * we want to instead treat it as an 8-bit unsigned char, hence the
  71.  * double cast.
  72.  */
  73. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  74.  
  75. /* Enter a start condition.  This macro really ought to take a parameter,
  76.  * but we do it the disgusting crufty way forced on us by the ()-less
  77.  * definition of BEGIN.
  78.  */
  79. #define BEGIN yy_start = 1 + 2 *
  80.  
  81. /* Translate the current start state into a value that can be later handed
  82.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  83.  * compatibility.
  84.  */
  85. #define YY_START ((yy_start - 1) / 2)
  86. #define YYSTATE YY_START
  87.  
  88. /* Action number for EOF rule of a given start state. */
  89. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  90.  
  91. /* Special action meaning "start processing a new file". */
  92. #define YY_NEW_FILE yyrestart( yyin )
  93.  
  94. #define YY_END_OF_BUFFER_CHAR 0
  95.  
  96. /* Size of default input buffer. */
  97. #define YY_BUF_SIZE 16384
  98.  
  99. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  100.  
  101. extern int yyleng;
  102. extern FILE *yyin, *yyout;
  103.  
  104. #define EOB_ACT_CONTINUE_SCAN 0
  105. #define EOB_ACT_END_OF_FILE 1
  106. #define EOB_ACT_LAST_MATCH 2
  107.  
  108. /* The funky do-while in the following #define is used to turn the definition
  109.  * int a single C statement (which needs a semi-colon terminator).  This
  110.  * avoids problems with code like:
  111.  *
  112.  *     if ( condition_holds )
  113.  *        yyless( 5 );
  114.  *    else
  115.  *        do_something_else();
  116.  *
  117.  * Prior to using the do-while the compiler would get upset at the
  118.  * "else" because it interpreted the "if" statement as being all
  119.  * done when it reached the ';' after the yyless() call.
  120.  */
  121.  
  122. /* Return all but the first 'n' matched characters back to the input stream. */
  123.  
  124. #define yyless(n) \
  125.     do \
  126.         { \
  127.         /* Undo effects of setting up yytext. */ \
  128.         *yy_cp = yy_hold_char; \
  129.         YY_RESTORE_YY_MORE_OFFSET \
  130.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  131.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  132.         } \
  133.     while ( 0 )
  134.  
  135. #define unput(c) yyunput( c, yytext_ptr )
  136.  
  137. /* The following is because we cannot portably get our hands on size_t
  138.  * (without autoconf's help, which isn't available because we want
  139.  * flex-generated scanners to compile on their own).
  140.  */
  141. typedef unsigned int yy_size_t;
  142.  
  143.  
  144. struct yy_buffer_state
  145.     {
  146.     FILE *yy_input_file;
  147.  
  148.     char *yy_ch_buf;        /* input buffer */
  149.     char *yy_buf_pos;        /* current position in input buffer */
  150.  
  151.     /* Size of input buffer in bytes, not including room for EOB
  152.      * characters.
  153.      */
  154.     yy_size_t yy_buf_size;
  155.  
  156.     /* Number of characters read into yy_ch_buf, not including EOB
  157.      * characters.
  158.      */
  159.     int yy_n_chars;
  160.  
  161.     /* Whether we "own" the buffer - i.e., we know we created it,
  162.      * and can realloc() it to grow it, and should free() it to
  163.      * delete it.
  164.      */
  165.     int yy_is_our_buffer;
  166.  
  167.     /* Whether this is an "interactive" input source; if so, and
  168.      * if we're using stdio for input, then we want to use getc()
  169.      * instead of fread(), to make sure we stop fetching input after
  170.      * each newline.
  171.      */
  172.     int yy_is_interactive;
  173.  
  174.     /* Whether we're considered to be at the beginning of a line.
  175.      * If so, '^' rules will be active on the next match, otherwise
  176.      * not.
  177.      */
  178.     int yy_at_bol;
  179.  
  180.     /* Whether to try to fill the input buffer when we reach the
  181.      * end of it.
  182.      */
  183.     int yy_fill_buffer;
  184.  
  185.     int yy_buffer_status;
  186. #define YY_BUFFER_NEW 0
  187. #define YY_BUFFER_NORMAL 1
  188.     /* When an EOF's been seen but there's still some text to process
  189.      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  190.      * shouldn't try reading from the input source any more.  We might
  191.      * still have a bunch of tokens to match, though, because of
  192.      * possible backing-up.
  193.      *
  194.      * When we actually see the EOF, we change the status to "new"
  195.      * (via yyrestart()), so that the user can continue scanning by
  196.      * just pointing yyin at a new input file.
  197.      */
  198. #define YY_BUFFER_EOF_PENDING 2
  199.     };
  200.  
  201. static YY_BUFFER_STATE yy_current_buffer = 0;
  202.  
  203. /* We provide macros for accessing buffer states in case in the
  204.  * future we want to put the buffer states in a more general
  205.  * "scanner state".
  206.  */
  207. #define YY_CURRENT_BUFFER yy_current_buffer
  208.  
  209.  
  210. /* yy_hold_char holds the character lost when yytext is formed. */
  211. static char yy_hold_char;
  212.  
  213. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  214.  
  215.  
  216. int yyleng;
  217.  
  218. /* Points to current character in buffer. */
  219. static char *yy_c_buf_p = (char *) 0;
  220. static int yy_init = 1;        /* whether we need to initialize */
  221. static int yy_start = 0;    /* start state number */
  222.  
  223. /* Flag which is used to allow yywrap()'s to do buffer switches
  224.  * instead of setting up a fresh yyin.  A bit of a hack ...
  225.  */
  226. static int yy_did_buffer_switch_on_eof;
  227.  
  228. void yyrestart YY_PROTO(( FILE *input_file ));
  229.  
  230. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  231. void yy_load_buffer_state YY_PROTO(( void ));
  232. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  233. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  234. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  235. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  236. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  237.  
  238. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
  239. YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
  240. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
  241.  
  242. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  243. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  244. static void yy_flex_free YY_PROTO(( void * ));
  245.  
  246. #define yy_new_buffer yy_create_buffer
  247.  
  248. #define yy_set_interactive(is_interactive) \
  249.     { \
  250.     if ( ! yy_current_buffer ) \
  251.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  252.     yy_current_buffer->yy_is_interactive = is_interactive; \
  253.     }
  254.  
  255. #define yy_set_bol(at_bol) \
  256.     { \
  257.     if ( ! yy_current_buffer ) \
  258.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  259.     yy_current_buffer->yy_at_bol = at_bol; \
  260.     }
  261.  
  262. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  263.  
  264. typedef unsigned char YY_CHAR;
  265. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  266. typedef int yy_state_type;
  267. extern char *yytext;
  268. #define yytext_ptr yytext
  269.  
  270. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  271. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  272. static int yy_get_next_buffer YY_PROTO(( void ));
  273. static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
  274.  
  275. /* Done after the current pattern has been matched and before the
  276.  * corresponding action - sets up yytext.
  277.  */
  278. #define YY_DO_BEFORE_ACTION \
  279.     yytext_ptr = yy_bp; \
  280.     yyleng = (int) (yy_cp - yy_bp); \
  281.     yy_hold_char = *yy_cp; \
  282.     *yy_cp = '\0'; \
  283.     yy_c_buf_p = yy_cp;
  284.  
  285. #define YY_NUM_RULES 85
  286. #define YY_END_OF_BUFFER 86
  287. static yyconst short int yy_accept[323] =
  288.     {   0,
  289.         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  290.         0,    0,    0,    0,   14,   14,   86,   84,   83,    1,
  291.        26,   10,   62,    4,   21,   22,   23,   24,   84,   84,
  292.        65,   84,   84,   62,   62,   62,   62,   62,   62,   62,
  293.        62,   62,   62,   62,   62,   62,   62,   74,   84,   20,
  294.        20,   20,   20,   20,   20,   20,   20,   20,   69,   69,
  295.        68,   67,   69,   66,   73,   73,   72,   73,   70,   71,
  296.        82,   82,   77,   80,   82,   79,   82,   82,   75,   76,
  297.         8,    8,    7,    8,    8,   31,   31,   30,   28,   29,
  298.        31,   14,   14,    1,   14,   83,   10,   62,    0,    2,
  299.  
  300.         0,    0,    0,   63,   62,   62,   62,   62,   62,   62,
  301.        62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
  302.        62,   62,   62,   62,    9,    0,    0,   19,    0,    0,
  303.         0,    0,    0,    0,   80,    0,    0,    5,    6,   14,
  304.        14,    2,   14,   25,    0,    3,    0,   11,   62,   62,
  305.        62,   62,   27,   62,   62,   62,   62,   62,   62,   62,
  306.        62,   42,   62,   62,   62,   62,   62,   62,   62,   62,
  307.        62,   62,   62,   62,    0,    0,    0,    0,    0,    0,
  308.        81,    0,   14,    3,    0,    0,   11,   62,   62,   62,
  309.        62,   33,   39,   62,   48,   62,   62,   62,   62,   44,
  310.  
  311.        62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
  312.        43,    0,   18,    0,    0,    0,    0,    0,   81,    0,
  313.         0,   62,   62,   62,   62,   62,   62,   41,   62,   62,
  314.        62,   45,   62,   62,   62,   62,   62,   50,   62,   62,
  315.         0,    0,    0,    0,    0,    0,   64,   62,   62,   62,
  316.        62,   40,   34,   62,   38,   62,   46,   36,   62,   49,
  317.        62,   62,   51,    0,    0,    0,    0,    0,   78,   62,
  318.        62,   62,    0,   62,    0,   62,   62,   62,   62,   62,
  319.        37,   62,    0,    0,   16,    0,   13,   62,   54,   52,
  320.         0,   32,   62,   62,   62,   35,   62,   47,    0,   15,
  321.  
  322.        16,    0,   62,   62,   62,   59,   58,   62,   60,   12,
  323.        15,    0,   17,   62,   55,   53,   62,   61,   57,   62,
  324.        56,    0
  325.     } ;
  326.  
  327. static yyconst int yy_ec[256] =
  328.     {   0,
  329.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  330.         1,    4,    4,    1,    1,    1,    1,    1,    1,    1,
  331.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  332.         1,    2,    1,    5,    6,    7,    8,    9,   10,   11,
  333.        12,   13,    1,   14,    1,   15,   16,   17,   17,   17,
  334.        17,   17,   17,   17,   17,   17,   17,    1,   18,    1,
  335.        19,    1,   20,    1,   21,   21,   21,   21,   21,   21,
  336.        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
  337.        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
  338.        22,    1,   23,    1,   24,    1,   25,   26,   27,   28,
  339.  
  340.        29,   30,   31,   32,   33,   21,   21,   34,   35,   36,
  341.        37,   38,   21,   39,   40,   41,   42,   43,   21,   44,
  342.        45,   21,   46,    1,   47,    1,    1,    1,    1,    1,
  343.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  344.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  345.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  346.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  347.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  348.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  349.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  350.  
  351.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  352.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  353.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  354.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  355.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  356.         1,    1,    1,    1,    1
  357.     } ;
  358.  
  359. static yyconst int yy_meta[48] =
  360.     {   0,
  361.         1,    2,    1,    1,    1,    1,    3,    1,    1,    1,
  362.         1,    1,    1,    1,    1,    1,    4,    5,    1,    1,
  363.         3,    1,    1,    3,    3,    3,    3,    3,    3,    3,
  364.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  365.         3,    3,    3,    3,    3,    1,    1
  366.     } ;
  367.  
  368. static yyconst short int yy_base[343] =
  369.     {   0,
  370.         0,  562,   46,   82,  118,  163,  208,  254,  300,  346,
  371.        49,   65,  392,  407,   74,   85,  569,  571,   53,  571,
  372.       571,  566,    0,  571,  571,  571,  571,  571,  552,   45,
  373.       571,  546,  542,   40,   51,  532,  526,   58,  528,  527,
  374.       386,  384,  391,   63,  371,  379,   35,  571,  367,  571,
  375.       104,   84,  109,  372,  378,  370,  372,  363,  571,  123,
  376.       571,  571,  101,  571,  571,  127,  571,  117,  571,  571,
  377.       571,  133,  571,  398,  125,  571,  379,  369,  571,  571,
  378.       571,  138,  571,  130,  101,  571,  146,  571,  571,  571,
  379.       136,    0,  149,    0,  141,  154,  389,    0,  375,  571,
  380.  
  381.       386,   94,  365,  571,  136,  362,  351,  343,  358,  340,
  382.       339,  339,  342,  341,  129,  341,  345,  338,  343,  146,
  383.       335,  142,  348,  338,  571,  367,  181,  571,  142,  328,
  384.       338,  340,  329,  322,  359,  341,  318,  571,  571,    0,
  385.       176,    0,  121,  571,  355,  571,  337,  353,  313,  317,
  386.       312,  304,    0,  306,  303,  315,  305,  309,  312,  310,
  387.       302,    0,  303,  300,  293,  295,  289,  305,  286,  298,
  388.       289,  292,  296,  295,  319,  282,  286,  283,  286,  281,
  389.       311,  270,  169,    0,  291,  289,  306,  266,  265,  267,
  390.       268,    0,    0,  262,    0,  256,  253,  268,  256,    0,
  391.  
  392.       251,  249,  260,  255,  280,  259,  257,  248,  252,  255,
  393.         0,  278,  571,  247,  243,  236,  275,  239,  273,  235,
  394.       261,  233,  238,  233,  240,  238,  230,    0,  231,  234,
  395.       221,    0,  233,  233,  226,  211,  222,    0,  214,  215,
  396.       222,  218,  218,  186,  209,  208,  571,  210,  206,  212,
  397.       423,    0,    0,  161,    0,  211,    0,    0,  214,    0,
  398.       208,  208,    0,  194,  233,  205,  188,  193,  571,  206,
  399.       202,  202,  218,    0,  216,  198,  197,  200,  184,  188,
  400.         0,  193,  179,  217,  215,  189,  571,  174,  191,  190,
  401.       196,  571,  177,  176,  168,    0,  167,    0,  170,    0,
  402.  
  403.       196,  194,  155,  171,  169,    0,    0,  150,    0,  571,
  404.         0,  157,  571,  126,    0,    0,   89,   58,    0,   32,
  405.         0,  571,  470,  475,  480,  485,  490,  495,  500,  503,
  406.       507,  512,  517,  521,  526,  531,  536,  541,  546,  550,
  407.       551,  555
  408.     } ;
  409.  
  410. static yyconst short int yy_def[343] =
  411.     {   0,
  412.       322,    1,  323,  323,  324,  324,  325,  325,  326,  326,
  413.       327,  327,  328,  328,  329,  329,  322,  322,  322,  322,
  414.       322,  322,  330,  322,  322,  322,  322,  322,  322,  322,
  415.       322,  322,  331,  330,  330,  330,  330,  330,  330,  330,
  416.       330,  330,  330,  330,  330,  330,  330,  322,  322,  322,
  417.       322,  322,  332,  322,  322,  322,  322,  322,  322,  322,
  418.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  419.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  420.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  421.       322,  333,  333,  333,  333,  322,  322,  330,  322,  322,
  422.  
  423.       334,  322,  331,  322,  330,  330,  330,  330,  330,  330,
  424.       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  425.       330,  330,  330,  330,  322,  332,  332,  322,  332,  322,
  426.       322,  322,  322,  322,  322,  322,  322,  322,  322,  333,
  427.       333,  333,  335,  322,  334,  322,  336,  322,  330,  330,
  428.       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  429.       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  430.       330,  330,  330,  330,  337,  322,  322,  322,  322,  322,
  431.       322,  322,  335,  333,  336,  322,  322,  330,  330,  330,
  432.       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  433.  
  434.       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  435.       330,  337,  322,  322,  322,  322,  322,  322,  322,  322,
  436.       322,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  437.       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  438.       322,  322,  322,  322,  322,  322,  322,  330,  330,  330,
  439.       322,  330,  330,  330,  330,  330,  330,  330,  330,  330,
  440.       330,  330,  330,  322,  322,  322,  322,  322,  322,  330,
  441.       330,  330,  338,  251,  339,  330,  330,  330,  330,  330,
  442.       330,  330,  322,  340,  322,  322,  322,  330,  330,  330,
  443.       339,  322,  330,  330,  330,  330,  330,  330,  322,  341,
  444.  
  445.       322,  342,  330,  330,  330,  330,  330,  330,  330,  322,
  446.       341,  342,  322,  330,  330,  330,  330,  330,  330,  330,
  447.       330,    0,  322,  322,  322,  322,  322,  322,  322,  322,
  448.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  449.       322,  322
  450.     } ;
  451.  
  452. static yyconst short int yy_nxt[619] =
  453.     {   0,
  454.        18,   19,   20,   19,   21,   22,   23,   18,   24,   18,
  455.        25,   26,   27,   28,   29,   30,   18,   28,   31,   32,
  456.        23,   33,   18,   34,   35,   23,   36,   37,   38,   39,
  457.        40,   23,   41,   42,   23,   23,   23,   23,   43,   44,
  458.        45,   46,   47,   23,   23,   48,   18,   51,   20,   51,
  459.        82,   20,   82,   83,   96,  321,   96,  100,   83,  123,
  460.       101,   52,   53,  105,   84,  106,   82,   20,   82,   83,
  461.        54,  124,   85,   55,   83,   93,   94,   93,   56,   57,
  462.        84,  320,   58,   51,   20,   51,   93,   94,   93,   95,
  463.       107,   18,  108,  111,  118,  119,  100,   52,   53,  101,
  464.  
  465.        95,  112,   18,  120,  147,   96,   54,   96,  138,   55,
  466.       127,  128,  148,  100,   56,   57,  101,  319,   58,   60,
  467.        20,   60,   61,  184,   96,  129,   96,   61,   96,  100,
  468.        96,   62,  101,   63,   96,   62,   96,  100,  145,   96,
  469.       101,   96,  100,  127,  128,  101,  139,   96,  100,   96,
  470.       141,  101,  141,  142,  318,   96,  143,   96,  129,  313,
  471.       149,  106,  161,   64,   60,   20,   60,   61,  150,  162,
  472.       167,  184,   61,  168,  171,  151,   62,  141,   63,  141,
  473.        62,  172,  127,  128,  169,  175,  145,  244,  276,  286,
  474.       286,  317,  316,  302,  315,  314,  313,  301,  310,  277,
  475.  
  476.       309,  308,  267,  278,  267,  307,  306,  292,   64,   66,
  477.        20,   66,   67,  305,  304,  303,  301,   67,  284,  299,
  478.       298,  297,  296,   68,  295,  294,  293,  292,  275,  290,
  479.       289,  288,  287,  285,  284,  283,  282,  281,  280,  279,
  480.       272,  271,  270,  269,  268,  266,  265,  264,  263,  262,
  481.       261,  260,  259,   69,   70,   66,   20,   66,   67,  258,
  482.       257,  256,  255,   67,  254,  253,  252,  251,  250,   68,
  483.       249,  248,  247,  246,  219,  245,  244,  243,  242,  241,
  484.       213,  240,  239,  238,  237,  236,  235,  234,  233,  232,
  485.       231,  230,  229,  228,  227,  226,  225,  224,  223,   69,
  486.  
  487.        70,   72,   20,   72,   73,   74,  222,  187,  221,   73,
  488.       186,  220,  219,  218,  217,   75,  216,   76,  215,   77,
  489.       214,  213,  211,  210,  209,  208,  207,  206,  205,  204,
  490.       203,  202,  201,  200,  199,  198,  197,  196,   78,  195,
  491.       194,  193,  192,  191,  190,   79,   80,   72,   20,   72,
  492.        73,   74,  189,  188,  187,   73,  186,  146,  182,  181,
  493.       135,   75,  180,   76,  179,   77,  178,  177,  176,  128,
  494.       174,  173,  170,  166,  165,  164,  163,  160,  159,  158,
  495.       157,  156,  155,  154,   78,  153,  152,  104,  146,  144,
  496.        97,   79,   80,   87,   20,   87,   88,  137,  136,  135,
  497.  
  498.       134,   88,   89,   90,  133,  132,  131,   91,   87,   20,
  499.        87,   88,  130,  125,  122,  121,   88,   89,   90,  117,
  500.       116,  115,   91,  273,  273,  273,  273,  273,  273,  274,
  501.       273,  273,  273,  275,  273,  273,  273,  273,  273,  274,
  502.       273,  273,  273,  274,  273,  273,  274,  274,  274,  274,
  503.       274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
  504.       274,  274,  274,  274,  274,  274,  274,  274,  273,  273,
  505.        50,   50,   50,   50,   50,   59,   59,   59,   59,   59,
  506.        65,   65,   65,   65,   65,   71,   71,   71,   71,   71,
  507.        81,   81,   81,   81,   81,   86,   86,   86,   86,   86,
  508.  
  509.        92,   92,   92,   92,   92,   98,   98,  103,  103,  103,
  510.       103,  103,  126,  126,  126,  126,  126,  140,  140,  140,
  511.       140,  145,  145,  145,  145,  145,  183,  183,  183,  183,
  512.       183,  185,  185,  185,  185,  185,  212,  212,  212,  212,
  513.       212,  273,  273,  273,  273,  273,  291,  291,  291,  291,
  514.       291,  300,  300,  311,  311,  312,  312,  312,  312,  312,
  515.       114,  113,  110,  109,  104,  102,   99,   97,  322,   49,
  516.        17,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  517.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  518.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  519.  
  520.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  521.       322,  322,  322,  322,  322,  322,  322,  322
  522.     } ;
  523.  
  524. static yyconst short int yy_chk[619] =
  525.     {   0,
  526.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  527.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  528.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  529.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  530.         1,    1,    1,    1,    1,    1,    1,    3,    3,    3,
  531.        11,   11,   11,   11,   19,  320,   19,   30,   11,   47,
  532.        30,    3,    3,   34,   11,   34,   12,   12,   12,   12,
  533.         3,   47,   12,    3,   12,   15,   15,   15,    3,    3,
  534.        12,  318,    3,    4,    4,    4,   16,   16,   16,   15,
  535.        35,   15,   35,   38,   44,   44,   52,    4,    4,   52,
  536.  
  537.        16,   38,   16,   44,  102,   51,    4,   51,   85,    4,
  538.        53,   53,  102,   63,    4,    4,   63,  317,    4,    5,
  539.         5,    5,    5,  143,   60,   53,   60,    5,   66,   68,
  540.        66,    5,   68,    5,   72,    5,   72,   75,  143,   82,
  541.        75,   82,   84,  129,  129,   84,   85,   87,   91,   87,
  542.        93,   91,   93,   95,  314,   96,   95,   96,  129,  312,
  543.       105,  105,  115,    5,    6,    6,    6,    6,  105,  115,
  544.       120,  183,    6,  120,  122,  105,    6,  141,    6,  141,
  545.         6,  122,  127,  127,  120,  127,  183,  244,  254,  267,
  546.       286,  308,  305,  286,  304,  303,  302,  301,  299,  254,
  547.  
  548.       297,  295,  244,  254,  267,  294,  293,  291,    6,    7,
  549.         7,    7,    7,  290,  289,  288,  285,    7,  284,  283,
  550.       282,  280,  279,    7,  278,  277,  276,  275,  273,  272,
  551.       271,  270,  268,  266,  265,  264,  262,  261,  259,  256,
  552.       250,  249,  248,  246,  245,  243,  242,  241,  240,  239,
  553.       237,  236,  235,    7,    7,    8,    8,    8,    8,  234,
  554.       233,  231,  230,    8,  229,  227,  226,  225,  224,    8,
  555.       223,  222,  221,  220,  219,  218,  217,  216,  215,  214,
  556.       212,  210,  209,  208,  207,  206,  205,  204,  203,  202,
  557.       201,  199,  198,  197,  196,  194,  191,  190,  189,    8,
  558.  
  559.         8,    9,    9,    9,    9,    9,  188,  187,  186,    9,
  560.       185,  182,  181,  180,  179,    9,  178,    9,  177,    9,
  561.       176,  175,  174,  173,  172,  171,  170,  169,  168,  167,
  562.       166,  165,  164,  163,  161,  160,  159,  158,    9,  157,
  563.       156,  155,  154,  152,  151,    9,    9,   10,   10,   10,
  564.        10,   10,  150,  149,  148,   10,  147,  145,  137,  136,
  565.       135,   10,  134,   10,  133,   10,  132,  131,  130,  126,
  566.       124,  123,  121,  119,  118,  117,  116,  114,  113,  112,
  567.       111,  110,  109,  108,   10,  107,  106,  103,  101,   99,
  568.        97,   10,   10,   13,   13,   13,   13,   78,   77,   74,
  569.  
  570.        58,   13,   13,   13,   57,   56,   55,   13,   14,   14,
  571.        14,   14,   54,   49,   46,   45,   14,   14,   14,   43,
  572.        42,   41,   14,  251,  251,  251,  251,  251,  251,  251,
  573.       251,  251,  251,  251,  251,  251,  251,  251,  251,  251,
  574.       251,  251,  251,  251,  251,  251,  251,  251,  251,  251,
  575.       251,  251,  251,  251,  251,  251,  251,  251,  251,  251,
  576.       251,  251,  251,  251,  251,  251,  251,  251,  251,  251,
  577.       323,  323,  323,  323,  323,  324,  324,  324,  324,  324,
  578.       325,  325,  325,  325,  325,  326,  326,  326,  326,  326,
  579.       327,  327,  327,  327,  327,  328,  328,  328,  328,  328,
  580.  
  581.       329,  329,  329,  329,  329,  330,  330,  331,  331,  331,
  582.       331,  331,  332,  332,  332,  332,  332,  333,  333,  333,
  583.       333,  334,  334,  334,  334,  334,  335,  335,  335,  335,
  584.       335,  336,  336,  336,  336,  336,  337,  337,  337,  337,
  585.       337,  338,  338,  338,  338,  338,  339,  339,  339,  339,
  586.       339,  340,  340,  341,  341,  342,  342,  342,  342,  342,
  587.        40,   39,   37,   36,   33,   32,   29,   22,   17,    2,
  588.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  589.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  590.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  591.  
  592.       322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
  593.       322,  322,  322,  322,  322,  322,  322,  322
  594.     } ;
  595.  
  596. static yy_state_type yy_last_accepting_state;
  597. static char *yy_last_accepting_cpos;
  598.  
  599. /* The intent behind this definition is that it'll catch
  600.  * any uses of REJECT which flex missed.
  601.  */
  602. #define REJECT reject_used_but_not_detected
  603. #define yymore() yymore_used_but_not_detected
  604. #define YY_MORE_ADJ 0
  605. #define YY_RESTORE_YY_MORE_OFFSET
  606. char *yytext;
  607. #line 1 "lex.l"
  608. #define INITIAL 0
  609. #line 2 "lex.l"
  610. /* $Id: lex_yy.c,v 4.5 1996/04/13 04:29:18 cthuang Exp $
  611.  *
  612.  * Lexical analyzer for C function prototype generator
  613.  *
  614.  *    This is designed to parse lexically at the top level (e.g., of extern
  615.  *    objects such as procedures).  The corresponding yacc-grammar expects
  616.  *    that curly-braces (for function bodies) are recognized as a single
  617.  *    token, BRACES.  Similarly, square-brackets and their contents are
  618.  *    passed back as BRACKETS.
  619.  *
  620.  *    Assignments at the top level are data-initialization statements.
  621.  *    These are returned as INITIALIZER.
  622.  *
  623.  *    The logic here recognizes tokens inside curly-braces, but does not
  624.  *    pass them back to the grammar.
  625.  *
  626.  * Apollo extensions:
  627.  *    "&" is ignored when creating lint-libraries, because we ignore
  628.  *    expressions of all kinds.  Note that function-prototypes may use "&" to
  629.  *    denote reference-parameters.  By ignoring that as well, we make the
  630.  *    output compatible with lint (kludge).
  631.  *
  632.  *    Similarly, ignore "std_$call", since it is not compatible with lint.
  633.  *
  634.  *    CPP_INLINE handles a special case of the Apollo CC 6.7 compiler that
  635.  *    uses inline attribute declarations, e.g.
  636.  *
  637.  *        int    foo #attribute[aligned(1)];
  638.  *
  639.  *    In CC 6.8 this behavior is hidden by a macro.
  640.  *
  641.  * VAX/VMS extensions:
  642.  *    Treat the keywords 'globalref', etc., as 'extern'.
  643.  *
  644.  *    The keywords 'noshare' and 'readonly' are type-qualifiers.
  645.  *
  646.  * GCC extensions:
  647.  *    The keywords '__attribute__', '__inline', '__inline__', '__signed',
  648.  *    '__signed__'.
  649.  */
  650.  
  651. #define    result(nn)    count(); if (!brackets && unnested()) return(nn)
  652.  
  653. #define    is_IDENTIFIER        save_text_offset();\
  654.                 return type_of_name(yytext);
  655.  
  656. #if !OPT_LINTLIBRARY
  657. #define gcc_attribute   absorb_special /* otherwise, we don't care */
  658. #endif
  659.  
  660. #ifdef    apollo
  661. #define    apollo_keyword
  662. #define    apollo_special    absorb_special()
  663. #else
  664. #define    apollo_keyword    is_IDENTIFIER
  665. #define    apollo_special    is_IDENTIFIER
  666. #endif
  667.  
  668. #ifdef    vms
  669. #define    vms_extern    save_text_offset(); return(T_EXTERN);
  670. #define    vms_keyword    save_text_offset();
  671. #else    /* unix */
  672. #define    vms_extern    is_IDENTIFIER
  673. #define    vms_keyword    is_IDENTIFIER
  674. #endif    /* vms/unix */
  675.  
  676. char *    varargs_str;        /* save printflike/scanflike text */
  677. int    varargs_num;        /* code to save "VARARGS" */
  678. int    debug_trace;        /* true if we trace token-level stuff */
  679. char    base_file[BUFSIZ];    /* top-level file name */
  680.  
  681. static int save_cpp;    /* true if cpp-text within curly braces */
  682. static int in_cpp;    /* true while we are within cpp-text */
  683. static int curly;    /* number of curly brace nesting levels */
  684. static int ly_count;    /* number of occurances of %% */
  685.  
  686. #ifdef FLEX_SCANNER
  687. /* flex scanner state */
  688. static YY_BUFFER_STATE buffer_stack[MAX_INC_DEPTH];
  689. #endif
  690.  
  691. static int inc_depth;                /* include nesting level */
  692. static IncludeStack inc_stack[MAX_INC_DEPTH];    /* stack of included files */
  693. static SymbolTable *included_files;        /* files already included */
  694.  
  695. static int  type_of_name      ARGS((char *name));
  696. static void startCpp          ARGS((int level));
  697. static void finishCpp         ARGS((void));
  698. #if defined(apollo) || !OPT_LINTLIBRARY
  699. static void absorb_special    ARGS((void));
  700. #endif
  701. #if OPT_LINTLIBRARY
  702. static void gcc_attribute     ARGS((void));
  703. #endif
  704. static void update_line_num   ARGS((void));
  705. static void save_text         ARGS((void));
  706. static void save_text_offset  ARGS((void));
  707. static void get_quoted        ARGS((void));
  708. static void get_comment       ARGS((void));
  709. static void get_cpp_directive ARGS((char *dest, unsigned n));
  710. static void do_include        ARGS((char *f));
  711. static void include_file      ARGS((char *name, int convert));
  712. static void put_file          ARGS((FILE *outf));
  713. static void put_quoted        ARGS((int c));
  714.  
  715. #if OPT_LINTLIBRARY
  716. static int decipher_comment   ARGS((char *keyword, int len));
  717. #endif
  718.  
  719. #ifdef yywrap
  720. #undef yywrap
  721. #endif
  722. int yywrap ARGS((void));
  723. #define CPP1 1
  724. #define INIT1 2
  725. #define INIT2 3
  726. #define CURLY 4
  727. #define LEXYACC 5
  728. #define ASM 6
  729. #define CPP_INLINE 7
  730.  
  731. #line 732 "lex.yy.c"
  732.  
  733. /* Macros after this point can all be overridden by user definitions in
  734.  * section 1.
  735.  */
  736.  
  737. #ifndef YY_SKIP_YYWRAP
  738. #ifdef __cplusplus
  739. extern "C" int yywrap YY_PROTO(( void ));
  740. #else
  741. extern int yywrap YY_PROTO(( void ));
  742. #endif
  743. #endif
  744.  
  745. #ifndef YY_NO_UNPUT
  746. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  747. #endif
  748.  
  749. #ifndef yytext_ptr
  750. static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
  751. #endif
  752.  
  753. #ifdef YY_NEED_STRLEN
  754. static int yy_flex_strlen YY_PROTO(( yyconst char * ));
  755. #endif
  756.  
  757. #ifndef YY_NO_INPUT
  758. #ifdef __cplusplus
  759. static int yyinput YY_PROTO(( void ));
  760. #else
  761. static int input YY_PROTO(( void ));
  762. #endif
  763. #endif
  764.  
  765. #if YY_STACK_USED
  766. static int yy_start_stack_ptr = 0;
  767. static int yy_start_stack_depth = 0;
  768. static int *yy_start_stack = 0;
  769. #ifndef YY_NO_PUSH_STATE
  770. static void yy_push_state YY_PROTO(( int new_state ));
  771. #endif
  772. #ifndef YY_NO_POP_STATE
  773. static void yy_pop_state YY_PROTO(( void ));
  774. #endif
  775. #ifndef YY_NO_TOP_STATE
  776. static int yy_top_state YY_PROTO(( void ));
  777. #endif
  778.  
  779. #else
  780. #define YY_NO_PUSH_STATE 1
  781. #define YY_NO_POP_STATE 1
  782. #define YY_NO_TOP_STATE 1
  783. #endif
  784.  
  785. #ifdef YY_MALLOC_DECL
  786. YY_MALLOC_DECL
  787. #else
  788. #if __STDC__
  789. #ifndef __cplusplus
  790. #include <stdlib.h>
  791. #endif
  792. #else
  793. /* Just try to get by without declaring the routines.  This will fail
  794.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  795.  * or sizeof(void*) != sizeof(int).
  796.  */
  797. #endif
  798. #endif
  799.  
  800. /* Amount of stuff to slurp up with each read. */
  801. #ifndef YY_READ_BUF_SIZE
  802. #define YY_READ_BUF_SIZE 8192
  803. #endif
  804.  
  805. /* Copy whatever the last rule matched to the standard output. */
  806.  
  807. #ifndef ECHO
  808. /* This used to be an fputs(), but since the string might contain NUL's,
  809.  * we now use fwrite().
  810.  */
  811. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  812. #endif
  813.  
  814. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  815.  * is returned in "result".
  816.  */
  817. #ifndef YY_INPUT
  818. #define YY_INPUT(buf,result,max_size) \
  819.     if ( yy_current_buffer->yy_is_interactive ) \
  820.         { \
  821.         int c = '*', n; \
  822.         for ( n = 0; n < max_size && \
  823.                  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  824.             buf[n] = (char) c; \
  825.         if ( c == '\n' ) \
  826.             buf[n++] = (char) c; \
  827.         if ( c == EOF && ferror( yyin ) ) \
  828.             YY_FATAL_ERROR( "input in flex scanner failed" ); \
  829.         result = n; \
  830.         } \
  831.     else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
  832.           && ferror( yyin ) ) \
  833.         YY_FATAL_ERROR( "input in flex scanner failed" );
  834. #endif
  835.  
  836. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  837.  * we don't want an extra ';' after the "return" because that will cause
  838.  * some compilers to complain about unreachable statements.
  839.  */
  840. #ifndef yyterminate
  841. #define yyterminate() return YY_NULL
  842. #endif
  843.  
  844. /* Number of entries by which start-condition stack grows. */
  845. #ifndef YY_START_STACK_INCR
  846. #define YY_START_STACK_INCR 25
  847. #endif
  848.  
  849. /* Report a fatal error. */
  850. #ifndef YY_FATAL_ERROR
  851. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  852. #endif
  853.  
  854. /* Default declaration of generated scanner - a define so the user can
  855.  * easily add parameters.
  856.  */
  857. #ifndef YY_DECL
  858. #define YY_DECL int yylex YY_PROTO(( void ))
  859. #endif
  860.  
  861. /* Code executed at the beginning of each rule, after yytext and yyleng
  862.  * have been set up.
  863.  */
  864. #ifndef YY_USER_ACTION
  865. #define YY_USER_ACTION
  866. #endif
  867.  
  868. /* Code executed at the end of each rule. */
  869. #ifndef YY_BREAK
  870. #define YY_BREAK break;
  871. #endif
  872.  
  873. #define YY_RULE_SETUP \
  874.     if ( yyleng > 0 ) \
  875.         yy_current_buffer->yy_at_bol = \
  876.                 (yytext[yyleng - 1] == '\n'); \
  877.     YY_USER_ACTION
  878.  
  879. YY_DECL
  880.     {
  881.     register yy_state_type yy_current_state;
  882.     register char *yy_cp, *yy_bp;
  883.     register int yy_act;
  884.  
  885. #line 124 "lex.l"
  886.  
  887.  
  888. #line 889 "lex.yy.c"
  889.  
  890.     if ( yy_init )
  891.         {
  892.         yy_init = 0;
  893.  
  894. #ifdef YY_USER_INIT
  895.         YY_USER_INIT;
  896. #endif
  897.  
  898.         if ( ! yy_start )
  899.             yy_start = 1;    /* first start state */
  900.  
  901.         if ( ! yyin )
  902.             yyin = stdin;
  903.  
  904.         if ( ! yyout )
  905.             yyout = stdout;
  906.  
  907.         if ( ! yy_current_buffer )
  908.             yy_current_buffer =
  909.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  910.  
  911.         yy_load_buffer_state();
  912.         }
  913.  
  914.     while ( 1 )        /* loops until end-of-file is reached */
  915.         {
  916.         yy_cp = yy_c_buf_p;
  917.  
  918.         /* Support of yytext. */
  919.         *yy_cp = yy_hold_char;
  920.  
  921.         /* yy_bp points to the position in yy_ch_buf of the start of
  922.          * the current run.
  923.          */
  924.         yy_bp = yy_cp;
  925.  
  926.         yy_current_state = yy_start;
  927.         yy_current_state += YY_AT_BOL();
  928. yy_match:
  929.         do
  930.             {
  931.             register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  932.             if ( yy_accept[yy_current_state] )
  933.                 {
  934.                 yy_last_accepting_state = yy_current_state;
  935.                 yy_last_accepting_cpos = yy_cp;
  936.                 }
  937.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  938.                 {
  939.                 yy_current_state = (int) yy_def[yy_current_state];
  940.                 if ( yy_current_state >= 323 )
  941.                     yy_c = yy_meta[(unsigned int) yy_c];
  942.                 }
  943.             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  944.             ++yy_cp;
  945.             }
  946.         while ( yy_base[yy_current_state] != 571 );
  947.  
  948. yy_find_action:
  949.         yy_act = yy_accept[yy_current_state];
  950.         if ( yy_act == 0 )
  951.             { /* have to back up */
  952.             yy_cp = yy_last_accepting_cpos;
  953.             yy_current_state = yy_last_accepting_state;
  954.             yy_act = yy_accept[yy_current_state];
  955.             }
  956.  
  957.         YY_DO_BEFORE_ACTION;
  958.  
  959.  
  960. do_action:    /* This label is used only to access EOF actions. */
  961.  
  962.  
  963.         switch ( yy_act )
  964.     { /* beginning of action switch */
  965.             case 0: /* must back up */
  966.             /* undo the effects of YY_DO_BEFORE_ACTION */
  967.             *yy_cp = yy_hold_char;
  968.             yy_cp = yy_last_accepting_cpos;
  969.             yy_current_state = yy_last_accepting_state;
  970.             goto yy_find_action;
  971.  
  972. case 1:
  973. YY_RULE_SETUP
  974. #line 126 "lex.l"
  975. { save_text(); cur_file->line_num++;
  976.                 cur_declarator = NULL; }
  977.     YY_BREAK
  978. case 2:
  979. YY_RULE_SETUP
  980. #line 129 "lex.l"
  981. { save_text(); get_comment(); }
  982.     YY_BREAK
  983. case 3:
  984. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  985. yy_c_buf_p = yy_cp -= 1;
  986. YY_DO_BEFORE_ACTION; /* set up yytext again */
  987. YY_RULE_SETUP
  988. #line 130 "lex.l"
  989. save_text();
  990.     YY_BREAK
  991. case 4:
  992. YY_RULE_SETUP
  993. #line 132 "lex.l"
  994. { save_text(); return '&'; /* C++ ref-variable? */ }
  995.     YY_BREAK
  996. case 5:
  997. YY_RULE_SETUP
  998. #line 134 "lex.l"
  999. { save_text(); if (++ly_count >= 2) BEGIN INITIAL; }
  1000.     YY_BREAK
  1001. case 6:
  1002. YY_RULE_SETUP
  1003. #line 135 "lex.l"
  1004. { save_text(); BEGIN INITIAL; }
  1005.     YY_BREAK
  1006. case 7:
  1007. YY_RULE_SETUP
  1008. #line 136 "lex.l"
  1009. get_quoted();
  1010.     YY_BREAK
  1011. case 8:
  1012. YY_RULE_SETUP
  1013. #line 137 "lex.l"
  1014. save_text();
  1015.     YY_BREAK
  1016. case 9:
  1017. YY_RULE_SETUP
  1018. #line 138 "lex.l"
  1019. { save_text(); BEGIN LEXYACC; }
  1020.     YY_BREAK
  1021. case 10:
  1022. YY_RULE_SETUP
  1023. #line 140 "lex.l"
  1024. { save_text(); startCpp(0); }
  1025.     YY_BREAK
  1026. case 11:
  1027. YY_RULE_SETUP
  1028. #line 141 "lex.l"
  1029. { save_text(); startCpp(0); }
  1030.     YY_BREAK
  1031. case 12:
  1032. YY_RULE_SETUP
  1033. #line 143 "lex.l"
  1034. { BEGIN CPP_INLINE; /* apollo */}
  1035.     YY_BREAK
  1036. case 13:
  1037. YY_RULE_SETUP
  1038. #line 144 "lex.l"
  1039. { BEGIN CPP_INLINE; /* apollo */}
  1040.     YY_BREAK
  1041. case 14:
  1042. YY_RULE_SETUP
  1043. #line 145 "lex.l"
  1044. finishCpp();
  1045.     YY_BREAK
  1046. case 15:
  1047. YY_RULE_SETUP
  1048. #line 147 "lex.l"
  1049. {
  1050.                 char name[MAX_TEXT_SIZE], value[MAX_TEXT_SIZE];
  1051.  
  1052.                 save_text();
  1053.                 sscanf(yytext, "define %s", name);
  1054.                 get_cpp_directive(buf, sizeof(buf));
  1055.                 sscanf(buf, "%s", value);
  1056.                 new_symbol(define_names, name, value, DS_NONE);
  1057.             }
  1058.     YY_BREAK
  1059. case 16:
  1060. YY_RULE_SETUP
  1061. #line 157 "lex.l"
  1062. {
  1063.                 save_text();
  1064.                 get_cpp_directive(buf, sizeof(buf));
  1065.                 if (buf[0] != '"' && buf[0] != '<') {
  1066.                 Symbol *sym = find_symbol(define_names, buf);
  1067.                 if (sym != NULL && sym->value != NULL) {
  1068.                     strcpy(buf, sym->value);
  1069.                 } else {
  1070.                     buf[0] = '\0';
  1071.                 }
  1072.                 }
  1073.                 if (buf[0] != '\0')
  1074.                 do_include(buf);
  1075.             }
  1076.     YY_BREAK
  1077. case 17:
  1078. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1079. yy_c_buf_p = yy_cp -= 1;
  1080. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1081. YY_RULE_SETUP
  1082. #line 172 "lex.l"
  1083. {
  1084.                 save_text();
  1085.                 sscanf(yytext, "line %d \"%[^\"]\"",
  1086.                  &cur_file->line_num, cur_file->file_name);
  1087.                 cur_file->line_num--;
  1088.                 track_in();
  1089.                 finishCpp();
  1090.             }
  1091.     YY_BREAK
  1092. case 18:
  1093. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1094. yy_c_buf_p = yy_cp -= 1;
  1095. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1096. YY_RULE_SETUP
  1097. #line 180 "lex.l"
  1098. {
  1099.                 save_text();
  1100.                 sscanf(yytext, "%d \"%[^\"]\"", &cur_file->line_num,
  1101.                  cur_file->file_name);
  1102.                 cur_file->line_num--;
  1103.                 track_in();
  1104.                 finishCpp();
  1105.             }
  1106.     YY_BREAK
  1107. case 19:
  1108. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1109. yy_c_buf_p = yy_cp -= 1;
  1110. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1111. YY_RULE_SETUP
  1112. #line 188 "lex.l"
  1113. {
  1114.                 save_text();
  1115.                 sscanf(yytext, "%d ", &cur_file->line_num);
  1116.                 cur_file->line_num--;
  1117.                 track_in();
  1118.                 finishCpp();
  1119.             }
  1120.     YY_BREAK
  1121. case 20:
  1122. YY_RULE_SETUP
  1123. #line 196 "lex.l"
  1124. { save_text(); get_cpp_directive(NULL, 0); }
  1125.     YY_BREAK
  1126. case 21:
  1127. YY_RULE_SETUP
  1128. #line 198 "lex.l"
  1129. { save_text_offset(); return '('; }
  1130.     YY_BREAK
  1131. case 22:
  1132. YY_RULE_SETUP
  1133. #line 199 "lex.l"
  1134. {
  1135.                 save_text();
  1136.                 if (cur_file->convert)
  1137.                 cur_file->begin_comment =
  1138.                  ftell(cur_file->tmp_file);
  1139.                 return ')';
  1140.             }
  1141.     YY_BREAK
  1142. case 23:
  1143. YY_RULE_SETUP
  1144. #line 206 "lex.l"
  1145. { save_text_offset(); return '*'; }
  1146.     YY_BREAK
  1147. case 24:
  1148. YY_RULE_SETUP
  1149. #line 207 "lex.l"
  1150. {
  1151.                 save_text();
  1152.                 if (cur_file->convert)
  1153.                 cur_file->begin_comment =
  1154.                  ftell(cur_file->tmp_file);
  1155.                 return yytext[0];
  1156.             }
  1157.     YY_BREAK
  1158. case 25:
  1159. YY_RULE_SETUP
  1160. #line 214 "lex.l"
  1161. { save_text(); return T_ELLIPSIS; }
  1162.     YY_BREAK
  1163. case 26:
  1164. YY_RULE_SETUP
  1165. #line 215 "lex.l"
  1166. {
  1167.                 get_quoted();
  1168.                 return T_STRING_LITERAL;
  1169.             }
  1170.     YY_BREAK
  1171. case 27:
  1172. YY_RULE_SETUP
  1173. #line 220 "lex.l"
  1174. { save_text(); BEGIN ASM; return T_ASM; }
  1175.     YY_BREAK
  1176. case 28:
  1177. YY_RULE_SETUP
  1178. #line 221 "lex.l"
  1179. save_text();
  1180.     YY_BREAK
  1181. case 29:
  1182. YY_RULE_SETUP
  1183. #line 222 "lex.l"
  1184. { save_text(); BEGIN INITIAL; return T_ASMARG; }
  1185.     YY_BREAK
  1186. case 30:
  1187. YY_RULE_SETUP
  1188. #line 223 "lex.l"
  1189. get_quoted();
  1190.     YY_BREAK
  1191. case 31:
  1192. YY_RULE_SETUP
  1193. #line 224 "lex.l"
  1194. save_text();
  1195.     YY_BREAK
  1196. case 32:
  1197. YY_RULE_SETUP
  1198. #line 226 "lex.l"
  1199. { save_text_offset(); return T_TYPE_QUALIFIER; }
  1200.     YY_BREAK
  1201. case 33:
  1202. YY_RULE_SETUP
  1203. #line 228 "lex.l"
  1204. { save_text_offset(); return T_AUTO; }
  1205.     YY_BREAK
  1206. case 34:
  1207. YY_RULE_SETUP
  1208. #line 229 "lex.l"
  1209. { save_text_offset(); return T_EXTERN; }
  1210.     YY_BREAK
  1211. case 35:
  1212. YY_RULE_SETUP
  1213. #line 230 "lex.l"
  1214. { save_text_offset(); return T_REGISTER; }
  1215.     YY_BREAK
  1216. case 36:
  1217. YY_RULE_SETUP
  1218. #line 231 "lex.l"
  1219. { save_text_offset(); return T_STATIC; }
  1220.     YY_BREAK
  1221. case 37:
  1222. YY_RULE_SETUP
  1223. #line 232 "lex.l"
  1224. { save_text_offset(); return T_TYPEDEF; }
  1225.     YY_BREAK
  1226. case 38:
  1227. YY_RULE_SETUP
  1228. #line 233 "lex.l"
  1229. { save_text_offset(); return T_INLINE; }
  1230.     YY_BREAK
  1231. case 39:
  1232. YY_RULE_SETUP
  1233. #line 234 "lex.l"
  1234. { save_text_offset(); return T_CHAR; }
  1235.     YY_BREAK
  1236. case 40:
  1237. YY_RULE_SETUP
  1238. #line 235 "lex.l"
  1239. { save_text_offset(); return T_DOUBLE; }
  1240.     YY_BREAK
  1241. case 41:
  1242. YY_RULE_SETUP
  1243. #line 236 "lex.l"
  1244. { save_text_offset(); return T_FLOAT; }
  1245.     YY_BREAK
  1246. case 42:
  1247. YY_RULE_SETUP
  1248. #line 237 "lex.l"
  1249. { save_text_offset(); return T_INT; }
  1250.     YY_BREAK
  1251. case 43:
  1252. YY_RULE_SETUP
  1253. #line 238 "lex.l"
  1254. { save_text_offset(); return T_VOID; }
  1255.     YY_BREAK
  1256. case 44:
  1257. YY_RULE_SETUP
  1258. #line 239 "lex.l"
  1259. { save_text_offset(); return T_LONG; }
  1260.     YY_BREAK
  1261. case 45:
  1262. YY_RULE_SETUP
  1263. #line 240 "lex.l"
  1264. { save_text_offset(); return T_SHORT; }
  1265.     YY_BREAK
  1266. case 46:
  1267. YY_RULE_SETUP
  1268. #line 241 "lex.l"
  1269. { save_text_offset(); return T_SIGNED; }
  1270.     YY_BREAK
  1271. case 47:
  1272. YY_RULE_SETUP
  1273. #line 242 "lex.l"
  1274. { save_text_offset(); return T_UNSIGNED; }
  1275.     YY_BREAK
  1276. case 48:
  1277. YY_RULE_SETUP
  1278. #line 243 "lex.l"
  1279. { save_text_offset(); return T_ENUM; }
  1280.     YY_BREAK
  1281. case 49:
  1282. YY_RULE_SETUP
  1283. #line 244 "lex.l"
  1284. { save_text_offset(); return T_STRUCT; }
  1285.     YY_BREAK
  1286. case 50:
  1287. YY_RULE_SETUP
  1288. #line 245 "lex.l"
  1289. { save_text_offset(); return T_UNION; }
  1290.     YY_BREAK
  1291. case 51:
  1292. YY_RULE_SETUP
  1293. #line 246 "lex.l"
  1294. { save_text_offset(); return T_VA_DCL; }
  1295.     YY_BREAK
  1296. case 52:
  1297. YY_RULE_SETUP
  1298. #line 248 "lex.l"
  1299. { save_text_offset(); return T_SIGNED; }
  1300.     YY_BREAK
  1301. case 53:
  1302. YY_RULE_SETUP
  1303. #line 249 "lex.l"
  1304. { save_text_offset(); return T_SIGNED; }
  1305.     YY_BREAK
  1306. case 54:
  1307. YY_RULE_SETUP
  1308. #line 250 "lex.l"
  1309. { save_text_offset(); return T_INLINE; }
  1310.     YY_BREAK
  1311. case 55:
  1312. YY_RULE_SETUP
  1313. #line 251 "lex.l"
  1314. { save_text_offset(); return T_INLINE; }
  1315.     YY_BREAK
  1316. case 56:
  1317. YY_RULE_SETUP
  1318. #line 252 "lex.l"
  1319. { gcc_attribute(); }
  1320.     YY_BREAK
  1321. case 57:
  1322. YY_RULE_SETUP
  1323. #line 254 "lex.l"
  1324. { vms_extern; }
  1325.     YY_BREAK
  1326. case 58:
  1327. YY_RULE_SETUP
  1328. #line 255 "lex.l"
  1329. { vms_extern; }
  1330.     YY_BREAK
  1331. case 59:
  1332. YY_RULE_SETUP
  1333. #line 256 "lex.l"
  1334. { vms_extern; }
  1335.     YY_BREAK
  1336. case 60:
  1337. YY_RULE_SETUP
  1338. #line 258 "lex.l"
  1339. { apollo_keyword; }
  1340.     YY_BREAK
  1341. case 61:
  1342. YY_RULE_SETUP
  1343. #line 259 "lex.l"
  1344. { apollo_special; }
  1345.     YY_BREAK
  1346. case 62:
  1347. YY_RULE_SETUP
  1348. #line 261 "lex.l"
  1349. { is_IDENTIFIER }
  1350.     YY_BREAK
  1351. case 63:
  1352. YY_RULE_SETUP
  1353. #line 263 "lex.l"
  1354. {
  1355.                 /* This can't handle the case where a comment
  1356.                  * containing a ] appears between the brackets.
  1357.                  */
  1358.                 save_text_offset();
  1359.                 update_line_num();
  1360.                 return T_BRACKETS;
  1361.             }
  1362.     YY_BREAK
  1363. case 64:
  1364. YY_RULE_SETUP
  1365. #line 271 "lex.l"
  1366. {
  1367.                 save_text_offset();
  1368.                 update_line_num();
  1369.                 return T_BRACKETS;
  1370.             }
  1371.     YY_BREAK
  1372. case 65:
  1373. YY_RULE_SETUP
  1374. #line 277 "lex.l"
  1375. { save_text(); BEGIN INIT1; return '='; }
  1376.     YY_BREAK
  1377. case 66:
  1378. YY_RULE_SETUP
  1379. #line 278 "lex.l"
  1380. { save_text(); curly = 1; BEGIN INIT2; }
  1381.     YY_BREAK
  1382. case 67:
  1383. YY_RULE_SETUP
  1384. #line 279 "lex.l"
  1385. {
  1386.                 unput(yytext[yyleng-1]);
  1387.                 BEGIN INITIAL;
  1388.                 return T_INITIALIZER;
  1389.             }
  1390.     YY_BREAK
  1391. case 68:
  1392. YY_RULE_SETUP
  1393. #line 284 "lex.l"
  1394. get_quoted();
  1395.     YY_BREAK
  1396. case 69:
  1397. YY_RULE_SETUP
  1398. #line 285 "lex.l"
  1399. save_text();
  1400.     YY_BREAK
  1401. case 70:
  1402. YY_RULE_SETUP
  1403. #line 287 "lex.l"
  1404. { save_text(); ++curly; }
  1405.     YY_BREAK
  1406. case 71:
  1407. YY_RULE_SETUP
  1408. #line 288 "lex.l"
  1409. {
  1410.                 save_text();
  1411.                 if (--curly == 0) {
  1412.                 BEGIN INITIAL;
  1413.                 return T_INITIALIZER;
  1414.                 }
  1415.             }
  1416.     YY_BREAK
  1417. case 72:
  1418. YY_RULE_SETUP
  1419. #line 295 "lex.l"
  1420. get_quoted();
  1421.     YY_BREAK
  1422. case 73:
  1423. YY_RULE_SETUP
  1424. #line 296 "lex.l"
  1425. save_text();
  1426.     YY_BREAK
  1427. case 74:
  1428. YY_RULE_SETUP
  1429. #line 298 "lex.l"
  1430. {
  1431.                 save_text();
  1432.                 curly = 1;
  1433.                 return_val =
  1434.                 returned_at = FALSE;
  1435.                 BEGIN CURLY;
  1436.                 return T_LBRACE;
  1437.             }
  1438.     YY_BREAK
  1439. case 75:
  1440. YY_RULE_SETUP
  1441. #line 306 "lex.l"
  1442. { save_text(); ++curly; }
  1443.     YY_BREAK
  1444. case 76:
  1445. YY_RULE_SETUP
  1446. #line 307 "lex.l"
  1447. {
  1448.                 save_text();
  1449.                 if (--curly == 0) {
  1450.                 BEGIN INITIAL;
  1451.                 return T_MATCHRBRACE;
  1452.                 }
  1453.             }
  1454.     YY_BREAK
  1455. case 77:
  1456. YY_RULE_SETUP
  1457. #line 314 "lex.l"
  1458. get_quoted();
  1459.     YY_BREAK
  1460. case 78:
  1461. YY_RULE_SETUP
  1462. #line 315 "lex.l"
  1463. { save_text(); returned_at = TRUE; }
  1464.     YY_BREAK
  1465. case 79:
  1466. YY_RULE_SETUP
  1467. #line 316 "lex.l"
  1468. { save_text(); returned_at = FALSE; }
  1469.     YY_BREAK
  1470. case 80:
  1471. YY_RULE_SETUP
  1472. #line 317 "lex.l"
  1473. { save_text(); startCpp(1); }
  1474.     YY_BREAK
  1475. case 81:
  1476. YY_RULE_SETUP
  1477. #line 318 "lex.l"
  1478. { save_text(); startCpp(1); }
  1479.     YY_BREAK
  1480. case 82:
  1481. YY_RULE_SETUP
  1482. #line 319 "lex.l"
  1483. { save_text(); return_val |= returned_at; }
  1484.     YY_BREAK
  1485. case 83:
  1486. YY_RULE_SETUP
  1487. #line 321 "lex.l"
  1488. save_text();
  1489.     YY_BREAK
  1490. case 84:
  1491. YY_RULE_SETUP
  1492. #line 322 "lex.l"
  1493. {
  1494.                 save_text();
  1495.                 put_error();
  1496.                 fprintf(stderr, "bad character '%c'\n", yytext[0]);
  1497.             }
  1498.     YY_BREAK
  1499. case 85:
  1500. YY_RULE_SETUP
  1501. #line 327 "lex.l"
  1502. ECHO;
  1503.     YY_BREAK
  1504. #line 1505 "lex.yy.c"
  1505. case YY_STATE_EOF(INITIAL):
  1506. case YY_STATE_EOF(CPP1):
  1507. case YY_STATE_EOF(INIT1):
  1508. case YY_STATE_EOF(INIT2):
  1509. case YY_STATE_EOF(CURLY):
  1510. case YY_STATE_EOF(LEXYACC):
  1511. case YY_STATE_EOF(ASM):
  1512. case YY_STATE_EOF(CPP_INLINE):
  1513.     yyterminate();
  1514.  
  1515.     case YY_END_OF_BUFFER:
  1516.         {
  1517.         /* Amount of text matched not including the EOB char. */
  1518.         int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  1519.  
  1520.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1521.         *yy_cp = yy_hold_char;
  1522.         YY_RESTORE_YY_MORE_OFFSET
  1523.  
  1524.         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  1525.             {
  1526.             /* We're scanning a new file or input source.  It's
  1527.              * possible that this happened because the user
  1528.              * just pointed yyin at a new source and called
  1529.              * yylex().  If so, then we have to assure
  1530.              * consistency between yy_current_buffer and our
  1531.              * globals.  Here is the right place to do so, because
  1532.              * this is the first action (other than possibly a
  1533.              * back-up) that will match for the new input source.
  1534.              */
  1535.             yy_n_chars = yy_current_buffer->yy_n_chars;
  1536.             yy_current_buffer->yy_input_file = yyin;
  1537.             yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  1538.             }
  1539.  
  1540.         /* Note that here we test for yy_c_buf_p "<=" to the position
  1541.          * of the first EOB in the buffer, since yy_c_buf_p will
  1542.          * already have been incremented past the NUL character
  1543.          * (since all states make transitions on EOB to the
  1544.          * end-of-buffer state).  Contrast this with the test
  1545.          * in input().
  1546.          */
  1547.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1548.             { /* This was really a NUL. */
  1549.             yy_state_type yy_next_state;
  1550.  
  1551.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  1552.  
  1553.             yy_current_state = yy_get_previous_state();
  1554.  
  1555.             /* Okay, we're now positioned to make the NUL
  1556.              * transition.  We couldn't have
  1557.              * yy_get_previous_state() go ahead and do it
  1558.              * for us because it doesn't know how to deal
  1559.              * with the possibility of jamming (and we don't
  1560.              * want to build jamming into it because then it
  1561.              * will run more slowly).
  1562.              */
  1563.  
  1564.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  1565.  
  1566.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  1567.  
  1568.             if ( yy_next_state )
  1569.                 {
  1570.                 /* Consume the NUL. */
  1571.                 yy_cp = ++yy_c_buf_p;
  1572.                 yy_current_state = yy_next_state;
  1573.                 goto yy_match;
  1574.                 }
  1575.  
  1576.             else
  1577.                 {
  1578.                 yy_cp = yy_c_buf_p;
  1579.                 goto yy_find_action;
  1580.                 }
  1581.             }
  1582.  
  1583.         else switch ( yy_get_next_buffer() )
  1584.             {
  1585.             case EOB_ACT_END_OF_FILE:
  1586.                 {
  1587.                 yy_did_buffer_switch_on_eof = 0;
  1588.  
  1589.                 if ( yywrap() )
  1590.                     {
  1591.                     /* Note: because we've taken care in
  1592.                      * yy_get_next_buffer() to have set up
  1593.                      * yytext, we can now set up
  1594.                      * yy_c_buf_p so that if some total
  1595.                      * hoser (like flex itself) wants to
  1596.                      * call the scanner after we return the
  1597.                      * YY_NULL, it'll still work - another
  1598.                      * YY_NULL will get returned.
  1599.                      */
  1600.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1601.  
  1602.                     yy_act = YY_STATE_EOF(YY_START);
  1603.                     goto do_action;
  1604.                     }
  1605.  
  1606.                 else
  1607.                     {
  1608.                     if ( ! yy_did_buffer_switch_on_eof )
  1609.                         YY_NEW_FILE;
  1610.                     }
  1611.                 break;
  1612.                 }
  1613.  
  1614.             case EOB_ACT_CONTINUE_SCAN:
  1615.                 yy_c_buf_p =
  1616.                     yytext_ptr + yy_amount_of_matched_text;
  1617.  
  1618.                 yy_current_state = yy_get_previous_state();
  1619.  
  1620.                 yy_cp = yy_c_buf_p;
  1621.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1622.                 goto yy_match;
  1623.  
  1624.             case EOB_ACT_LAST_MATCH:
  1625.                 yy_c_buf_p =
  1626.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1627.  
  1628.                 yy_current_state = yy_get_previous_state();
  1629.  
  1630.                 yy_cp = yy_c_buf_p;
  1631.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1632.                 goto yy_find_action;
  1633.             }
  1634.         break;
  1635.         }
  1636.  
  1637.     default:
  1638.         YY_FATAL_ERROR(
  1639.             "fatal flex scanner internal error--no action found" );
  1640.     } /* end of action switch */
  1641.         } /* end of scanning one token */
  1642.     } /* end of yylex */
  1643.  
  1644.  
  1645. /* yy_get_next_buffer - try to read in a new buffer
  1646.  *
  1647.  * Returns a code representing an action:
  1648.  *    EOB_ACT_LAST_MATCH -
  1649.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1650.  *    EOB_ACT_END_OF_FILE - end of file
  1651.  */
  1652.  
  1653. static int yy_get_next_buffer()
  1654.     {
  1655.     register char *dest = yy_current_buffer->yy_ch_buf;
  1656.     register char *source = yytext_ptr;
  1657.     register int number_to_move, i;
  1658.     int ret_val;
  1659.  
  1660.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1661.         YY_FATAL_ERROR(
  1662.         "fatal flex scanner internal error--end of buffer missed" );
  1663.  
  1664.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  1665.         { /* Don't try to fill the buffer, so this is an EOF. */
  1666.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  1667.             {
  1668.             /* We matched a single character, the EOB, so
  1669.              * treat this as a final EOF.
  1670.              */
  1671.             return EOB_ACT_END_OF_FILE;
  1672.             }
  1673.  
  1674.         else
  1675.             {
  1676.             /* We matched some text prior to the EOB, first
  1677.              * process it.
  1678.              */
  1679.             return EOB_ACT_LAST_MATCH;
  1680.             }
  1681.         }
  1682.  
  1683.     /* Try to read more data. */
  1684.  
  1685.     /* First move last chars to start of buffer. */
  1686.     number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  1687.  
  1688.     for ( i = 0; i < number_to_move; ++i )
  1689.         *(dest++) = *(source++);
  1690.  
  1691.     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1692.         /* don't do the read, it's not guaranteed to return an EOF,
  1693.          * just force an EOF
  1694.          */
  1695.         yy_n_chars = 0;
  1696.  
  1697.     else
  1698.         {
  1699.         int num_to_read =
  1700.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  1701.  
  1702.         while ( num_to_read <= 0 )
  1703.             { /* Not enough room in the buffer - grow it. */
  1704. #ifdef YY_USES_REJECT
  1705.             YY_FATAL_ERROR(
  1706. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1707. #else
  1708.  
  1709.             /* just a shorter name for the current buffer */
  1710.             YY_BUFFER_STATE b = yy_current_buffer;
  1711.  
  1712.             int yy_c_buf_p_offset =
  1713.                 (int) (yy_c_buf_p - b->yy_ch_buf);
  1714.  
  1715.             if ( b->yy_is_our_buffer )
  1716.                 {
  1717.                 int new_size = b->yy_buf_size * 2;
  1718.  
  1719.                 if ( new_size <= 0 )
  1720.                     b->yy_buf_size += b->yy_buf_size / 8;
  1721.                 else
  1722.                     b->yy_buf_size *= 2;
  1723.  
  1724.                 b->yy_ch_buf = (char *)
  1725.                     /* Include room in for 2 EOB chars. */
  1726.                     yy_flex_realloc( (void *) b->yy_ch_buf,
  1727.                              b->yy_buf_size + 2 );
  1728.                 }
  1729.             else
  1730.                 /* Can't grow it, we don't own it. */
  1731.                 b->yy_ch_buf = 0;
  1732.  
  1733.             if ( ! b->yy_ch_buf )
  1734.                 YY_FATAL_ERROR(
  1735.                 "fatal error - scanner input buffer overflow" );
  1736.  
  1737.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1738.  
  1739.             num_to_read = yy_current_buffer->yy_buf_size -
  1740.                         number_to_move - 1;
  1741. #endif
  1742.             }
  1743.  
  1744.         if ( num_to_read > YY_READ_BUF_SIZE )
  1745.             num_to_read = YY_READ_BUF_SIZE;
  1746.  
  1747.         /* Read in more data. */
  1748.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1749.             yy_n_chars, num_to_read );
  1750.         }
  1751.  
  1752.     if ( yy_n_chars == 0 )
  1753.         {
  1754.         if ( number_to_move == YY_MORE_ADJ )
  1755.             {
  1756.             ret_val = EOB_ACT_END_OF_FILE;
  1757.             yyrestart( yyin );
  1758.             }
  1759.  
  1760.         else
  1761.             {
  1762.             ret_val = EOB_ACT_LAST_MATCH;
  1763.             yy_current_buffer->yy_buffer_status =
  1764.                 YY_BUFFER_EOF_PENDING;
  1765.             }
  1766.         }
  1767.  
  1768.     else
  1769.         ret_val = EOB_ACT_CONTINUE_SCAN;
  1770.  
  1771.     yy_n_chars += number_to_move;
  1772.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1773.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1774.  
  1775.     yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  1776.  
  1777.     return ret_val;
  1778.     }
  1779.  
  1780.  
  1781. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1782.  
  1783. static yy_state_type yy_get_previous_state()
  1784.     {
  1785.     register yy_state_type yy_current_state;
  1786.     register char *yy_cp;
  1787.  
  1788.     yy_current_state = yy_start;
  1789.     yy_current_state += YY_AT_BOL();
  1790.  
  1791.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1792.         {
  1793.         register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1794.         if ( yy_accept[yy_current_state] )
  1795.             {
  1796.             yy_last_accepting_state = yy_current_state;
  1797.             yy_last_accepting_cpos = yy_cp;
  1798.             }
  1799.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1800.             {
  1801.             yy_current_state = (int) yy_def[yy_current_state];
  1802.             if ( yy_current_state >= 323 )
  1803.                 yy_c = yy_meta[(unsigned int) yy_c];
  1804.             }
  1805.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1806.         }
  1807.  
  1808.     return yy_current_state;
  1809.     }
  1810.  
  1811.  
  1812. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1813.  *
  1814.  * synopsis
  1815.  *    next_state = yy_try_NUL_trans( current_state );
  1816.  */
  1817.  
  1818. #ifdef YY_USE_PROTOS
  1819. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  1820. #else
  1821. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1822. yy_state_type yy_current_state;
  1823. #endif
  1824.     {
  1825.     register int yy_is_jam;
  1826.     register char *yy_cp = yy_c_buf_p;
  1827.  
  1828.     register YY_CHAR yy_c = 1;
  1829.     if ( yy_accept[yy_current_state] )
  1830.         {
  1831.         yy_last_accepting_state = yy_current_state;
  1832.         yy_last_accepting_cpos = yy_cp;
  1833.         }
  1834.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1835.         {
  1836.         yy_current_state = (int) yy_def[yy_current_state];
  1837.         if ( yy_current_state >= 323 )
  1838.             yy_c = yy_meta[(unsigned int) yy_c];
  1839.         }
  1840.     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1841.     yy_is_jam = (yy_current_state == 322);
  1842.  
  1843.     return yy_is_jam ? 0 : yy_current_state;
  1844.     }
  1845.  
  1846.  
  1847. #ifndef YY_NO_UNPUT
  1848. #ifdef YY_USE_PROTOS
  1849. static void yyunput( int c, register char *yy_bp )
  1850. #else
  1851. static void yyunput( c, yy_bp )
  1852. int c;
  1853. register char *yy_bp;
  1854. #endif
  1855.     {
  1856.     register char *yy_cp = yy_c_buf_p;
  1857.  
  1858.     /* undo effects of setting up yytext */
  1859.     *yy_cp = yy_hold_char;
  1860.  
  1861.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1862.         { /* need to shift things up to make room */
  1863.         /* +2 for EOB chars. */
  1864.         register int number_to_move = yy_n_chars + 2;
  1865.         register char *dest = &yy_current_buffer->yy_ch_buf[
  1866.                     yy_current_buffer->yy_buf_size + 2];
  1867.         register char *source =
  1868.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  1869.  
  1870.         while ( source > yy_current_buffer->yy_ch_buf )
  1871.             *--dest = *--source;
  1872.  
  1873.         yy_cp += (int) (dest - source);
  1874.         yy_bp += (int) (dest - source);
  1875.         yy_n_chars = yy_current_buffer->yy_buf_size;
  1876.  
  1877.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1878.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1879.         }
  1880.  
  1881.     *--yy_cp = (char) c;
  1882.  
  1883.  
  1884.     yytext_ptr = yy_bp;
  1885.     yy_hold_char = *yy_cp;
  1886.     yy_c_buf_p = yy_cp;
  1887.     }
  1888. #endif    /* ifndef YY_NO_UNPUT */
  1889.  
  1890.  
  1891. #ifdef __cplusplus
  1892. static int yyinput()
  1893. #else
  1894. static int input()
  1895. #endif
  1896.     {
  1897.     int c;
  1898.  
  1899.     *yy_c_buf_p = yy_hold_char;
  1900.  
  1901.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1902.         {
  1903.         /* yy_c_buf_p now points to the character we want to return.
  1904.          * If this occurs *before* the EOB characters, then it's a
  1905.          * valid NUL; if not, then we've hit the end of the buffer.
  1906.          */
  1907.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1908.             /* This was really a NUL. */
  1909.             *yy_c_buf_p = '\0';
  1910.  
  1911.         else
  1912.             { /* need more input */
  1913.             int offset = yy_c_buf_p - yytext_ptr;
  1914.             ++yy_c_buf_p;
  1915.  
  1916.             switch ( yy_get_next_buffer() )
  1917.                 {
  1918.                 case EOB_ACT_END_OF_FILE:
  1919.                     {
  1920.                     if ( yywrap() )
  1921.                         {
  1922.                         yy_c_buf_p = yytext_ptr + offset;
  1923.                         return EOF;
  1924.                         }
  1925.  
  1926.                     if ( ! yy_did_buffer_switch_on_eof )
  1927.                         YY_NEW_FILE;
  1928. #ifdef __cplusplus
  1929.                     return yyinput();
  1930. #else
  1931.                     return input();
  1932. #endif
  1933.                     }
  1934.  
  1935.                 case EOB_ACT_CONTINUE_SCAN:
  1936.                     yy_c_buf_p = yytext_ptr + offset;
  1937.                     break;
  1938.  
  1939.                 case EOB_ACT_LAST_MATCH:
  1940. #ifdef __cplusplus
  1941.                     YY_FATAL_ERROR(
  1942.                     "unexpected last match in yyinput()" );
  1943. #else
  1944.                     YY_FATAL_ERROR(
  1945.                     "unexpected last match in input()" );
  1946. #endif
  1947.                 }
  1948.             }
  1949.         }
  1950.  
  1951.     c = *(unsigned char *) yy_c_buf_p;    /* cast for 8-bit char's */
  1952.     *yy_c_buf_p = '\0';    /* preserve yytext */
  1953.     yy_hold_char = *++yy_c_buf_p;
  1954.  
  1955.     yy_current_buffer->yy_at_bol = (c == '\n');
  1956.  
  1957.     return c;
  1958.     }
  1959.  
  1960.  
  1961. #ifdef YY_USE_PROTOS
  1962. void yyrestart( FILE *input_file )
  1963. #else
  1964. void yyrestart( input_file )
  1965. FILE *input_file;
  1966. #endif
  1967.     {
  1968.     if ( ! yy_current_buffer )
  1969.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1970.  
  1971.     yy_init_buffer( yy_current_buffer, input_file );
  1972.     yy_load_buffer_state();
  1973.     }
  1974.  
  1975.  
  1976. #ifdef YY_USE_PROTOS
  1977. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1978. #else
  1979. void yy_switch_to_buffer( new_buffer )
  1980. YY_BUFFER_STATE new_buffer;
  1981. #endif
  1982.     {
  1983.     if ( yy_current_buffer == new_buffer )
  1984.         return;
  1985.  
  1986.     if ( yy_current_buffer )
  1987.         {
  1988.         /* Flush out information for old buffer. */
  1989.         *yy_c_buf_p = yy_hold_char;
  1990.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1991.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1992.         }
  1993.  
  1994.     yy_current_buffer = new_buffer;
  1995.     yy_load_buffer_state();
  1996.  
  1997.     /* We don't actually know whether we did this switch during
  1998.      * EOF (yywrap()) processing, but the only time this flag
  1999.      * is looked at is after yywrap() is called, so it's safe
  2000.      * to go ahead and always set it.
  2001.      */
  2002.     yy_did_buffer_switch_on_eof = 1;
  2003.     }
  2004.  
  2005.  
  2006. #ifdef YY_USE_PROTOS
  2007. void yy_load_buffer_state( void )
  2008. #else
  2009. void yy_load_buffer_state()
  2010. #endif
  2011.     {
  2012.     yy_n_chars = yy_current_buffer->yy_n_chars;
  2013.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  2014.     yyin = yy_current_buffer->yy_input_file;
  2015.     yy_hold_char = *yy_c_buf_p;
  2016.     }
  2017.  
  2018.  
  2019. #ifdef YY_USE_PROTOS
  2020. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  2021. #else
  2022. YY_BUFFER_STATE yy_create_buffer( file, size )
  2023. FILE *file;
  2024. int size;
  2025. #endif
  2026.     {
  2027.     YY_BUFFER_STATE b;
  2028.  
  2029.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  2030.     if ( ! b )
  2031.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  2032.  
  2033.     b->yy_buf_size = size;
  2034.  
  2035.     /* yy_ch_buf has to be 2 characters longer than the size given because
  2036.      * we need to put in 2 end-of-buffer characters.
  2037.      */
  2038.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  2039.     if ( ! b->yy_ch_buf )
  2040.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  2041.  
  2042.     b->yy_is_our_buffer = 1;
  2043.  
  2044.     yy_init_buffer( b, file );
  2045.  
  2046.     return b;
  2047.     }
  2048.  
  2049.  
  2050. #ifdef YY_USE_PROTOS
  2051. void yy_delete_buffer( YY_BUFFER_STATE b )
  2052. #else
  2053. void yy_delete_buffer( b )
  2054. YY_BUFFER_STATE b;
  2055. #endif
  2056.     {
  2057.     if ( ! b )
  2058.         return;
  2059.  
  2060.     if ( b == yy_current_buffer )
  2061.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  2062.  
  2063.     if ( b->yy_is_our_buffer )
  2064.         yy_flex_free( (void *) b->yy_ch_buf );
  2065.  
  2066.     yy_flex_free( (void *) b );
  2067.     }
  2068.  
  2069.  
  2070. #ifndef YY_ALWAYS_INTERACTIVE
  2071. #ifndef YY_NEVER_INTERACTIVE
  2072. extern int isatty YY_PROTO(( int ));
  2073. #endif
  2074. #endif
  2075.  
  2076. #ifdef YY_USE_PROTOS
  2077. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  2078. #else
  2079. void yy_init_buffer( b, file )
  2080. YY_BUFFER_STATE b;
  2081. FILE *file;
  2082. #endif
  2083.  
  2084.  
  2085.     {
  2086.     yy_flush_buffer( b );
  2087.  
  2088.     b->yy_input_file = file;
  2089.     b->yy_fill_buffer = 1;
  2090.  
  2091. #if YY_ALWAYS_INTERACTIVE
  2092.     b->yy_is_interactive = 1;
  2093. #else
  2094. #if YY_NEVER_INTERACTIVE
  2095.     b->yy_is_interactive = 0;
  2096. #else
  2097.     b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  2098. #endif
  2099. #endif
  2100.     }
  2101.  
  2102.  
  2103. #ifdef YY_USE_PROTOS
  2104. void yy_flush_buffer( YY_BUFFER_STATE b )
  2105. #else
  2106. void yy_flush_buffer( b )
  2107. YY_BUFFER_STATE b;
  2108. #endif
  2109.  
  2110.     {
  2111.     b->yy_n_chars = 0;
  2112.  
  2113.     /* We always need two end-of-buffer characters.  The first causes
  2114.      * a transition to the end-of-buffer state.  The second causes
  2115.      * a jam in that state.
  2116.      */
  2117.     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  2118.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  2119.  
  2120.     b->yy_buf_pos = &b->yy_ch_buf[0];
  2121.  
  2122.     b->yy_at_bol = 1;
  2123.     b->yy_buffer_status = YY_BUFFER_NEW;
  2124.  
  2125.     if ( b == yy_current_buffer )
  2126.         yy_load_buffer_state();
  2127.     }
  2128.  
  2129.  
  2130. #ifndef YY_NO_SCAN_BUFFER
  2131. #ifdef YY_USE_PROTOS
  2132. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  2133. #else
  2134. YY_BUFFER_STATE yy_scan_buffer( base, size )
  2135. char *base;
  2136. yy_size_t size;
  2137. #endif
  2138.     {
  2139.     YY_BUFFER_STATE b;
  2140.  
  2141.     if ( size < 2 ||
  2142.          base[size-2] != YY_END_OF_BUFFER_CHAR ||
  2143.          base[size-1] != YY_END_OF_BUFFER_CHAR )
  2144.         /* They forgot to leave room for the EOB's. */
  2145.         return 0;
  2146.  
  2147.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  2148.     if ( ! b )
  2149.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  2150.  
  2151.     b->yy_buf_size = size - 2;    /* "- 2" to take care of EOB's */
  2152.     b->yy_buf_pos = b->yy_ch_buf = base;
  2153.     b->yy_is_our_buffer = 0;
  2154.     b->yy_input_file = 0;
  2155.     b->yy_n_chars = b->yy_buf_size;
  2156.     b->yy_is_interactive = 0;
  2157.     b->yy_at_bol = 1;
  2158.     b->yy_fill_buffer = 0;
  2159.     b->yy_buffer_status = YY_BUFFER_NEW;
  2160.  
  2161.     yy_switch_to_buffer( b );
  2162.  
  2163.     return b;
  2164.     }
  2165. #endif
  2166.  
  2167.  
  2168. #ifndef YY_NO_SCAN_STRING
  2169. #ifdef YY_USE_PROTOS
  2170. YY_BUFFER_STATE yy_scan_string( yyconst char *str )
  2171. #else
  2172. YY_BUFFER_STATE yy_scan_string( str )
  2173. yyconst char *str;
  2174. #endif
  2175.     {
  2176.     int len;
  2177.     for ( len = 0; str[len]; ++len )
  2178.         ;
  2179.  
  2180.     return yy_scan_bytes( str, len );
  2181.     }
  2182. #endif
  2183.  
  2184.  
  2185. #ifndef YY_NO_SCAN_BYTES
  2186. #ifdef YY_USE_PROTOS
  2187. YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
  2188. #else
  2189. YY_BUFFER_STATE yy_scan_bytes( bytes, len )
  2190. yyconst char *bytes;
  2191. int len;
  2192. #endif
  2193.     {
  2194.     YY_BUFFER_STATE b;
  2195.     char *buf;
  2196.     yy_size_t n;
  2197.     int i;
  2198.  
  2199.     /* Get memory for full buffer, including space for trailing EOB's. */
  2200.     n = len + 2;
  2201.     buf = (char *) yy_flex_alloc( n );
  2202.     if ( ! buf )
  2203.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  2204.  
  2205.     for ( i = 0; i < len; ++i )
  2206.         buf[i] = bytes[i];
  2207.  
  2208.     buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  2209.  
  2210.     b = yy_scan_buffer( buf, n );
  2211.     if ( ! b )
  2212.         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  2213.  
  2214.     /* It's okay to grow etc. this buffer, and we should throw it
  2215.      * away when we're done.
  2216.      */
  2217.     b->yy_is_our_buffer = 1;
  2218.  
  2219.     return b;
  2220.     }
  2221. #endif
  2222.  
  2223.  
  2224. #ifndef YY_NO_PUSH_STATE
  2225. #ifdef YY_USE_PROTOS
  2226. static void yy_push_state( int new_state )
  2227. #else
  2228. static void yy_push_state( new_state )
  2229. int new_state;
  2230. #endif
  2231.     {
  2232.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  2233.         {
  2234.         yy_size_t new_size;
  2235.  
  2236.         yy_start_stack_depth += YY_START_STACK_INCR;
  2237.         new_size = yy_start_stack_depth * sizeof( int );
  2238.  
  2239.         if ( ! yy_start_stack )
  2240.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  2241.  
  2242.         else
  2243.             yy_start_stack = (int *) yy_flex_realloc(
  2244.                     (void *) yy_start_stack, new_size );
  2245.  
  2246.         if ( ! yy_start_stack )
  2247.             YY_FATAL_ERROR(
  2248.             "out of memory expanding start-condition stack" );
  2249.         }
  2250.  
  2251.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  2252.  
  2253.     BEGIN(new_state);
  2254.     }
  2255. #endif
  2256.  
  2257.  
  2258. #ifndef YY_NO_POP_STATE
  2259. static void yy_pop_state()
  2260.     {
  2261.     if ( --yy_start_stack_ptr < 0 )
  2262.         YY_FATAL_ERROR( "start-condition stack underflow" );
  2263.  
  2264.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  2265.     }
  2266. #endif
  2267.  
  2268.  
  2269. #ifndef YY_NO_TOP_STATE
  2270. static int yy_top_state()
  2271.     {
  2272.     return yy_start_stack[yy_start_stack_ptr - 1];
  2273.     }
  2274. #endif
  2275.  
  2276. #ifndef YY_EXIT_FAILURE
  2277. #define YY_EXIT_FAILURE 2
  2278. #endif
  2279.  
  2280. #ifdef YY_USE_PROTOS
  2281. static void yy_fatal_error( yyconst char msg[] )
  2282. #else
  2283. static void yy_fatal_error( msg )
  2284. char msg[];
  2285. #endif
  2286.     {
  2287.     (void) fprintf( stderr, "%s\n", msg );
  2288.     exit( YY_EXIT_FAILURE );
  2289.     }
  2290.  
  2291.  
  2292.  
  2293. /* Redefine yyless() so it works in section 3 code. */
  2294.  
  2295. #undef yyless
  2296. #define yyless(n) \
  2297.     do \
  2298.         { \
  2299.         /* Undo effects of setting up yytext. */ \
  2300.         yytext[yyleng] = yy_hold_char; \
  2301.         yy_c_buf_p = yytext + n; \
  2302.         yy_hold_char = *yy_c_buf_p; \
  2303.         *yy_c_buf_p = '\0'; \
  2304.         yyleng = n; \
  2305.         } \
  2306.     while ( 0 )
  2307.  
  2308.  
  2309. /* Internal utility routines. */
  2310.  
  2311. #ifndef yytext_ptr
  2312. #ifdef YY_USE_PROTOS
  2313. static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
  2314. #else
  2315. static void yy_flex_strncpy( s1, s2, n )
  2316. char *s1;
  2317. yyconst char *s2;
  2318. int n;
  2319. #endif
  2320.     {
  2321.     register int i;
  2322.     for ( i = 0; i < n; ++i )
  2323.         s1[i] = s2[i];
  2324.     }
  2325. #endif
  2326.  
  2327. #ifdef YY_NEED_STRLEN
  2328. #ifdef YY_USE_PROTOS
  2329. static int yy_flex_strlen( yyconst char *s )
  2330. #else
  2331. static int yy_flex_strlen( s )
  2332. yyconst char *s;
  2333. #endif
  2334.     {
  2335.     register int n;
  2336.     for ( n = 0; s[n]; ++n )
  2337.         ;
  2338.  
  2339.     return n;
  2340.     }
  2341. #endif
  2342.  
  2343.  
  2344. #ifdef YY_USE_PROTOS
  2345. static void *yy_flex_alloc( yy_size_t size )
  2346. #else
  2347. static void *yy_flex_alloc( size )
  2348. yy_size_t size;
  2349. #endif
  2350.     {
  2351.     return (void *) malloc( size );
  2352.     }
  2353.  
  2354. #ifdef YY_USE_PROTOS
  2355. static void *yy_flex_realloc( void *ptr, yy_size_t size )
  2356. #else
  2357. static void *yy_flex_realloc( ptr, size )
  2358. void *ptr;
  2359. yy_size_t size;
  2360. #endif
  2361.     {
  2362.     /* The cast to (char *) in the following accommodates both
  2363.      * implementations that use char* generic pointers, and those
  2364.      * that use void* generic pointers.  It works with the latter
  2365.      * because both ANSI C and C++ allow castless assignment from
  2366.      * any pointer type to void*, and deal with argument conversions
  2367.      * as though doing an assignment.
  2368.      */
  2369.     return (void *) realloc( (char *) ptr, size );
  2370.     }
  2371.  
  2372. #ifdef YY_USE_PROTOS
  2373. static void yy_flex_free( void *ptr )
  2374. #else
  2375. static void yy_flex_free( ptr )
  2376. void *ptr;
  2377. #endif
  2378.     {
  2379.     free( ptr );
  2380.     }
  2381.  
  2382. #if YY_MAIN
  2383. int main()
  2384.     {
  2385.     yylex();
  2386.     return 0;
  2387.     }
  2388. #endif
  2389. #line 327 "lex.l"
  2390.  
  2391.  
  2392. static void
  2393. startCpp (level)
  2394. int level;
  2395. {
  2396.     save_cpp = level;
  2397.     in_cpp = TRUE;
  2398.     BEGIN CPP1;
  2399. }
  2400.  
  2401. static void
  2402. finishCpp()
  2403. {
  2404.     in_cpp = FALSE;
  2405.     if (save_cpp)
  2406.         BEGIN CURLY;
  2407.     else
  2408.     BEGIN INITIAL;
  2409. }
  2410.  
  2411. /*
  2412.  * Skip over embedded __attribute/__attribute_ syntax.
  2413.  */
  2414. #if defined(apollo) || !OPT_LINTLIBRARY
  2415. static void
  2416. absorb_special ()
  2417. {
  2418.     int    c;
  2419.     int    nest    = 0;
  2420.     while ((c = input()) > 0) {
  2421.     if (c == '(')
  2422.         nest++;
  2423.     else if (c == ')') {
  2424.         if (--nest <= 0)
  2425.         break;
  2426.     }
  2427.     }
  2428. }
  2429. #endif
  2430.  
  2431. #if OPT_LINTLIBRARY
  2432. /*
  2433.  * This recognizes some of the special attribute macros defined by gcc:
  2434.  *    noreturn
  2435.  *    format(printf,n,m)
  2436.  *    format(scanf,n,m)
  2437.  * and uses that information to construct equivalent lint-library text.
  2438.  * (It's a distinct piece of code from the 'absorb_special()' function to
  2439.  * avoid spurious matches with non-gcc compilers).
  2440.  */
  2441. static void
  2442. gcc_attribute ()
  2443. {
  2444.     int    c, num1, num2;
  2445.     int    nest = 0;
  2446.     int    len = 0;
  2447.     char bfr[BUFSIZ];
  2448.  
  2449.     while ((c = input()) > 0) {
  2450.     if (len < sizeof(bfr)-1 && !isspace(c))
  2451.         bfr[len++] = c;
  2452.     if (c == '(')
  2453.         nest++;
  2454.     else if (c == ')') {
  2455.         if (--nest <= 0)
  2456.         break;
  2457.     }
  2458.     }
  2459.     bfr[len] = '\0';
  2460.     if (!strcmp(bfr, "((noreturn))")) {
  2461.     exitlike_func = TRUE;
  2462.     } else if (sscanf(bfr, "((format(printf,%d,%d)))", &num1, &num2) == 2) {
  2463.     (void)sprintf(bfr, "PRINTFLIKE%d", varargs_num = num1);
  2464.     varargs_str = xstrdup(bfr);
  2465.     } else if (sscanf(bfr, "((format(scanf,%d,%d)))", &num1, &num2) == 2) {
  2466.     (void)sprintf(bfr, "SCANFLIKE%d", varargs_num = num1);
  2467.     varargs_str = xstrdup(bfr);
  2468.     }
  2469. }
  2470. #endif
  2471.  
  2472. /* Decode the current token according to the type-of-name
  2473.  */
  2474. static int
  2475. type_of_name (name)
  2476. char *name;
  2477. {
  2478.     if (find_symbol(type_qualifiers, name) != NULL)
  2479.     return T_TYPE_QUALIFIER;
  2480.     else if (find_symbol(typedef_names, name) != NULL)
  2481.     return T_TYPEDEF_NAME;
  2482.     else if (find_symbol(define_names, name) != NULL)
  2483.     return T_DEFINE_NAME;
  2484.     else
  2485.     return T_IDENTIFIER;
  2486. }
  2487.  
  2488. boolean
  2489. is_typedef_name (name)
  2490. char *name;
  2491. {
  2492.     return (find_symbol(typedef_names, name) != NULL);
  2493. }
  2494.  
  2495. /* If the matched text contains any new line characters, then update the
  2496.  * current line number.
  2497.  */
  2498. static void
  2499. update_line_num ()
  2500. {
  2501.     char *p = yytext;
  2502.     while (*p != '\0') {
  2503.     if (*p++ == '\n')
  2504.         cur_file->line_num++;
  2505.     }
  2506. }
  2507.  
  2508. /* Save the matched text in the temporary file.
  2509.  */
  2510. static void
  2511. save_text ()
  2512. {
  2513. #if OPT_LINTLIBRARY
  2514.     if (!in_cpp)
  2515.         copy_typedef(yytext);
  2516. #endif    
  2517.     if (cur_file->convert) {
  2518.     fputs(yytext, cur_file->tmp_file);
  2519.     }
  2520. }
  2521.  
  2522. /* Record the current position in the temporary file and write the matched text
  2523.  * to the file.
  2524.  */
  2525. static void
  2526. save_text_offset ()
  2527. {
  2528.     (void)strcpy(yylval.text.text, yytext);
  2529. #if OPT_LINTLIBRARY
  2530.     copy_typedef(yytext);
  2531. #endif
  2532.     if (cur_file->convert) {
  2533.     yylval.text.begin = ftell(cur_file->tmp_file);
  2534.     fputs(yytext, cur_file->tmp_file);
  2535.     } else
  2536.         yylval.text.begin = 0;
  2537. }
  2538.  
  2539. #if OPT_LINTLIBRARY
  2540. /* Decipher comments that are useful for lint (and making lint-libraries)
  2541.  */
  2542. static struct {
  2543.     int    varText;
  2544.     int    varargs;
  2545.     int    externs;
  2546.     int    preproz;
  2547. } cmtVal;
  2548.  
  2549. static int
  2550. decipher_comment (keyword, len)
  2551. char *keyword;
  2552. int len;
  2553. {
  2554.     if (len != 0) {
  2555.     int value;
  2556.     keyword[len] = '\0';
  2557.  
  2558.     /* these are recognized by some lint-programs */
  2559.     if (!strcmp(keyword, "VARARGS")) {
  2560.         cmtVal.varargs = -1;
  2561.     } else if (sscanf(keyword, "VARARGS%d", &value) == 1) {
  2562.         cmtVal.varargs = value;
  2563.     } else if (!strcmp(keyword, "PRINTFLIKE")) {
  2564.         cmtVal.varargs = 1;
  2565.         cmtVal.varText = TRUE;
  2566.     } else if (sscanf(keyword, "PRINTFLIKE%d", &value) == 1) {
  2567.         cmtVal.varargs = value;
  2568.         cmtVal.varText = TRUE;
  2569.     } else if (!strcmp(keyword, "SCANFLIKE")) {
  2570.         cmtVal.varargs = 2;
  2571.         cmtVal.varText = TRUE;
  2572.     } else if (sscanf(keyword, "SCANFLIKE%d", &value) == 1) {
  2573.         cmtVal.varargs = value;
  2574.         cmtVal.varText = TRUE;
  2575.     /* these are extensions added to simplify library-generation */
  2576.     } else if (!strcmp(keyword, "LINT_EXTERN")) {
  2577.         cmtVal.externs = MAX_INC_DEPTH;
  2578.     } else if (sscanf(keyword, "LINT_EXTERN%d", &value) == 1) {
  2579.         cmtVal.externs = value;
  2580.     } else if (!strcmp(keyword, "LINT_PREPRO")) {
  2581.         cmtVal.preproz = -1;    /* the whole comment */
  2582.     } else if (sscanf(keyword, "LINT_PREPRO%d", &value) == 1) {
  2583.         cmtVal.preproz = value;
  2584.     } else if (!strcmp(keyword, "LINT_SHADOWED")) {
  2585.         lint_shadowed = TRUE;
  2586.     }
  2587.     }
  2588.     return 0;
  2589. }
  2590. #endif
  2591.  
  2592. static void
  2593. put_quoted (c)
  2594. int c;
  2595. {
  2596.     /* Modifying 'yytext[]' doesn't work well with FLEX, which simply
  2597.      * maintains 'yytext' as a pointer into its input buffer.  LEX copies
  2598.      * characters into the 'yytext[]' array.
  2599.      */
  2600. #if defined(FLEX_SCANNER) || !defined(YYLMAX)
  2601.     if (c != 0) {
  2602.     static char    temp[2];
  2603.     temp[0] = c;
  2604.     /* save_text */
  2605. # if OPT_LINTLIBRARY
  2606.     if (!in_cpp)
  2607.         copy_typedef(temp);
  2608. # endif    
  2609.     if (cur_file->convert) {
  2610.         fputs(temp, cur_file->tmp_file);
  2611.     }
  2612.     /* update_line_num */
  2613.     if (c == '\n')
  2614.         cur_file->line_num++;
  2615.     }
  2616.  
  2617. #else    /* this works fine on LEX (e.g., on SunOS 4.x) */
  2618.  
  2619.     if ((c == 0) || (yyleng+1 >= YYLMAX)) {
  2620.     save_text();
  2621.     update_line_num();
  2622.     yyleng = 0;
  2623.     }
  2624.     if (c != 0) {
  2625.     yytext[yyleng++] = c;
  2626.     yytext[yyleng] = 0;
  2627.     }
  2628. #endif    /* LEX/FLEX */
  2629. }
  2630.  
  2631. /*
  2632.  * Scan past the characters in a backslash sequence
  2633.  */
  2634. /* Scan past quoted string.  Note that some strings may overflow 'yytext[]', so
  2635.  * we don't try to eat them in the lexical rules.
  2636.  */
  2637. static void
  2638. get_quoted ()
  2639. {
  2640.     int    delim = *yytext;
  2641.     int    c;
  2642.  
  2643. #if defined(FLEX_SCANNER) || !defined(YYLMAX)
  2644.     put_quoted(delim);
  2645. #endif
  2646.     while ((c = input()) != 0) {
  2647.     if (c == '\\') {
  2648.         put_quoted(c);
  2649.         if ((c = input()) == 0)
  2650.         break;
  2651.         put_quoted(c);
  2652.     } else {
  2653.         put_quoted(c);
  2654.         if (c == delim)
  2655.         break;
  2656.         if (c == '\n') {    /* recover from unbalanced */
  2657.         put_error();
  2658.         fprintf(stderr, "unbalanced quote character '%c'\n", delim);
  2659.         break;
  2660.         }
  2661.     }
  2662.     }
  2663.     put_quoted(0);
  2664. }
  2665.  
  2666. /* Scan to end of comment.
  2667.  */
  2668. static void
  2669. get_comment ()
  2670. {
  2671.     int c, lastc = '\0';
  2672.  
  2673. #if OPT_LINTLIBRARY
  2674.     int len = 0;
  2675.     char keyword[BUFSIZ];
  2676.  
  2677.     keyword[len] = '\0';
  2678.     cmtVal.varText = 0;
  2679.     cmtVal.varargs = 0;
  2680.     cmtVal.externs = -1;
  2681.     cmtVal.preproz = 0;
  2682. #endif
  2683.  
  2684.     while ((c = input()) != 0) {
  2685.     if (cur_file->convert)
  2686.         fputc(c, cur_file->tmp_file);
  2687.  
  2688. #if OPT_LINTLIBRARY
  2689.     if (!(isalnum(c) || c == '_' || c == '$')) {
  2690.         int flag = cmtVal.preproz;
  2691.         len = decipher_comment(keyword, len);
  2692.         if (flag != cmtVal.preproz)
  2693.             lastc = '\0';
  2694.     } else if (len+1 < sizeof(keyword)) {
  2695.         keyword[len++] = c;
  2696.     }
  2697. #endif
  2698.  
  2699.     switch (c) {
  2700.     case '\n':
  2701.         cur_file->line_num++;
  2702. #if OPT_LINTLIBRARY
  2703.         if (cmtVal.preproz != 0 && lastc != '\0')
  2704.         fputc(lastc, stdout); 
  2705.         if (cmtVal.preproz > 0)    /* if negative, we pass everything */
  2706.         cmtVal.preproz -= 1;
  2707. #endif
  2708.         break;
  2709.     case '/':
  2710.         if (lastc == '*') {
  2711.         if (cur_file->convert) {
  2712.             if (func_params && cur_declarator) {
  2713.             cur_declarator->begin_comment = cur_file->begin_comment;
  2714.             cur_file->begin_comment = ftell(cur_file->tmp_file);
  2715.             cur_declarator->end_comment = cur_file->begin_comment;
  2716.             cur_declarator = NULL;
  2717.             } else {
  2718.             cur_file->end_comment = ftell(cur_file->tmp_file);
  2719.             }
  2720.         }
  2721. #if OPT_LINTLIBRARY
  2722.         (void)decipher_comment(keyword, len);
  2723.         if (cmtVal.varargs != 0) {
  2724.             if ((varargs_num = cmtVal.varargs) != 0
  2725.              && cmtVal.varText != 0) {
  2726.             if (varargs_str != 0)
  2727.                 free(varargs_str);
  2728.             varargs_str = xstrdup(keyword);
  2729.             }
  2730.         }
  2731.         if (cmtVal.externs != -1)
  2732.             extern_in = cmtVal.externs;
  2733.         if (cmtVal.preproz != 0)
  2734.             fputc('\n', stdout); 
  2735. #endif
  2736.         return;
  2737.         }
  2738.         /* FALLTHRU */
  2739.     default:
  2740. #if OPT_LINTLIBRARY
  2741.         if (cmtVal.preproz != 0 && lastc != '\0')
  2742.         fputc(lastc, stdout); 
  2743. #endif
  2744.         break;
  2745.     }
  2746.     lastc = c;
  2747.     }
  2748. }
  2749.  
  2750. /* Scan rest of preprocessor directive.  If <dest> is not NULL, then store
  2751.  * the text in the buffer pointed to by <dest> having size <n>.
  2752.  */
  2753. static void
  2754. get_cpp_directive (dest, n)
  2755. char *dest;        /* buffer to store directive text */
  2756. unsigned n;        /* size of buffer to store directive text */
  2757. {
  2758.     char c, lastc[4];
  2759.     
  2760.     lastc[0] = lastc[1] = lastc[2] = lastc[3] = '\0';
  2761.     if (dest != NULL)
  2762.     *dest = '\0';
  2763.  
  2764.     while ((c = input()) != 0) {
  2765.     if (cur_file->convert)
  2766.         fputc(c, cur_file->tmp_file);
  2767.  
  2768.     switch (c) {
  2769.     case '\n':
  2770.         cur_file->line_num++;
  2771.         if (lastc[2] != '\\' && strcmp(lastc, "?\?/") != 0) {
  2772.         finishCpp();
  2773.         return;
  2774.         }
  2775.         break;
  2776.     case '*':
  2777.         if (lastc[2] == '/')
  2778.         get_comment();
  2779.         break;
  2780.     }
  2781.     lastc[0] = lastc[1];
  2782.     lastc[1] = lastc[2];
  2783.     lastc[2] = c;
  2784.  
  2785.     if (dest != NULL && n > 1) {
  2786.         *dest++ = c;
  2787.         *dest = '\0';
  2788.         --n;
  2789.     }
  2790.     }
  2791. }
  2792.  
  2793. /* Return a pointer to the current file name.
  2794.  */
  2795. char *
  2796. cur_file_name ()
  2797. {
  2798.     return cur_file->file_name;
  2799. }
  2800.  
  2801. /* Return the current line number.
  2802.  */
  2803. unsigned
  2804. cur_line_num ()
  2805. {
  2806.     return cur_file->line_num;
  2807. }
  2808.  
  2809. /* Return the current temporary output file.
  2810.  */
  2811. FILE *
  2812. cur_tmp_file ()
  2813. {
  2814.     return cur_file->tmp_file;
  2815. }
  2816.  
  2817. /* Set the modify flag for the current file.
  2818.  */
  2819. void
  2820. cur_file_changed ()
  2821. {
  2822.     cur_file->changed = TRUE;
  2823. }
  2824.  
  2825. /* Return the temporary file offset of beginning of the current comment.
  2826.  */
  2827. long
  2828. cur_begin_comment ()
  2829. {
  2830.     return cur_file->begin_comment;
  2831. }
  2832.  
  2833. /* Return the text of the current lexical token.
  2834.  */
  2835. char *
  2836. cur_text ()
  2837. {
  2838.     return yytext;
  2839. }
  2840.  
  2841. #if !HAVE_TMPFILE
  2842. /*
  2843.  * tmpfile() - return a FILE* for a temporary file that will be
  2844.  * removed automatically when the program exits.
  2845.  * 
  2846.  * Not all systems have the ANSI tmpfile() function yet...
  2847.  *
  2848.  * DaviD W. Sanderson (dws@cs.wisc.edu)
  2849.  */
  2850. FILE *
  2851. tmpfile ()
  2852. {
  2853.     char name[MAX_TEXT_SIZE];
  2854.     char *tmpdir;
  2855.     FILE *f;
  2856.  
  2857.     if ((tmpdir = getenv("TMPDIR")) == (char *)0)
  2858.     {
  2859.     tmpdir = "/tmp";
  2860.     }
  2861.     sprintf(name, "%s/TfXXXXXX", tmpdir);
  2862.     mktemp(name);
  2863.  
  2864.     if ((f = fopen(name, "w+")) == (FILE *)0)
  2865.     {
  2866.     return (FILE *)0;
  2867.     }
  2868.  
  2869.     if (unlink(name) == -1)
  2870.     {
  2871.     fclose(f);
  2872.     return (FILE *)0;
  2873.     }
  2874.  
  2875.     return f;
  2876. }
  2877. #endif /* !HAVE_TMPFILE */
  2878.  
  2879. /* Push a file onto the include stack.    The stream yyin must already
  2880.  * point to the file.
  2881.  */
  2882. static void
  2883. include_file (name, convert)
  2884. char *name;        /* file name */
  2885. int convert;        /* if TRUE, convert function definitions */
  2886. {
  2887.     ++inc_depth;
  2888.     cur_file = inc_stack + inc_depth;
  2889.     cur_file->file = yyin;
  2890.     cur_file->base_name = xstrdup(name);
  2891.     cur_file->file_name = strcpy(xmalloc(MAX_TEXT_SIZE), name);
  2892.     cur_file->line_num = 1;
  2893.     cur_file->convert = convert;
  2894.     cur_file->changed = FALSE;
  2895.  
  2896. #ifdef FLEX_SCANNER
  2897.     buffer_stack[inc_depth] = yy_create_buffer(yyin, YY_BUF_SIZE);
  2898.     yy_switch_to_buffer(buffer_stack[inc_depth]);
  2899. #endif
  2900.  
  2901.     if (convert) {
  2902.     cur_file->begin_comment = cur_file->end_comment = 0;
  2903.     cur_file->tmp_file = tmpfile();
  2904.     if (cur_file->tmp_file == NULL) {
  2905.         fprintf(stderr, "%s: cannot create temporary file\n", progname);
  2906.         cur_file->convert = FALSE;
  2907.     }
  2908.     }
  2909. }
  2910.  
  2911. #define BLOCK_SIZE 2048
  2912.  
  2913. /* Copy converted C source from the temporary file to the output stream.
  2914.  */
  2915. static void
  2916. put_file (outf)
  2917. FILE *outf;
  2918. {
  2919.     char block[BLOCK_SIZE];
  2920.     long filesize;
  2921.     unsigned nread, count;
  2922.  
  2923.     filesize = ftell(cur_file->tmp_file);
  2924.     fseek(cur_file->tmp_file, 0L, 0);
  2925.     while (filesize > 0) {
  2926.     count = (filesize < BLOCK_SIZE) ? (unsigned)filesize : BLOCK_SIZE;
  2927.     nread = fread(block, sizeof(char), count, cur_file->tmp_file);
  2928.     if (nread == 0)
  2929.         break;
  2930.     fwrite(block, sizeof(char), nread, outf);
  2931.     filesize -= nread;
  2932.     }
  2933. }
  2934.  
  2935. /* Remove the top of the include stack.
  2936.  */
  2937. void
  2938. pop_file (closed)
  2939. int closed;
  2940. {
  2941.     FILE *outf;
  2942.  
  2943.     if (!closed && (yyin != stdin))
  2944.     fclose(yyin);
  2945.  
  2946.     if (cur_file->convert) {
  2947.     if (yyin == stdin) {
  2948.         put_file(stdout);
  2949.     } else if (cur_file->changed) {
  2950.         if ((outf = fopen(cur_file->base_name, "w")) != NULL) {
  2951.         put_file(outf);
  2952.         fclose(outf);
  2953.         } else {
  2954.         fprintf(stderr, "%s: cannot create file %s\n", progname,
  2955.          cur_file->base_name);
  2956.         }
  2957.     }
  2958.  
  2959.     fclose(cur_file->tmp_file);
  2960.     }
  2961.     free(cur_file->base_name);
  2962.     free(cur_file->file_name);
  2963.  
  2964. #ifdef FLEX_SCANNER
  2965.     yy_delete_buffer(YY_CURRENT_BUFFER);
  2966. #endif
  2967.  
  2968.     if (--inc_depth >= 0) {
  2969.     cur_file = inc_stack + inc_depth;
  2970.     yyin = cur_file->file;
  2971.  
  2972. #ifdef FLEX_SCANNER
  2973.     yy_switch_to_buffer(buffer_stack[inc_depth]);
  2974. #endif
  2975.     }
  2976. }
  2977.  
  2978. /* Process include directive.
  2979.  */
  2980. static void
  2981. do_include (file_spec)
  2982. char *file_spec;     /* path surrounded by "" or <> */
  2983. {
  2984.     int stdinc;     /* 1 = path surrounded by <> */
  2985.     char file[MAX_TEXT_SIZE], path[MAX_TEXT_SIZE];
  2986.     char match, *s;
  2987.     int i;
  2988.     unsigned n;
  2989.     FILE *fp;
  2990.  
  2991.     if (inc_depth >= MAX_INC_DEPTH-1) {
  2992.     put_error();
  2993.     fprintf(stderr, "includes too deeply nested\n");
  2994.     return;
  2995.     }
  2996.  
  2997.     if (file_spec[0] == '"') {
  2998.     match = '"';
  2999.     stdinc = 0;
  3000.     } else if (file_spec[0] == '<') {
  3001.     match = '>';
  3002.     stdinc = 1;
  3003.     } else {
  3004.     return;
  3005.     }
  3006.     s = strchr(file_spec+1, match);
  3007.     n = (s != NULL) ? (unsigned)(s - file_spec - 1) : 0;
  3008.     strncpy(file, file_spec+1, (size_t)n);
  3009.     file[n] = '\0';
  3010.  
  3011.     /* Do nothing if the file was already included. */
  3012.     sprintf(path, stdinc ? "<%s>" : "\"%s\"", file);
  3013.     if (find_symbol(included_files, path) != NULL)
  3014.     return;
  3015.     new_symbol(included_files, path, NULL, DS_NONE);
  3016.  
  3017.     for (i = stdinc != 0; i < num_inc_dir; ++i) {
  3018.     if (strlen(inc_dir[i]) == 0) {
  3019.         strcpy(path, file);
  3020.     } else {
  3021.         sprintf(path, "%s/%s", inc_dir[i], file);
  3022.     }
  3023.     if ((fp = fopen(path, "r")) != NULL) {
  3024.         yyin = fp;
  3025.         include_file(path, func_style != FUNC_NONE && !stdinc);
  3026.         return;
  3027.     }
  3028.     }
  3029.  
  3030.     if (!quiet) {
  3031.     put_error();
  3032.     fprintf(stderr, "cannot read file %s\n", file_spec);
  3033.     }
  3034. }
  3035.  
  3036. /* When the end of the current input file is reached, pop a
  3037.  * nested include file.
  3038.  */
  3039. int
  3040. yywrap ()
  3041. {
  3042.     if (inc_depth > 0) {
  3043.     pop_file(FALSE);
  3044.     return 0;
  3045.     } else {
  3046.     return 1;
  3047.     }
  3048. }
  3049.