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

Click here to go back to the directory listing.
Click here to download this file.
last modified: 1997-04-21 21:57:52