home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / bc-1.03-base.tgz / bc-1.03-base.tar / fsf / bc / scan.c.dist < prev    next >
Text File  |  1994-11-03  |  36KB  |  1,379 lines

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