home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / bc-1.02-src.lha / src / build / bc-1.02 / scan.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-25  |  41.1 KB  |  1,649 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* Scanner skeleton version:
  4.  * $Header: flex.skl,v 1.2 94/01/04 14:33:15 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18.  
  19.  
  20. #ifdef __cplusplus
  21.  
  22. #include <stdlib.h>
  23. #include <unistd.h>
  24.  
  25. /* Use prototypes in function declarations. */
  26. #define YY_USE_PROTOS
  27.  
  28. /* The "const" storage-class-modifier is valid. */
  29. #define YY_USE_CONST
  30.  
  31. #else    /* ! __cplusplus */
  32.  
  33. #ifdef __STDC__
  34.  
  35. #define YY_USE_PROTOS
  36. #define YY_USE_CONST
  37.  
  38. #endif    /* __STDC__ */
  39. #endif    /* ! __cplusplus */
  40.  
  41.  
  42. #ifdef __TURBOC__
  43. #define YY_USE_CONST
  44. #endif
  45.  
  46.  
  47. #ifndef YY_USE_CONST
  48. #ifndef const
  49. #define const
  50. #endif
  51. #endif
  52.  
  53.  
  54. #ifdef YY_USE_PROTOS
  55. #define YY_PROTO(proto) proto
  56. #else
  57. #define YY_PROTO(proto) ()
  58. #endif
  59.  
  60. /* Returned upon end-of-file. */
  61. #define YY_NULL 0
  62.  
  63. /* Promotes a possibly negative, possibly signed char to an unsigned
  64.  * integer for use as an array index.  If the signed char is negative,
  65.  * we want to instead treat it as an 8-bit unsigned char, hence the
  66.  * double cast.
  67.  */
  68. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  69.  
  70. /* Enter a start condition.  This macro really ought to take a parameter,
  71.  * but we do it the disgusting crufty way forced on us by the ()-less
  72.  * definition of BEGIN.
  73.  */
  74. #define BEGIN yy_start = 1 + 2 *
  75.  
  76. /* Translate the current start state into a value that can be later handed
  77.  * to BEGIN to return to the state.
  78.  */
  79. #define YY_START ((yy_start - 1) / 2)
  80.  
  81. /* Action number for EOF rule of a given start state. */
  82. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  83.  
  84. /* Special action meaning "start processing a new file".  Now included
  85.  * only for backward compatibility with previous versions of flex.
  86.  */
  87. #define YY_NEW_FILE yyrestart( yyin )
  88.  
  89. #define YY_END_OF_BUFFER_CHAR 0
  90.  
  91. /* Size of default input buffer. */
  92. #define YY_BUF_SIZE 16384
  93.  
  94. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  95.  
  96. extern int yyleng;
  97. extern FILE *yyin, *yyout;
  98.  
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102.     extern int yywrap YY_PROTO(( void ));
  103. #ifdef __cplusplus
  104.     }
  105. #endif
  106.  
  107. #define EOB_ACT_CONTINUE_SCAN 0
  108. #define EOB_ACT_END_OF_FILE 1
  109. #define EOB_ACT_LAST_MATCH 2
  110.  
  111. /* The funky do-while in the following #define is used to turn the definition
  112.  * int a single C statement (which needs a semi-colon terminator).  This
  113.  * avoids problems with code like:
  114.  *
  115.  *     if ( condition_holds )
  116.  *        yyless( 5 );
  117.  *    else
  118.  *        do_something_else();
  119.  *
  120.  * Prior to using the do-while the compiler would get upset at the
  121.  * "else" because it interpreted the "if" statement as being all
  122.  * done when it reached the ';' after the yyless() call.
  123.  */
  124.  
  125. /* Return all but the first 'n' matched characters back to the input stream. */
  126.  
  127. #define yyless(n) \
  128.     do \
  129.         { \
  130.         /* Undo effects of setting up yytext. */ \
  131.         *yy_cp = yy_hold_char; \
  132.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  133.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  134.         } \
  135.     while ( 0 )
  136.  
  137. #define unput(c) yyunput( c, yytext_ptr )
  138.  
  139.  
  140. struct yy_buffer_state
  141.     {
  142.     FILE *yy_input_file;
  143.  
  144.     char *yy_ch_buf;        /* input buffer */
  145.     char *yy_buf_pos;        /* current position in input buffer */
  146.  
  147.     /* Size of input buffer in bytes, not including room for EOB
  148.      * characters.
  149.      */
  150.     int yy_buf_size;
  151.  
  152.     /* Number of characters read into yy_ch_buf, not including EOB
  153.      * characters.
  154.      */
  155.     int yy_n_chars;
  156.  
  157.     /* Whether this is an "interactive" input source; if so, and
  158.      * if we're using stdio for input, then we want to use getc()
  159.      * instead of fread(), to make sure we stop fetching input after
  160.      * each newline.
  161.      */
  162.     int yy_is_interactive;
  163.  
  164.     /* Whether to try to fill the input buffer when we reach the
  165.      * end of it.
  166.      */
  167.     int yy_fill_buffer;
  168.  
  169.     /* Whether we've seen an EOF on this buffer. */
  170.     int yy_eof_status;
  171. #define EOF_NOT_SEEN 0
  172.     /* "Pending" happens when the EOF has been seen but there's still
  173.      * some text to process.  Note that when we actually see the EOF,
  174.      * we switch the status back to "not seen" (via yyrestart()), so
  175.      * that the user can continue scanning by just pointing yyin at
  176.      * a new input file.
  177.      */
  178. #define EOF_PENDING 1
  179.     };
  180.  
  181. static YY_BUFFER_STATE yy_current_buffer = 0;
  182.  
  183. /* We provide macros for accessing buffer states in case in the
  184.  * future we want to put the buffer states in a more general
  185.  * "scanner state".
  186.  */
  187. #define YY_CURRENT_BUFFER yy_current_buffer
  188.  
  189.  
  190. /* yy_hold_char holds the character lost when yytext is formed. */
  191. static char yy_hold_char;
  192.  
  193. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  194.  
  195.  
  196. int yyleng;
  197.  
  198. /* Points to current character in buffer. */
  199. static char *yy_c_buf_p = (char *) 0;
  200. static int yy_init = 1;        /* whether we need to initialize */
  201. static int yy_start = 0;    /* start state number */
  202.  
  203. /* Flag which is used to allow yywrap()'s to do buffer switches
  204.  * instead of setting up a fresh yyin.  A bit of a hack ...
  205.  */
  206. static int yy_did_buffer_switch_on_eof;
  207.  
  208. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  209. void yyrestart YY_PROTO(( FILE *input_file ));
  210. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  211. void yy_load_buffer_state YY_PROTO(( void ));
  212. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  213. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  214. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  215.  
  216. static int yy_start_stack_ptr = 0;
  217. static int yy_start_stack_depth = 0;
  218. static int *yy_start_stack = 0;
  219. static void yy_push_state YY_PROTO(( int new_state ));
  220. static void yy_pop_state YY_PROTO(( void ));
  221. static int yy_top_state YY_PROTO(( void ));
  222.  
  223. #ifndef yytext_ptr
  224. static void yy_flex_strcpy YY_PROTO(( char *, const char * ));
  225. #endif
  226.  
  227. static void *yy_flex_alloc YY_PROTO(( unsigned int ));
  228. static void *yy_flex_realloc YY_PROTO(( void *ptr, unsigned int ));
  229. static void yy_flex_free YY_PROTO(( void * ));
  230.  
  231. #define yy_new_buffer yy_create_buffer
  232.  
  233. #define INITIAL 0
  234. typedef unsigned char YY_CHAR;
  235. typedef int yy_state_type;
  236. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  237. extern char *yytext;
  238. #define yytext_ptr yytext
  239.  
  240. #ifdef __cplusplus
  241. static int yyinput YY_PROTO(( void ));
  242. #else
  243. static int input YY_PROTO(( void ));
  244. #endif
  245.  
  246. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  247. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  248. static int yy_get_next_buffer YY_PROTO(( void ));
  249. static void yy_fatal_error YY_PROTO(( const char msg[] ));
  250.  
  251. /* Done after the current pattern has been matched and before the
  252.  * corresponding action - sets up yytext.
  253.  */
  254. #define YY_DO_BEFORE_ACTION \
  255.     yytext_ptr = yy_bp; \
  256.     yyleng = yy_cp - yy_bp; \
  257.     yy_hold_char = *yy_cp; \
  258.     *yy_cp = '\0'; \
  259.     yy_c_buf_p = yy_cp;
  260.  
  261. #define YY_END_OF_BUFFER 40
  262. static const short int yy_accept[144] =
  263.     {   0,
  264.         0,    0,   40,   38,   33,   31,   25,   38,   26,   38,
  265.        22,   26,   22,   22,   38,   26,   37,   29,   27,   29,
  266.        38,   22,   35,   35,   35,   35,   35,   35,   35,   35,
  267.        35,   35,   35,   35,   35,   35,   35,   35,   38,   33,
  268.        29,    0,   36,   27,   23,   30,   37,    0,   34,   37,
  269.        37,    0,   28,   32,   35,   35,   35,   35,   35,   35,
  270.        35,   35,   35,    7,   35,   35,   35,   35,   35,   35,
  271.        35,   35,   35,   35,   35,   24,   37,    0,    0,   37,
  272.         0,   35,   35,   35,   35,   35,    6,   35,   35,   35,
  273.        35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
  274.  
  275.        35,   13,   35,   35,   35,   14,   16,   35,   17,   35,
  276.        35,   35,   35,    3,   15,   35,   35,    9,   35,   35,
  277.         2,   35,   35,   11,   35,   35,   12,   20,   35,   10,
  278.        35,    8,   35,    1,    4,   21,    5,   35,   35,   35,
  279.        19,   18,    0
  280.     } ;
  281.  
  282. static const int yy_ec[256] =
  283.     {   0,
  284.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  285.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  286.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  287.         1,    2,    4,    5,    1,    1,    6,    7,    1,    8,
  288.         9,   10,   11,   12,   13,   14,   15,   16,   16,   16,
  289.        16,   16,   16,   16,   16,   16,   16,    1,   17,   18,
  290.        19,   20,    1,    1,   21,   21,   21,   21,   21,   21,
  291.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  292.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  293.        22,   23,   24,   25,   26,    1,   27,   28,   29,   30,
  294.  
  295.        31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
  296.        41,   42,   43,   44,   45,   46,   47,   36,   48,   36,
  297.        49,   36,   50,   51,   52,    1,    1,    1,    1,    1,
  298.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  299.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  300.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  301.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  302.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  303.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  304.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  305.  
  306.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  307.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  308.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  309.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  310.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  311.         1,    1,    1,    1,    1
  312.     } ;
  313.  
  314. static const int yy_meta[53] =
  315.     {   0,
  316.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  317.         1,    1,    1,    1,    1,    2,    1,    1,    1,    1,
  318.         1,    1,    1,    1,    1,    2,    2,    2,    2,    2,
  319.         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
  320.         2,    2,    2,    2,    2,    2,    2,    2,    2,    1,
  321.         1,    1
  322.     } ;
  323.  
  324. static const short int yy_base[146] =
  325.     {   0,
  326.         0,    0,  193,  194,  190,  194,  172,  185,  170,  181,
  327.       194,  168,   42,   41,   41,   46,   52,  167,   61,  166,
  328.       181,  164,  135,  137,  139,  148,  140,  136,    0,  149,
  329.        27,   50,  147,  130,  126,  141,   40,   36,  120,  168,
  330.       194,  164,  194,  194,  194,  194,   66,  165,  194,   72,
  331.        76,  164,  194,  194,    0,  120,  134,  124,  131,  117,
  332.       117,  122,  132,    0,  113,  117,  117,  128,  119,  118,
  333.        52,  125,  107,  106,  114,  194,   80,  145,   84,   88,
  334.       144,  105,  118,   98,  108,  111,    0,   95,   95,   93,
  335.       105,  102,   91,   95,   88,  103,   85,   93,   84,   85,
  336.  
  337.        90,    0,   90,   91,   85,    0,    0,   93,    0,   77,
  338.        76,   90,   74,    0,    0,   75,   87,    0,   90,   85,
  339.         0,   75,   83,    0,   76,   63,    0,    0,   66,    0,
  340.        62,    0,   47,    0,    0,    0,    0,   45,   53,   29,
  341.         0,    0,  194,  111,   56
  342.     } ;
  343.  
  344. static const short int yy_def[146] =
  345.     {   0,
  346.       143,    1,  143,  143,  143,  143,  143,  144,  143,  143,
  347.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  348.       143,  143,  145,  145,  145,  145,  145,  145,  145,  145,
  349.       145,  145,  145,  145,  145,  145,  145,  145,  143,  143,
  350.       143,  144,  143,  143,  143,  143,  143,  143,  143,  143,
  351.       143,  143,  143,  143,  145,  145,  145,  145,  145,  145,
  352.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  353.       145,  145,  145,  145,  145,  143,  143,  143,  143,  143,
  354.       143,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  355.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  356.  
  357.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  358.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  359.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  360.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  361.       145,  145,    0,  143,  143
  362.     } ;
  363.  
  364. static const short int yy_nxt[247] =
  365.     {   0,
  366.         4,    5,    6,    7,    8,    9,   10,   11,   11,   12,
  367.        13,   11,   14,   15,   16,   17,   11,   18,   19,   20,
  368.        17,   11,   21,   11,   22,    4,   23,   24,   25,   26,
  369.        27,   28,   29,   30,   31,   29,   29,   32,   29,   29,
  370.        33,   34,   35,   36,   37,   29,   29,   38,   29,   11,
  371.        39,   11,   46,   46,   63,   49,   47,   55,   64,   44,
  372.        44,   47,   74,   48,   44,   50,   53,   51,   72,   75,
  373.        53,   53,   51,   53,   52,   53,   65,  142,   96,   41,
  374.        66,   77,   73,  141,   67,   53,   77,   80,   78,   50,
  375.       140,   51,   80,  139,   81,   77,   51,   97,   52,   47,
  376.  
  377.        77,  138,   78,   80,   47,  137,   48,  136,   80,  135,
  378.        81,   42,   42,  134,  133,  132,  131,  130,  129,  128,
  379.       127,  126,  125,  124,  123,  122,  121,  120,  119,  118,
  380.       117,  116,  115,  114,  113,  112,  111,  110,  109,  108,
  381.       107,  106,  105,  104,  103,  102,   80,   77,  101,  100,
  382.        99,   98,   95,   94,   93,   92,   91,   90,   89,   88,
  383.        87,   86,   85,   84,   83,   82,   51,   79,   43,   40,
  384.        76,   71,   70,   69,   68,   62,   61,   60,   59,   58,
  385.        57,   56,   44,   54,   41,   41,   44,   45,   44,   43,
  386.        41,   40,  143,    3,  143,  143,  143,  143,  143,  143,
  387.  
  388.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  389.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  390.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  391.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  392.       143,  143,  143,  143,  143,  143
  393.     } ;
  394.  
  395. static const short int yy_chk[247] =
  396.     {   0,
  397.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  398.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  399.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  400.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  401.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  402.         1,    1,   13,   14,   31,   16,   15,  145,   31,   14,
  403.        13,   15,   38,   15,   16,   17,   19,   17,   37,   38,
  404.        19,   19,   17,   19,   17,   19,   32,  140,   71,   19,
  405.        32,   47,   37,  139,   32,   19,   47,   50,   47,   51,
  406.       138,   51,   50,  133,   50,   77,   51,   71,   51,   79,
  407.  
  408.        77,  131,   77,   80,   79,  129,   79,  126,   80,  125,
  409.        80,  144,  144,  123,  122,  120,  119,  117,  116,  113,
  410.       112,  111,  110,  108,  105,  104,  103,  101,  100,   99,
  411.        98,   97,   96,   95,   94,   93,   92,   91,   90,   89,
  412.        88,   86,   85,   84,   83,   82,   81,   78,   75,   74,
  413.        73,   72,   70,   69,   68,   67,   66,   65,   63,   62,
  414.        61,   60,   59,   58,   57,   56,   52,   48,   42,   40,
  415.        39,   36,   35,   34,   33,   30,   28,   27,   26,   25,
  416.        24,   23,   22,   21,   20,   18,   12,   10,    9,    8,
  417.         7,    5,    3,  143,  143,  143,  143,  143,  143,  143,
  418.  
  419.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  420.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  421.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  422.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  423.       143,  143,  143,  143,  143,  143
  424.     } ;
  425.  
  426. static yy_state_type yy_last_accepting_state;
  427. static char *yy_last_accepting_cpos;
  428.  
  429. /* The intent behind this definition is that it'll catch
  430.  * any uses of REJECT which flex missed.
  431.  */
  432. #define REJECT reject_used_but_not_detected
  433. #define yymore() yymore_used_but_not_detected
  434. #define YY_MORE_ADJ 0
  435. char *yytext;
  436. # line 1 "scan.l"
  437. # line 2 "scan.l"
  438. /* scan.l: the (f)lex description file for the scanner. */
  439.  
  440. /*  This file is part of bc written for MINIX.
  441.     Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  442.  
  443.     This program is free software; you can redistribute it and/or modify
  444.     it under the terms of the GNU General Public License as published by
  445.     the Free Software Foundation; either version 2 of the License , or
  446.     (at your option) any later version.
  447.  
  448.     This program is distributed in the hope that it will be useful,
  449.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  450.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  451.     GNU General Public License for more details.
  452.  
  453.     You should have received a copy of the GNU General Public License
  454.     along with this program; see the file COPYING.  If not, write to
  455.     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  456.  
  457.     You may contact the author by:
  458.        e-mail:  phil@cs.wwu.edu
  459.       us-mail:  Philip A. Nelson
  460.                 Computer Science Department, 9062
  461.                 Western Washington University
  462.                 Bellingham, WA 98226-9062
  463.        
  464. *************************************************************************/
  465.  
  466. #include "bcdefs.h"
  467. #include "y.tab.h"
  468. #include "global.h"
  469. #include "proto.h"
  470.  
  471. /* Using flex, we can ask for a smaller input buffer.  With lex, this
  472.    does nothing! */
  473.  
  474. #ifdef SMALL_BUF
  475. #undef YY_READ_BUF_SIZE
  476. #define YY_READ_BUF_SIZE 512
  477. #endif
  478.  
  479. /* We want to define our own yywrap. */
  480. #undef yywrap
  481. _PROTOTYPE(int yywrap, (void));
  482.  
  483. /* MINIX returns from read with < 0 if SIGINT is  encountered.
  484.    In flex, we can redefine YY_INPUT to the following.  In lex, this
  485.    does nothing! */
  486. #include <errno.h>
  487. #undef  YY_INPUT
  488. #define YY_INPUT(buf,result,max_size) \
  489.     while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  490.         if (errno != EINTR) \
  491.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  492.  
  493.  
  494. /* Macros after this point can all be overridden by user definitions in
  495.  * section 1.
  496.  */
  497.  
  498. #ifdef YY_MALLOC_DECL
  499. YY_MALLOC_DECL
  500. #else
  501. #if __STDC__
  502. #ifndef __cplusplus
  503. #include <stdlib.h>
  504. #endif
  505. #else
  506. /* Just try to get by without declaring the routines.  This will fail
  507.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  508.  * or sizeof(void*) != sizeof(int).
  509.  */
  510. #endif
  511. #endif
  512.  
  513. /* Amount of stuff to slurp up with each read. */
  514. #ifndef YY_READ_BUF_SIZE
  515. #define YY_READ_BUF_SIZE 8192
  516. #endif
  517.  
  518. /* Copy whatever the last rule matched to the standard output. */
  519.  
  520. #ifndef ECHO
  521. /* This used to be an fputs(), but since the string might contain NUL's,
  522.  * we now use fwrite().
  523.  */
  524. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  525. #endif
  526.  
  527. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  528.  * is returned in "result".
  529.  */
  530. #ifndef YY_INPUT
  531. #define YY_INPUT(buf,result,max_size) \
  532.     if ( yy_current_buffer->yy_is_interactive ) \
  533.         { \
  534.         int c = getc( yyin ); \
  535.         result = c == EOF ? 0 : 1; \
  536.         buf[0] = (char) c; \
  537.         } \
  538.     else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
  539.           && ferror( yyin ) ) \
  540.         YY_FATAL_ERROR( "input in flex scanner failed" );
  541. #endif
  542.  
  543. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  544.  * we don't want an extra ';' after the "return" because that will cause
  545.  * some compilers to complain about unreachable statements.
  546.  */
  547. #ifndef yyterminate
  548. #define yyterminate() return YY_NULL
  549. #endif
  550.  
  551. /* Number of entries by which start-condition stack grows. */
  552. #ifndef YY_START_STACK_INCR
  553. #define YY_START_STACK_INCR 25
  554. #endif
  555.  
  556. /* Report a fatal error. */
  557. #ifndef YY_FATAL_ERROR
  558. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  559. #endif
  560.  
  561. /* Default declaration of generated scanner - a define so the user can
  562.  * easily add parameters.
  563.  */
  564. #ifndef YY_DECL
  565. #define YY_DECL int yylex YY_PROTO(( void ))
  566. #endif
  567.  
  568. /* Code executed at the beginning of each rule, after yytext and yyleng
  569.  * have been set up.
  570.  */
  571. #ifndef YY_USER_ACTION
  572. #define YY_USER_ACTION
  573. #endif
  574.  
  575. /* Code executed at the end of each rule. */
  576. #ifndef YY_BREAK
  577. #define YY_BREAK break;
  578. #endif
  579.  
  580. YY_DECL
  581.     {
  582.     register yy_state_type yy_current_state;
  583.     register char *yy_cp, *yy_bp;
  584.     register int yy_act;
  585.  
  586. # line 60 "scan.l"
  587.  
  588.  
  589.     if ( yy_init )
  590.         {
  591. #ifdef YY_USER_INIT
  592.         YY_USER_INIT;
  593. #endif
  594.  
  595.         if ( ! yy_start )
  596.             yy_start = 1;    /* first start state */
  597.  
  598.         if ( ! yyin )
  599.             yyin = stdin;
  600.  
  601.         if ( ! yyout )
  602.             yyout = stdout;
  603.  
  604.         if ( yy_current_buffer )
  605.             yy_init_buffer( yy_current_buffer, yyin );
  606.         else
  607.             yy_current_buffer =
  608.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  609.  
  610.         yy_load_buffer_state();
  611.  
  612.         yy_init = 0;
  613.         }
  614.  
  615.     while ( 1 )        /* loops until end-of-file is reached */
  616.         {
  617.         yy_cp = yy_c_buf_p;
  618.  
  619.         /* Support of yytext. */
  620.         *yy_cp = yy_hold_char;
  621.  
  622.         /* yy_bp points to the position in yy_ch_buf of the start of
  623.          * the current run.
  624.          */
  625.         yy_bp = yy_cp;
  626.  
  627.         yy_current_state = yy_start;
  628. yy_match:
  629.         do
  630.             {
  631.             register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  632.             if ( yy_accept[yy_current_state] )
  633.                 {
  634.                 yy_last_accepting_state = yy_current_state;
  635.                 yy_last_accepting_cpos = yy_cp;
  636.                 }
  637.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  638.                 {
  639.                 yy_current_state = (int) yy_def[yy_current_state];
  640.                 if ( yy_current_state >= 144 )
  641.                     yy_c = yy_meta[(unsigned int) yy_c];
  642.                 }
  643.             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  644.             ++yy_cp;
  645.             }
  646.         while ( yy_base[yy_current_state] != 194 );
  647.  
  648. yy_find_action:
  649.         yy_act = yy_accept[yy_current_state];
  650.  
  651.         YY_DO_BEFORE_ACTION;
  652.  
  653.  
  654. do_action:    /* This label is used only to access EOF actions. */
  655.  
  656.  
  657.         switch ( yy_act )
  658.     { /* beginning of action switch */
  659.             case 0: /* must back up */
  660.             /* undo the effects of YY_DO_BEFORE_ACTION */
  661.             *yy_cp = yy_hold_char;
  662.             yy_cp = yy_last_accepting_cpos;
  663.             yy_current_state = yy_last_accepting_state;
  664.             goto yy_find_action;
  665.  
  666. case 1:
  667. YY_USER_ACTION
  668. # line 61 "scan.l"
  669. return(Define);
  670.     YY_BREAK
  671. case 2:
  672. YY_USER_ACTION
  673. # line 62 "scan.l"
  674. return(Break);
  675.     YY_BREAK
  676. case 3:
  677. YY_USER_ACTION
  678. # line 63 "scan.l"
  679. return(Quit);
  680.     YY_BREAK
  681. case 4:
  682. YY_USER_ACTION
  683. # line 64 "scan.l"
  684. return(Length);
  685.     YY_BREAK
  686. case 5:
  687. YY_USER_ACTION
  688. # line 65 "scan.l"
  689. return(Return);
  690.     YY_BREAK
  691. case 6:
  692. YY_USER_ACTION
  693. # line 66 "scan.l"
  694. return(For);
  695.     YY_BREAK
  696. case 7:
  697. YY_USER_ACTION
  698. # line 67 "scan.l"
  699. return(If);
  700.     YY_BREAK
  701. case 8:
  702. YY_USER_ACTION
  703. # line 68 "scan.l"
  704. return(While);
  705.     YY_BREAK
  706. case 9:
  707. YY_USER_ACTION
  708. # line 69 "scan.l"
  709. return(Sqrt);
  710.     YY_BREAK
  711. case 10:
  712. YY_USER_ACTION
  713. # line 70 "scan.l"
  714. return(Scale);
  715.     YY_BREAK
  716. case 11:
  717. YY_USER_ACTION
  718. # line 71 "scan.l"
  719. return(Ibase);
  720.     YY_BREAK
  721. case 12:
  722. YY_USER_ACTION
  723. # line 72 "scan.l"
  724. return(Obase);
  725.     YY_BREAK
  726. case 13:
  727. YY_USER_ACTION
  728. # line 73 "scan.l"
  729. return(Auto);
  730.     YY_BREAK
  731. case 14:
  732. YY_USER_ACTION
  733. # line 74 "scan.l"
  734. return(Else);
  735.     YY_BREAK
  736. case 15:
  737. YY_USER_ACTION
  738. # line 75 "scan.l"
  739. return(Read);
  740.     YY_BREAK
  741. case 16:
  742. YY_USER_ACTION
  743. # line 76 "scan.l"
  744. return(Halt);
  745.     YY_BREAK
  746. case 17:
  747. YY_USER_ACTION
  748. # line 77 "scan.l"
  749. return(Last);
  750.     YY_BREAK
  751. case 18:
  752. YY_USER_ACTION
  753. # line 78 "scan.l"
  754. return(Warranty);
  755.     YY_BREAK
  756. case 19:
  757. YY_USER_ACTION
  758. # line 79 "scan.l"
  759. return(Continue);
  760.     YY_BREAK
  761. case 20:
  762. YY_USER_ACTION
  763. # line 80 "scan.l"
  764. return(Print);
  765.     YY_BREAK
  766. case 21:
  767. YY_USER_ACTION
  768. # line 81 "scan.l"
  769. return(Limits);
  770.     YY_BREAK
  771. case 22:
  772. YY_USER_ACTION
  773. # line 82 "scan.l"
  774. { yylval.c_value = yytext[0]; 
  775.                           return((int)yytext[0]); }
  776.     YY_BREAK
  777. case 23:
  778. YY_USER_ACTION
  779. # line 84 "scan.l"
  780. { return(AND); }
  781.     YY_BREAK
  782. case 24:
  783. YY_USER_ACTION
  784. # line 85 "scan.l"
  785. { return(OR); }
  786.     YY_BREAK
  787. case 25:
  788. YY_USER_ACTION
  789. # line 86 "scan.l"
  790. { return(NOT); }
  791.     YY_BREAK
  792. case 26:
  793. YY_USER_ACTION
  794. # line 87 "scan.l"
  795. { yylval.c_value = yytext[0]; return(MUL_OP); }
  796.     YY_BREAK
  797. case 27:
  798. YY_USER_ACTION
  799. # line 88 "scan.l"
  800. { yylval.c_value = yytext[0]; return(ASSIGN_OP); }
  801.     YY_BREAK
  802. case 28:
  803. YY_USER_ACTION
  804. # line 89 "scan.l"
  805. #ifdef OLD_EQ_OP
  806.              char warn_save;
  807.              warn_save = warn_not_std;
  808.              warn_not_std = TRUE;
  809.              warn ("Old fashioned =<op>");
  810.              warn_not_std = warn_save;
  811.              yylval.c_value = yytext[1];
  812. #else
  813.              yylval.c_value = '=';
  814.              yyless (1);
  815. #endif
  816.              return(ASSIGN_OP);
  817.                }
  818.     YY_BREAK
  819. case 29:
  820. YY_USER_ACTION
  821. # line 103 "scan.l"
  822. { yylval.s_value = strcopyof(yytext); return(REL_OP); }
  823.     YY_BREAK
  824. case 30:
  825. YY_USER_ACTION
  826. # line 104 "scan.l"
  827. { yylval.c_value = yytext[0]; return(INCR_DECR); }
  828.     YY_BREAK
  829. case 31:
  830. YY_USER_ACTION
  831. # line 105 "scan.l"
  832. { line_no++; return(NEWLINE); }
  833.     YY_BREAK
  834. case 32:
  835. YY_USER_ACTION
  836. # line 106 "scan.l"
  837. {  line_no++;  /* ignore a "quoted" newline */ }
  838.     YY_BREAK
  839. case 33:
  840. YY_USER_ACTION
  841. # line 107 "scan.l"
  842. { /* ignore spaces and tabs */ }
  843.     YY_BREAK
  844. case 34:
  845. YY_USER_ACTION
  846. # line 108 "scan.l"
  847. {
  848.     int c;
  849.  
  850.     for (;;)
  851.       {
  852.         while ( ((c=input()) != '*') && (c != EOF)) 
  853.           /* eat it */
  854.           if (c == '\n') line_no++;
  855.         if (c == '*')
  856.            {
  857.         while ( (c=input()) == '*') /* eat it*/;
  858.         if (c == '/') break; /* at end of comment */
  859.         if (c == '\n') line_no++;
  860.           }
  861.         if (c == EOF)
  862.           {
  863.         fprintf (stderr,"EOF encountered in a comment.\n");
  864.         break;
  865.           }
  866.       }
  867.       }
  868.     YY_BREAK
  869. case 35:
  870. YY_USER_ACTION
  871. # line 129 "scan.l"
  872. { yylval.s_value = strcopyof(yytext); return(NAME); }
  873.     YY_BREAK
  874. case 36:
  875. YY_USER_ACTION
  876. # line 130 "scan.l"
  877. {
  878.            unsigned char *look;
  879.           int count = 0;
  880.           yylval.s_value = strcopyof(yytext);
  881.           for (look = yytext; *look != 0; look++)
  882.         {
  883.           if (*look == '\n') line_no++;
  884.           if (*look == '"')  count++;
  885.         }
  886.           if (count != 2) yyerror ("NUL character in string.");
  887.           return(STRING);
  888.         }
  889.     YY_BREAK
  890. case 37:
  891. YY_USER_ACTION
  892. # line 142 "scan.l"
  893. {
  894.           unsigned char *src, *dst;
  895.           int len;
  896.           /* remove a trailing decimal point. */
  897.           len = strlen(yytext);
  898.           if (yytext[len-1] == '.')
  899.             yytext[len-1] = 0;
  900.           /* remove leading zeros. */
  901.           src = yytext;
  902.           dst = yytext;
  903.           while (*src == '0') src++;
  904.           if (*src == 0) src--;
  905.           /* Copy strings removing the newlines. */
  906.           while (*src != 0)
  907.         {
  908.               if (*src == '\\')
  909.             {
  910.               src++; src++;
  911.               line_no++;
  912.             }
  913.           else
  914.             *dst++ = *src++;
  915.             }
  916.           *dst = 0;
  917.           yylval.s_value = strcopyof(yytext); 
  918.           return(NUMBER);
  919.         }
  920.     YY_BREAK
  921. case 38:
  922. YY_USER_ACTION
  923. # line 169 "scan.l"
  924. {
  925.       if (yytext[0] < ' ')
  926.         yyerror ("illegal character: ^%c",yytext[0] + '@');
  927.       else
  928.         if (yytext[0] > '~')
  929.           yyerror ("illegal character: \\%3d", (int) yytext[0]);
  930.         else
  931.           yyerror ("illegal character: %s",yytext);
  932.     }
  933.     YY_BREAK
  934. case 39:
  935. YY_USER_ACTION
  936. # line 178 "scan.l"
  937. ECHO;
  938.     YY_BREAK
  939. case YY_STATE_EOF(INITIAL):
  940.     yyterminate();
  941.  
  942.     case YY_END_OF_BUFFER:
  943.         {
  944.         /* Amount of text matched not including the EOB char. */
  945.         int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;
  946.  
  947.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  948.         *yy_cp = yy_hold_char;
  949.  
  950.         if ( yy_current_buffer->yy_input_file != yyin )
  951.             {
  952.             /* This can happen if we scan a file, yywrap() returns
  953.              * 1, and then later the user points yyin at a new
  954.              * file to resume scanning.  We have to assure
  955.              * consistency between yy_current_buffer and our
  956.              * globals.  Here is the right place to do so, because
  957.              * this is the first action (other than possibly a
  958.              * back-up) that will match for the new input file.
  959.              */
  960.             yy_current_buffer->yy_input_file = yyin;
  961.             yy_n_chars = yy_current_buffer->yy_n_chars;
  962.             }
  963.  
  964.         /* Note that here we test for yy_c_buf_p "<=" to the position
  965.          * of the first EOB in the buffer, since yy_c_buf_p will
  966.          * already have been incremented past the NUL character
  967.          * (since all states make transitions on EOB to the
  968.          * end-of-buffer state).  Contrast this with the test
  969.          * in input().
  970.          */
  971.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  972.             { /* This was really a NUL. */
  973.             yy_state_type yy_next_state;
  974.  
  975.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  976.  
  977.             yy_current_state = yy_get_previous_state();
  978.  
  979.             /* Okay, we're now positioned to make the NUL
  980.              * transition.  We couldn't have
  981.              * yy_get_previous_state() go ahead and do it
  982.              * for us because it doesn't know how to deal
  983.              * with the possibility of jamming (and we don't
  984.              * want to build jamming into it because then it
  985.              * will run more slowly).
  986.              */
  987.  
  988.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  989.  
  990.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  991.  
  992.             if ( yy_next_state )
  993.                 {
  994.                 /* Consume the NUL. */
  995.                 yy_cp = ++yy_c_buf_p;
  996.                 yy_current_state = yy_next_state;
  997.                 goto yy_match;
  998.                 }
  999.  
  1000.             else
  1001.                 {
  1002.                 goto yy_find_action;
  1003.                 }
  1004.             }
  1005.  
  1006.         else switch ( yy_get_next_buffer() )
  1007.             {
  1008.             case EOB_ACT_END_OF_FILE:
  1009.                 {
  1010.                 yy_did_buffer_switch_on_eof = 0;
  1011.  
  1012.                 if ( yywrap() )
  1013.                     {
  1014.                     /* Note: because we've taken care in
  1015.                      * yy_get_next_buffer() to have set up
  1016.                      * yytext, we can now set up
  1017.                      * yy_c_buf_p so that if some total
  1018.                      * hoser (like flex itself) wants to
  1019.                      * call the scanner after we return the
  1020.                      * YY_NULL, it'll still work - another
  1021.                      * YY_NULL will get returned.
  1022.                      */
  1023.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1024.  
  1025.                     yy_act = YY_STATE_EOF(YY_START);
  1026.                     goto do_action;
  1027.                     }
  1028.  
  1029.                 else
  1030.                     {
  1031.                     if ( ! yy_did_buffer_switch_on_eof )
  1032.                         YY_NEW_FILE;
  1033.                     }
  1034.                 break;
  1035.                 }
  1036.  
  1037.             case EOB_ACT_CONTINUE_SCAN:
  1038.                 yy_c_buf_p =
  1039.                     yytext_ptr + yy_amount_of_matched_text;
  1040.  
  1041.                 yy_current_state = yy_get_previous_state();
  1042.  
  1043.                 yy_cp = yy_c_buf_p;
  1044.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1045.                 goto yy_match;
  1046.  
  1047.             case EOB_ACT_LAST_MATCH:
  1048.                 yy_c_buf_p =
  1049.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1050.  
  1051.                 yy_current_state = yy_get_previous_state();
  1052.  
  1053.                 yy_cp = yy_c_buf_p;
  1054.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1055.                 goto yy_find_action;
  1056.             }
  1057.         break;
  1058.         }
  1059.  
  1060.     default:
  1061.         YY_FATAL_ERROR(
  1062.             "fatal flex scanner internal error--no action found" );
  1063.     } /* end of action switch */
  1064.         } /* end of scanning one token */
  1065.     } /* end of yylex */
  1066.  
  1067.  
  1068. /* yy_get_next_buffer - try to read in a new buffer
  1069.  *
  1070.  * Returns a code representing an action:
  1071.  *    EOB_ACT_LAST_MATCH -
  1072.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1073.  *    EOB_ACT_END_OF_FILE - end of file
  1074.  */
  1075.  
  1076. static int yy_get_next_buffer()
  1077.     {
  1078.     register char *dest = yy_current_buffer->yy_ch_buf;
  1079.     register char *source = yytext_ptr - 1; /* copy prev. char, too */
  1080.     register int number_to_move, i;
  1081.     int ret_val;
  1082.  
  1083.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1084.         YY_FATAL_ERROR(
  1085.         "fatal flex scanner internal error--end of buffer missed" );
  1086.  
  1087.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  1088.         { /* Don't try to fill the buffer, so this is an EOF. */
  1089.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  1090.             {
  1091.             /* We matched a singled characater, the EOB, so
  1092.              * treat this as a final EOF.
  1093.              */
  1094.             return EOB_ACT_END_OF_FILE;
  1095.             }
  1096.  
  1097.         else
  1098.             {
  1099.             /* We matched some text prior to the EOB, first
  1100.              * process it.
  1101.              */
  1102.             return EOB_ACT_LAST_MATCH;
  1103.             }
  1104.         }
  1105.  
  1106.     /* Try to read more data. */
  1107.  
  1108.     /* First move last chars to start of buffer. */
  1109.     number_to_move = yy_c_buf_p - yytext_ptr;
  1110.  
  1111.     for ( i = 0; i < number_to_move; ++i )
  1112.         *(dest++) = *(source++);
  1113.  
  1114.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  1115.         /* don't do the read, it's not guaranteed to return an EOF,
  1116.          * just force an EOF
  1117.          */
  1118.         yy_n_chars = 0;
  1119.  
  1120.     else
  1121.         {
  1122.         int num_to_read =
  1123.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  1124.  
  1125.         while ( num_to_read <= 0 )
  1126.             { /* Not enough room in the buffer - grow it. */
  1127. #ifdef YY_USES_REJECT
  1128.             YY_FATAL_ERROR(
  1129. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1130. #else
  1131.  
  1132.             /* just a shorter name for the current buffer */
  1133.             YY_BUFFER_STATE b = yy_current_buffer;
  1134.  
  1135.             int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;
  1136.  
  1137.             b->yy_buf_size *= 2;
  1138.             b->yy_ch_buf = (char *)
  1139.                 yy_flex_realloc( (void *) b->yy_ch_buf,
  1140.                          b->yy_buf_size );
  1141.  
  1142.             if ( ! b->yy_ch_buf )
  1143.                 YY_FATAL_ERROR(
  1144.                 "fatal error - scanner input buffer overflow" );
  1145.  
  1146.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1147.  
  1148.             num_to_read = yy_current_buffer->yy_buf_size -
  1149.                         number_to_move - 1;
  1150. #endif
  1151.             }
  1152.  
  1153.         if ( num_to_read > YY_READ_BUF_SIZE )
  1154.             num_to_read = YY_READ_BUF_SIZE;
  1155.  
  1156.         /* Read in more data. */
  1157.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1158.             yy_n_chars, num_to_read );
  1159.         }
  1160.  
  1161.     if ( yy_n_chars == 0 )
  1162.         {
  1163.         if ( number_to_move - YY_MORE_ADJ == 1 )
  1164.             {
  1165.             ret_val = EOB_ACT_END_OF_FILE;
  1166.             yyrestart( yyin );
  1167.             }
  1168.  
  1169.         else
  1170.             {
  1171.             ret_val = EOB_ACT_LAST_MATCH;
  1172.             yy_current_buffer->yy_eof_status = EOF_PENDING;
  1173.             }
  1174.         }
  1175.  
  1176.     else
  1177.         ret_val = EOB_ACT_CONTINUE_SCAN;
  1178.  
  1179.     yy_n_chars += number_to_move;
  1180.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1181.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1182.  
  1183.     /* yytext begins at the second character in yy_ch_buf; the first
  1184.      * character is the one which preceded it before reading in the latest
  1185.      * buffer; it needs to be kept around in case it's a newline, so
  1186.      * yy_get_previous_state() will have with '^' rules active.
  1187.      */
  1188.  
  1189.     yytext_ptr = &yy_current_buffer->yy_ch_buf[1];
  1190.  
  1191.     return ret_val;
  1192.     }
  1193.  
  1194.  
  1195. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1196.  
  1197. static yy_state_type yy_get_previous_state()
  1198.     {
  1199.     register yy_state_type yy_current_state;
  1200.     register char *yy_cp;
  1201.  
  1202.     yy_current_state = yy_start;
  1203.  
  1204.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1205.         {
  1206.         register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1207.         if ( yy_accept[yy_current_state] )
  1208.             {
  1209.             yy_last_accepting_state = yy_current_state;
  1210.             yy_last_accepting_cpos = yy_cp;
  1211.             }
  1212.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1213.             {
  1214.             yy_current_state = (int) yy_def[yy_current_state];
  1215.             if ( yy_current_state >= 144 )
  1216.                 yy_c = yy_meta[(unsigned int) yy_c];
  1217.             }
  1218.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1219.         }
  1220.  
  1221.     return yy_current_state;
  1222.     }
  1223.  
  1224.  
  1225. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1226.  *
  1227.  * synopsis
  1228.  *    next_state = yy_try_NUL_trans( current_state );
  1229.  */
  1230.  
  1231. #ifdef YY_USE_PROTOS
  1232. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  1233. #else
  1234. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1235. yy_state_type yy_current_state;
  1236. #endif
  1237.     {
  1238.     register int yy_is_jam;
  1239.     register char *yy_cp = yy_c_buf_p;
  1240.  
  1241.     register YY_CHAR yy_c = 1;
  1242.     if ( yy_accept[yy_current_state] )
  1243.         {
  1244.         yy_last_accepting_state = yy_current_state;
  1245.         yy_last_accepting_cpos = yy_cp;
  1246.         }
  1247.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1248.         {
  1249.         yy_current_state = (int) yy_def[yy_current_state];
  1250.         if ( yy_current_state >= 144 )
  1251.             yy_c = yy_meta[(unsigned int) yy_c];
  1252.         }
  1253.     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1254.     yy_is_jam = (yy_current_state == 143);
  1255.  
  1256.     return yy_is_jam ? 0 : yy_current_state;
  1257.     }
  1258.  
  1259.  
  1260. #ifdef YY_USE_PROTOS
  1261. static void yyunput( int c, register char *yy_bp )
  1262. #else
  1263. static void yyunput( c, yy_bp )
  1264. int c;
  1265. register char *yy_bp;
  1266. #endif
  1267.     {
  1268.     register char *yy_cp = yy_c_buf_p;
  1269.  
  1270.     /* undo effects of setting up yytext */
  1271.     *yy_cp = yy_hold_char;
  1272.  
  1273.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1274.         { /* need to shift things up to make room */
  1275.         /* +2 for EOB chars. */
  1276.         register int number_to_move = yy_n_chars + 2;
  1277.         register char *dest = &yy_current_buffer->yy_ch_buf[
  1278.                     yy_current_buffer->yy_buf_size + 2];
  1279.         register char *source =
  1280.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  1281.  
  1282.         while ( source > yy_current_buffer->yy_ch_buf )
  1283.             *--dest = *--source;
  1284.  
  1285.         yy_cp += dest - source;
  1286.         yy_bp += dest - source;
  1287.         yy_n_chars = yy_current_buffer->yy_buf_size;
  1288.  
  1289.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1290.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1291.         }
  1292.  
  1293.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  1294.         yy_cp[-2] = '\n';
  1295.  
  1296.     *--yy_cp = (char) c;
  1297.  
  1298.  
  1299.     /* Note: the formal parameter *must* be called "yy_bp" for this
  1300.      * macro to now work correctly.
  1301.      */
  1302.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  1303.     }
  1304.  
  1305.  
  1306. #ifdef __cplusplus
  1307. static int yyinput()
  1308. #else
  1309. static int input()
  1310. #endif
  1311.     {
  1312.     int c;
  1313.  
  1314.     *yy_c_buf_p = yy_hold_char;
  1315.  
  1316.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1317.         {
  1318.         /* yy_c_buf_p now points to the character we want to return.
  1319.          * If this occurs *before* the EOB characters, then it's a
  1320.          * valid NUL; if not, then we've hit the end of the buffer.
  1321.          */
  1322.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1323.             /* This was really a NUL. */
  1324.             *yy_c_buf_p = '\0';
  1325.  
  1326.         else
  1327.             { /* need more input */
  1328.             yytext_ptr = yy_c_buf_p;
  1329.             ++yy_c_buf_p;
  1330.  
  1331.             switch ( yy_get_next_buffer() )
  1332.                 {
  1333.                 case EOB_ACT_END_OF_FILE:
  1334.                     {
  1335.                     if ( yywrap() )
  1336.                         {
  1337.                         yy_c_buf_p =
  1338.                         yytext_ptr + YY_MORE_ADJ;
  1339.                         return EOF;
  1340.                         }
  1341.  
  1342.                     YY_NEW_FILE;
  1343. #ifdef __cplusplus
  1344.                     return yyinput();
  1345. #else
  1346.                     return input();
  1347. #endif
  1348.                     }
  1349.  
  1350.                 case EOB_ACT_CONTINUE_SCAN:
  1351.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1352.                     break;
  1353.  
  1354.                 case EOB_ACT_LAST_MATCH:
  1355. #ifdef __cplusplus
  1356.                     YY_FATAL_ERROR(
  1357.                     "unexpected last match in yyinput()" );
  1358. #else
  1359.                     YY_FATAL_ERROR(
  1360.                     "unexpected last match in input()" );
  1361. #endif
  1362.                 }
  1363.             }
  1364.         }
  1365.  
  1366.     c = *yy_c_buf_p;
  1367.     *yy_c_buf_p = '\0';    /* preserve yytext */
  1368.     yy_hold_char = *++yy_c_buf_p;
  1369.  
  1370.     return c;
  1371.     }
  1372.  
  1373.  
  1374. #ifdef YY_USE_PROTOS
  1375. void yyrestart( FILE *input_file )
  1376. #else
  1377. void yyrestart( input_file )
  1378. FILE *input_file;
  1379. #endif
  1380.     {
  1381.     if ( ! yy_current_buffer )
  1382.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1383.  
  1384.     yy_init_buffer( yy_current_buffer, input_file );
  1385.     yy_load_buffer_state();
  1386.     }
  1387.  
  1388.  
  1389. #ifdef YY_USE_PROTOS
  1390. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1391. #else
  1392. void yy_switch_to_buffer( new_buffer )
  1393. YY_BUFFER_STATE new_buffer;
  1394. #endif
  1395.     {
  1396.     if ( yy_current_buffer == new_buffer )
  1397.         return;
  1398.  
  1399.     if ( yy_current_buffer )
  1400.         {
  1401.         /* Flush out information for old buffer. */
  1402.         *yy_c_buf_p = yy_hold_char;
  1403.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1404.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1405.         }
  1406.  
  1407.     yy_current_buffer = new_buffer;
  1408.     yy_load_buffer_state();
  1409.  
  1410.     /* We don't actually know whether we did this switch during
  1411.      * EOF (yywrap()) processing, but the only time this flag
  1412.      * is looked at is after yywrap() is called, so it's safe
  1413.      * to go ahead and always set it.
  1414.      */
  1415.     yy_did_buffer_switch_on_eof = 1;
  1416.     }
  1417.  
  1418.  
  1419. #ifdef YY_USE_PROTOS
  1420. void yy_load_buffer_state( void )
  1421. #else
  1422. void yy_load_buffer_state()
  1423. #endif
  1424.     {
  1425.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1426.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1427.     yyin = yy_current_buffer->yy_input_file;
  1428.     yy_hold_char = *yy_c_buf_p;
  1429.     }
  1430.  
  1431.  
  1432. #ifdef YY_USE_PROTOS
  1433. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1434. #else
  1435. YY_BUFFER_STATE yy_create_buffer( file, size )
  1436. FILE *file;
  1437. int size;
  1438. #endif
  1439.     {
  1440.     YY_BUFFER_STATE b;
  1441.  
  1442.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1443.  
  1444.     if ( ! b )
  1445.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1446.  
  1447.     b->yy_buf_size = size;
  1448.  
  1449.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1450.      * we need to put in 2 end-of-buffer characters.
  1451.      */
  1452.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  1453.  
  1454.     if ( ! b->yy_ch_buf )
  1455.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1456.  
  1457.     yy_init_buffer( b, file );
  1458.  
  1459.     return b;
  1460.     }
  1461.  
  1462.  
  1463. #ifdef YY_USE_PROTOS
  1464. void yy_delete_buffer( YY_BUFFER_STATE b )
  1465. #else
  1466. void yy_delete_buffer( b )
  1467. YY_BUFFER_STATE b;
  1468. #endif
  1469.     {
  1470.     if ( b == yy_current_buffer )
  1471.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  1472.  
  1473.     yy_flex_free( (void *) b->yy_ch_buf );
  1474.     yy_flex_free( (void *) b );
  1475.     }
  1476.  
  1477.  
  1478. #ifdef YY_USE_PROTOS
  1479. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1480. #else
  1481. void yy_init_buffer( b, file )
  1482. YY_BUFFER_STATE b;
  1483. FILE *file;
  1484. #endif
  1485.     {
  1486.     b->yy_input_file = file;
  1487.  
  1488.     /* We put in the '\n' and start reading from [1] so that an
  1489.      * initial match-at-newline will be true.
  1490.      */
  1491.  
  1492.     b->yy_ch_buf[0] = '\n';
  1493.     b->yy_n_chars = 1;
  1494.  
  1495.     /* We always need two end-of-buffer characters.  The first causes
  1496.      * a transition to the end-of-buffer state.  The second causes
  1497.      * a jam in that state.
  1498.      */
  1499.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1500.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1501.  
  1502.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1503.  
  1504.     b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;
  1505.  
  1506.     b->yy_fill_buffer = 1;
  1507.  
  1508.     b->yy_eof_status = EOF_NOT_SEEN;
  1509.     }
  1510.  
  1511.  
  1512. #ifdef YY_USE_PROTOS
  1513. static void yy_push_state( int new_state )
  1514. #else
  1515. static void yy_push_state( new_state )
  1516. int new_state;
  1517. #endif
  1518.     {
  1519.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  1520.         {
  1521.         int new_size;
  1522.  
  1523.         yy_start_stack_depth += YY_START_STACK_INCR;
  1524.         new_size = yy_start_stack_depth * sizeof( int );
  1525.  
  1526.         if ( ! yy_start_stack )
  1527.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  1528.  
  1529.         else
  1530.             yy_start_stack = (int *) yy_flex_realloc(
  1531.                     (void *) yy_start_stack, new_size );
  1532.  
  1533.         if ( ! yy_start_stack )
  1534.             YY_FATAL_ERROR(
  1535.             "out of memory expanding start-condition stack" );
  1536.         }
  1537.  
  1538.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  1539.  
  1540.     BEGIN(new_state);
  1541.     }
  1542.  
  1543.  
  1544. static void yy_pop_state()
  1545.     {
  1546.     if ( --yy_start_stack_ptr < 0 )
  1547.         YY_FATAL_ERROR( "start-condition stack underflow" );
  1548.  
  1549.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  1550.     }
  1551.  
  1552.  
  1553. static int yy_top_state()
  1554.     {
  1555.     return yy_start_stack[yy_start_stack_ptr - 1];
  1556.     }
  1557.  
  1558.  
  1559. #ifdef YY_USE_PROTOS
  1560. static void yy_fatal_error( const char msg[] )
  1561. #else
  1562. static void yy_fatal_error( msg )
  1563. char msg[];
  1564. #endif
  1565.     {
  1566.     (void) fprintf( stderr, "%s\n", msg );
  1567.     exit( 1 );
  1568.     }
  1569.  
  1570.  
  1571.  
  1572. /* Redefine yyless() so it works in section 3 code. */
  1573.  
  1574. #undef yyless
  1575. #define yyless(n) \
  1576.     do \
  1577.         { \
  1578.         /* Undo effects of setting up yytext. */ \
  1579.         yytext[yyleng] = yy_hold_char; \
  1580.         yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
  1581.         yy_hold_char = *yy_c_buf_p; \
  1582.         *yy_c_buf_p = '\0'; \
  1583.         yyleng = n; \
  1584.         } \
  1585.     while ( 0 )
  1586.  
  1587.  
  1588. /* Internal utility routines. */
  1589.  
  1590. #ifndef yytext_ptr
  1591. #ifdef YY_USE_PROTOS
  1592. static void yy_flex_strcpy( char *s1, const char *s2 )
  1593. #else
  1594. static void yy_flex_strcpy( s1, s2 )
  1595. char *s1;
  1596. const char *s2;
  1597. #endif
  1598.     {
  1599.     while ( (*(s1++) = *(s2++)) )
  1600.         ;
  1601.     }
  1602. #endif
  1603.  
  1604.  
  1605. #ifdef YY_USE_PROTOS
  1606. static void *yy_flex_alloc( unsigned int size )
  1607. #else
  1608. static void *yy_flex_alloc( size )
  1609. unsigned int size;
  1610. #endif
  1611.     {
  1612.     return (void *) malloc( size );
  1613.     }
  1614.  
  1615. #ifdef YY_USE_PROTOS
  1616. static void *yy_flex_realloc( void *ptr, unsigned int size )
  1617. #else
  1618. static void *yy_flex_realloc( ptr, size )
  1619. void *ptr;
  1620. unsigned int size;
  1621. #endif
  1622.     {
  1623.     return (void *) realloc( ptr, size );
  1624.     }
  1625.  
  1626. #ifdef YY_USE_PROTOS
  1627. static void yy_flex_free( void *ptr )
  1628. #else
  1629. static void yy_flex_free( ptr )
  1630. void *ptr;
  1631. #endif
  1632.     {
  1633.     free( ptr );
  1634.     }
  1635. # line 178 "scan.l"
  1636.  
  1637.  
  1638.  
  1639.  
  1640. /* This is the way to get multiple files input into lex. */
  1641.  
  1642. int
  1643. yywrap()
  1644. {
  1645.   if (!open_new_file ()) return (1);    /* EOF on standard in. */
  1646.   return (0);                /* We have more input. */
  1647. }
  1648.