home *** CD-ROM | disk | FTP | other *** search
- #define FLEX_COMPRESSED
- /* A lexical scanner generated by flex */
-
- /* scanner skeleton version:
- * $Header: flex.skel,v 2.0 89/06/20 15:49:46 vern Locked $
- */
-
- #include <stdio.h>
-
- #define FLEX_SCANNER
-
- /* amount of stuff to slurp up with each read */
- #ifndef YY_READ_BUF_SIZE
- #ifdef LIM64K
- #define YY_READ_BUF_SIZE 1024
- #else
- #define YY_READ_BUF_SIZE 8192
- #endif
- #endif
-
- #ifndef YY_BUF_SIZE
- #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of input buffer */
- #endif
-
- /* returned upon end-of-file */
- #define YY_END_TOK 0
-
- /* copy whatever the last rule matched to the standard output */
-
- #define ECHO fputs( yytext, yyout )
-
- /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
- #define YY_INPUT(buf,result,max_size) \
- result = fread( buf, 1, max_size, yyin ); \
- if ( ferror(yyin) ) \
- YY_FATAL_ERROR( "fread() in flex scanner failed" );
-
- #define YY_NULL 0
- #define yyterminate() return ( YY_NULL )
-
- /* report a fatal error */
- #define YY_FATAL_ERROR(msg) \
- { \
- fputs( msg, stderr ); \
- putc( '\n', stderr ); \
- exit( 1 ); \
- }
-
- /* default yywrap function - always treat EOF as an EOF */
- #define yywrap() 1
-
- /* enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN
- */
- #define BEGIN yy_start = 1 + 2 *
-
- /* action number for EOF rule of a given start state */
- #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
- /* special action meaning "start processing a new file" */
- #define YY_NEW_FILE goto new_file
-
- /* default declaration of generated scanner - a define so the user can
- * easily add parameters
- */
- #ifdef __STDC__
- #define YY_DECL int yylex( void )
- #else
- #define YY_DECL int yylex()
- #endif
-
- /* code executed at the end of each rule */
- #define YY_BREAK break;
-
- #define YY_END_OF_BUFFER_CHAR 0
-
- /* done after the current pattern has been matched and before the
- * corresponding action - sets up yytext
- */
- #define YY_DO_BEFORE_ACTION \
- yytext = yy_bp; \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
-
- /* returns the length of the matched text */
- #define yyleng (yy_cp - yy_bp)
-
- #define EOB_ACT_RESTART_SCAN 0
- #define EOB_ACT_END_OF_FILE 1
- #define EOB_ACT_LAST_MATCH 2
-
- /* return all but the first 'n' matched characters back to the input stream */
- #define yyless(n) \
- { \
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
- yy_c_buf_p = yy_cp = yy_bp + n; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- }
-
- #define unput(c) yyunput( c, yy_bp )
-
- #define YY_USER_ACTION
-
- FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
- char *yytext;
-
- #ifndef __STDC__
- #define const
- #endif
-
- # line 1 "l.orblex"
- #define INITIAL 0
- # line 2 "l.orblex"
- /*
- * Module: orbits.l
- * Creation: 28th July, 1991.
- * Last modified: 6th October, 1991.
- *
- * Copyright (C) 1991 Neil Hoggarth.
- *
- * This file contains instructions to the "lex" lexical analyzer
- * generator, or some compatible genarator. The file produced by the
- * generator contains C source code for the lexical analyzer for the
- * "orbits" program.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 1, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
- #include <stdlib.h>
- #include "orbpar.h"
- extern int yyline;
- # line 35 "l.orblex"
- #define YY_END_OF_BUFFER 8
- typedef int yy_state_type;
- static const short int yy_accept[17] =
- { 0,
- 0, 0, 8, 6, 4, 5, 6, 6, 6, 2,
- 0, 1, 0, 2, 3, 0
- } ;
-
- static const char yy_ec[128] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 1, 1, 4, 1, 1, 1, 1, 1,
- 1, 1, 5, 1, 6, 7, 1, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
- } ;
-
- static const char yy_meta[9] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1
- } ;
-
- static const short int yy_base[18] =
- { 0,
- 0, 0, 17, 18, 18, 18, 13, 2, 7, 0,
- 11, 18, 5, 0, 4, 18, 10
- } ;
-
- static const short int yy_def[18] =
- { 0,
- 16, 1, 16, 16, 16, 16, 17, 16, 16, 8,
- 17, 16, 16, 8, 16, 0, 16
- } ;
-
- static const short int yy_nxt[27] =
- { 0,
- 4, 5, 6, 7, 8, 8, 9, 10, 13, 14,
- 11, 15, 15, 12, 15, 12, 16, 3, 16, 16,
- 16, 16, 16, 16, 16, 16
- } ;
-
- static const short int yy_chk[27] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 8, 8,
- 17, 15, 13, 11, 9, 7, 3, 16, 16, 16,
- 16, 16, 16, 16, 16, 16
- } ;
-
- /* the intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed
- */
- #define REJECT reject_used_but_not_detected
- #define yymore() yymore_used_but_not_detected
-
- /* these variables are all declared out here so that section 3 code can
- * manipulate them
- */
- static char *yy_c_buf_p; /* points to current character in buffer */
- static int yy_init = 1; /* whether we need to initialize */
- static int yy_start = 0; /* start state number */
-
- /* true when we've seen an EOF for the current input file */
- static int yy_eof_has_been_seen;
-
- static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
- /* yy_ch_buf has to be 2 characters longer than YY_BUF_SIZE because we need
- * to put in 2 end-of-buffer characters (this is explained where it is
- * done) at the end of yy_ch_buf
- */
- static char yy_ch_buf[YY_BUF_SIZE + 2];
-
- /* yy_hold_char holds the character lost when yytext is formed */
- static char yy_hold_char;
-
- static yy_state_type yy_last_accepting_state;
- static char *yy_last_accepting_cpos;
-
- #ifdef __STDC__
- static yy_state_type yy_get_previous_state( void );
- static int yy_get_next_buffer( void );
- static void yyunput( int c, char *buf_ptr );
- static int input( void );
- static void yyrestart( FILE *input_file );
- #else
- static yy_state_type yy_get_previous_state();
- static int yy_get_next_buffer();
- static void yyunput();
- static int input();
- static void yyrestart();
- #endif
-
- YY_DECL
- {
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
-
-
-
-
- if ( yy_init )
- {
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- new_file:
- /* this is where we enter upon encountering an end-of-file and
- * yywrap() indicating that we should continue processing
- */
-
- /* we put in the '\n' and start reading from [1] so that an
- * initial match-at-newline will be true.
- */
-
- yy_ch_buf[0] = '\n';
- yy_n_chars = 1;
-
- /* we always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- yy_eof_has_been_seen = 0;
-
- yytext = yy_c_buf_p = &yy_ch_buf[1];
- yy_hold_char = *yy_c_buf_p;
- yy_init = 0;
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* support of yytext */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of the
- * current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
- do
- {
- register char yy_c = yy_ec[*yy_cp];
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = yy_def[yy_current_state];
- if ( yy_current_state >= 17 )
- yy_c = yy_meta[yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- ++yy_cp;
- }
- while ( yy_current_state != 16 );
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
-
- /* bogus while loop to let YY_BACK_TRACK, EOB_ACT_LAST_MATCH,
- * and EOF actions branch here without introducing an optimizer-
- * daunting goto
- */
- while ( 1 )
- {
- yy_act = yy_accept[yy_current_state];
-
- YY_DO_BEFORE_ACTION;
- YY_USER_ACTION;
-
- #ifdef FLEX_DEBUG
- fprintf( stderr, "--accepting rule #%d (\"%s\")\n",
- yy_act, yytext );
- #endif
-
- do_action: /* this label is used only to access EOF actions */
- switch ( yy_act )
- {
- case 0: /* must backtrack */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- continue; /* go to "YY_DO_BEFORE_ACTION" */
-
- case 1:
- # line 37 "l.orblex"
- {yyline++;return(RETURN);};
- YY_BREAK
- case 2:
- # line 38 "l.orblex"
- return(NUM);
- YY_BREAK
- case 3:
- # line 39 "l.orblex"
- return(NUM);
- YY_BREAK
- case 4:
- # line 40 "l.orblex"
- ;
- YY_BREAK
- case 5:
- # line 41 "l.orblex"
- {yyline++;return(RETURN);};
- YY_BREAK
- case 6:
- # line 42 "l.orblex"
- return(yytext[0]);
- YY_BREAK
- case 7:
- # line 44 "l.orblex"
- ECHO;
- YY_BREAK
- case YY_STATE_EOF(INITIAL):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
-
- yytext = yy_bp;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- {
- /* note: because we've taken care in
- * yy_get_next_buffer() to have set up yytext,
- * we can now set up yy_c_buf_p so that if some
- * total hoser (like flex itself) wants
- * to call the scanner after we return the
- * YY_NULL, it'll still work - another YY_NULL
- * will get returned.
- */
- yy_c_buf_p = yytext;
-
- yy_act = YY_STATE_EOF((yy_start - 1) / 2);
- goto do_action;
- }
-
- else
- YY_NEW_FILE;
- }
- break;
-
- case EOB_ACT_RESTART_SCAN:
- yy_c_buf_p = yytext;
- yy_hold_char = *yy_c_buf_p;
- break;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p = &yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext;
- continue; /* go to "YY_DO_BEFORE_ACTION" */
- }
- break;
-
- default:
- printf( "action # %d\n", yy_act );
- YY_FATAL_ERROR( "fatal flex scanner internal error" );
- }
-
- break; /* exit bogus while loop */
- }
- }
- }
-
-
- /* yy_get_next_buffer - try to read in new buffer
- *
- * synopsis
- * int yy_get_next_buffer();
- *
- * returns a code representing an action
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_RESTART_SCAN - restart the scanner
- * EOB_ACT_END_OF_FILE - end of file
- */
-
- static int yy_get_next_buffer()
-
- {
- register char *dest = yy_ch_buf;
- register char *source = yytext - 1; /* copy prev. char, too */
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p != &yy_ch_buf[yy_n_chars + 1] )
- {
- YY_FATAL_ERROR( "NULL in input" );
- /*NOTREACHED*/
- }
-
- /* try to read more data */
-
- /* first move last chars to start of buffer */
- number_to_move = yy_c_buf_p - yytext;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_eof_has_been_seen )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_n_chars = 0;
-
- else
- {
- int num_to_read = YY_BUF_SIZE - number_to_move - 1;
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* read in more data */
- YY_INPUT( (&yy_ch_buf[number_to_move]), yy_n_chars, num_to_read );
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == 1 )
- ret_val = EOB_ACT_END_OF_FILE;
- else
- ret_val = EOB_ACT_LAST_MATCH;
-
- yy_eof_has_been_seen = 1;
- }
-
- else
- ret_val = EOB_ACT_RESTART_SCAN;
-
- yy_n_chars += number_to_move;
- yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- /* yytext begins at the second character in
- * yy_ch_buf; the first character is the one which
- * preceded it before reading in the latest buffer;
- * it needs to be kept around in case it's a
- * newline, so yy_get_previous_state() will have
- * with '^' rules active
- */
-
- yytext = &yy_ch_buf[1];
-
- return ( ret_val );
- }
-
-
- /* yy_get_previous_state - get the state just before the EOB char was reached
- *
- * synopsis
- * yy_state_type yy_get_previous_state();
- */
-
- static yy_state_type yy_get_previous_state()
-
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = yy_start;
-
- for ( yy_cp = yytext; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register char yy_c = yy_ec[*yy_cp];
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = yy_def[yy_current_state];
- if ( yy_current_state >= 17 )
- yy_c = yy_meta[yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- }
-
- return ( yy_current_state );
- }
-
-
- #ifdef __STDC__
- static void yyunput( int c, register char *yy_bp )
- #else
- static void yyunput( c, yy_bp )
- int c;
- register char *yy_bp;
- #endif
-
- {
- register char *yy_cp = yy_c_buf_p;
-
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-
- if ( yy_cp < yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
- register char *dest = &yy_ch_buf[YY_BUF_SIZE + 2];
- register char *source = &yy_ch_buf[number_to_move];
-
- while ( source > yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += dest - source;
- yy_bp += dest - source;
-
- if ( yy_cp < yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
- yy_cp[-2] = '\n';
-
- *--yy_cp = c;
-
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- }
-
-
- static int input()
-
- {
- int c;
- char *yy_cp = yy_c_buf_p;
-
- *yy_cp = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- { /* need more input */
- yytext = yy_c_buf_p;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- /* this code, unfortunately, is somewhat redundant with
- * that above
- */
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- {
- yy_c_buf_p = yytext;
- return ( EOF );
- }
-
- yy_ch_buf[0] = '\n';
- yy_n_chars = 1;
- yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
- yy_eof_has_been_seen = 0;
- yytext = yy_c_buf_p = &yy_ch_buf[1];
- yy_hold_char = *yy_c_buf_p;
-
- return ( input() );
- }
- break;
-
- case EOB_ACT_RESTART_SCAN:
- yy_c_buf_p = yytext;
- break;
-
- case EOB_ACT_LAST_MATCH:
- YY_FATAL_ERROR( "unexpected last match in input()" );
- }
- }
-
- c = *yy_c_buf_p;
- yy_hold_char = *++yy_c_buf_p;
-
- return ( c );
- }
-
-
- #ifdef __STDC__
- static void yyrestart( FILE *input_file )
- #else
- static void yyrestart( input_file )
- FILE *input_file;
- #endif
-
- {
- if ( yyin != stdin )
- fclose( yyin );
-
- yyin = input_file;
- yy_init = 1;
- }
- # line 44 "l.orblex"
-
-