/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define PAT_DECL_Y__FLEX_MAJOR_VERSION 2 #define PAT_DECL_Y__FLEX_MINOR_VERSION 5 #include #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define PAT_DECL_Y__USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define PAT_DECL_Y__USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define PAT_DECL_Y__USE_PROTOS #define PAT_DECL_Y__USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define PAT_DECL_Y__USE_CONST #define PAT_DECL_Y__USE_PROTOS #endif #ifdef PAT_DECL_Y__USE_CONST #define pat_decl_y_const const #else #define pat_decl_y_const #endif #ifdef PAT_DECL_Y__USE_PROTOS #define PAT_DECL_Y__PROTO(proto) proto #else #define PAT_DECL_Y__PROTO(proto) () #endif /* Returned upon end-of-file. */ #define PAT_DECL_Y__NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define PAT_DECL_Y__SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* 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 pat_decl_y__start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The PAT_DECL_Y_STATE alias is for lex * compatibility. */ #define PAT_DECL_Y__START ((pat_decl_y__start - 1) / 2) #define PAT_DECL_Y_STATE PAT_DECL_Y__START /* Action number for EOF rule of a given start state. */ #define PAT_DECL_Y__STATE_EOF(state) (PAT_DECL_Y__END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define PAT_DECL_Y__NEW_FILE pat_decl_y_restart( pat_decl_y_in ) #define PAT_DECL_Y__END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define PAT_DECL_Y__BUF_SIZE 16384 typedef struct pat_decl_y__buffer_state *PAT_DECL_Y__BUFFER_STATE; extern int pat_decl_y_leng; extern FILE *pat_decl_y_in, *pat_decl_y_out; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * pat_decl_y_less( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the pat_decl_y_less() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define pat_decl_y_less(n) \ do \ { \ /* Undo effects of setting up pat_decl_y_text. */ \ *pat_decl_y__cp = pat_decl_y__hold_char; \ PAT_DECL_Y__RESTORE_PAT_DECL_Y__MORE_OFFSET \ pat_decl_y__c_buf_p = pat_decl_y__cp = pat_decl_y__bp + n - PAT_DECL_Y__MORE_ADJ; \ PAT_DECL_Y__DO_BEFORE_ACTION; /* set up pat_decl_y_text again */ \ } \ while ( 0 ) #define unput(c) pat_decl_y_unput( c, pat_decl_y_text_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int pat_decl_y__size_t; struct pat_decl_y__buffer_state { FILE *pat_decl_y__input_file; char *pat_decl_y__ch_buf; /* input buffer */ char *pat_decl_y__buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ pat_decl_y__size_t pat_decl_y__buf_size; /* Number of characters read into pat_decl_y__ch_buf, not including EOB * characters. */ int pat_decl_y__n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int pat_decl_y__is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int pat_decl_y__is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int pat_decl_y__at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int pat_decl_y__fill_buffer; int pat_decl_y__buffer_status; #define PAT_DECL_Y__BUFFER_NEW 0 #define PAT_DECL_Y__BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as PAT_DECL_Y__EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via pat_decl_y_restart()), so that the user can continue scanning by * just pointing pat_decl_y_in at a new input file. */ #define PAT_DECL_Y__BUFFER_EOF_PENDING 2 }; static PAT_DECL_Y__BUFFER_STATE pat_decl_y__current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define PAT_DECL_Y__CURRENT_BUFFER pat_decl_y__current_buffer /* pat_decl_y__hold_char holds the character lost when pat_decl_y_text is formed. */ static char pat_decl_y__hold_char; static int pat_decl_y__n_chars; /* number of characters read into pat_decl_y__ch_buf */ int pat_decl_y_leng; /* Points to current character in buffer. */ static char *pat_decl_y__c_buf_p = (char *) 0; static int pat_decl_y__init = 1; /* whether we need to initialize */ static int pat_decl_y__start = 0; /* start state number */ /* Flag which is used to allow pat_decl_y_wrap()'s to do buffer switches * instead of setting up a fresh pat_decl_y_in. A bit of a hack ... */ static int pat_decl_y__did_buffer_switch_on_eof; void pat_decl_y_restart PAT_DECL_Y__PROTO(( FILE *input_file )); void pat_decl_y__switch_to_buffer PAT_DECL_Y__PROTO(( PAT_DECL_Y__BUFFER_STATE new_buffer )); void pat_decl_y__load_buffer_state PAT_DECL_Y__PROTO(( void )); PAT_DECL_Y__BUFFER_STATE pat_decl_y__create_buffer PAT_DECL_Y__PROTO(( FILE *file, int size )); void pat_decl_y__delete_buffer PAT_DECL_Y__PROTO(( PAT_DECL_Y__BUFFER_STATE b )); void pat_decl_y__init_buffer PAT_DECL_Y__PROTO(( PAT_DECL_Y__BUFFER_STATE b, FILE *file )); void pat_decl_y__flush_buffer PAT_DECL_Y__PROTO(( PAT_DECL_Y__BUFFER_STATE b )); #define PAT_DECL_Y__FLUSH_BUFFER pat_decl_y__flush_buffer( pat_decl_y__current_buffer ) PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_buffer PAT_DECL_Y__PROTO(( char *base, pat_decl_y__size_t size )); PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_string PAT_DECL_Y__PROTO(( pat_decl_y_const char *pat_decl_y__str )); PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_bytes PAT_DECL_Y__PROTO(( pat_decl_y_const char *bytes, int len )); static void *pat_decl_y__flex_alloc PAT_DECL_Y__PROTO(( pat_decl_y__size_t )); static void *pat_decl_y__flex_realloc PAT_DECL_Y__PROTO(( void *, pat_decl_y__size_t )); static void pat_decl_y__flex_free PAT_DECL_Y__PROTO(( void * )); #define pat_decl_y__new_buffer pat_decl_y__create_buffer #define pat_decl_y__set_interactive(is_interactive) \ { \ if ( ! pat_decl_y__current_buffer ) \ pat_decl_y__current_buffer = pat_decl_y__create_buffer( pat_decl_y_in, PAT_DECL_Y__BUF_SIZE ); \ pat_decl_y__current_buffer->pat_decl_y__is_interactive = is_interactive; \ } #define pat_decl_y__set_bol(at_bol) \ { \ if ( ! pat_decl_y__current_buffer ) \ pat_decl_y__current_buffer = pat_decl_y__create_buffer( pat_decl_y_in, PAT_DECL_Y__BUF_SIZE ); \ pat_decl_y__current_buffer->pat_decl_y__at_bol = at_bol; \ } #define PAT_DECL_Y__AT_BOL() (pat_decl_y__current_buffer->pat_decl_y__at_bol) typedef unsigned char PAT_DECL_Y__CHAR; FILE *pat_decl_y_in = (FILE *) 0, *pat_decl_y_out = (FILE *) 0; typedef int pat_decl_y__state_type; extern char *pat_decl_y_text; #define pat_decl_y_text_ptr pat_decl_y_text static pat_decl_y__state_type pat_decl_y__get_previous_state PAT_DECL_Y__PROTO(( void )); static pat_decl_y__state_type pat_decl_y__try_NUL_trans PAT_DECL_Y__PROTO(( pat_decl_y__state_type current_state )); static int pat_decl_y__get_next_buffer PAT_DECL_Y__PROTO(( void )); static void pat_decl_y__fatal_error PAT_DECL_Y__PROTO(( pat_decl_y_const char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up pat_decl_y_text. */ #define PAT_DECL_Y__DO_BEFORE_ACTION \ pat_decl_y_text_ptr = pat_decl_y__bp; \ pat_decl_y_leng = (int) (pat_decl_y__cp - pat_decl_y__bp); \ pat_decl_y__hold_char = *pat_decl_y__cp; \ *pat_decl_y__cp = '\0'; \ pat_decl_y__c_buf_p = pat_decl_y__cp; #define PAT_DECL_Y__NUM_RULES 24 #define PAT_DECL_Y__END_OF_BUFFER 25 static pat_decl_y_const short int pat_decl_y__accept[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 23, 21, 22, 23, 23, 23, 7, 8, 4, 23, 3, 16, 16, 1, 2, 5, 6, 18, 18, 18, 18, 17, 17, 17, 17, 23, 23, 9, 11, 11, 11, 0, 0, 19, 0, 0, 16, 2, 10, 18, 0, 0, 0, 0, 17, 15, 12, 0, 20, 0, 0, 14, 13, 0 } ; static pat_decl_y_const int pat_decl_y__ec[256] = { 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, 4, 5, 1, 1, 1, 6, 7, 8, 9, 10, 11, 12, 13, 1, 14, 15, 16, 16, 16, 16, 16, 16, 17, 17, 18, 19, 20, 21, 22, 9, 1, 23, 24, 23, 23, 23, 23, 25, 25, 25, 25, 25, 25, 25, 25, 26, 25, 25, 25, 25, 25, 27, 25, 25, 28, 25, 25, 1, 1, 1, 1, 29, 1, 23, 24, 23, 23, 23, 23, 25, 25, 25, 25, 25, 25, 25, 25, 26, 25, 25, 25, 25, 25, 27, 25, 25, 28, 25, 25, 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, 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 pat_decl_y_const int pat_decl_y__meta[30] = { 0, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 3, 3, 4, 4, 5, 4, 4 } ; static pat_decl_y_const short int pat_decl_y__base[69] = { 0, 0, 0, 29, 0, 126, 125, 35, 36, 134, 137, 137, 137, 51, 130, 53, 137, 137, 137, 120, 137, 137, 55, 137, 112, 109, 137, 100, 69, 70, 71, 0, 0, 0, 124, 123, 122, 137, 72, 73, 74, 75, 122, 137, 118, 114, 66, 78, 137, 67, 66, 70, 72, 0, 0, 137, 137, 90, 137, 90, 88, 137, 137, 137, 106, 109, 113, 118, 88 } ; static pat_decl_y_const short int pat_decl_y__def[69] = { 0, 63, 1, 63, 3, 1, 1, 1, 1, 63, 63, 63, 63, 63, 64, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 65, 65, 65, 65, 66, 66, 66, 66, 63, 63, 63, 65, 65, 65, 63, 64, 63, 63, 67, 63, 63, 63, 65, 65, 63, 63, 68, 66, 63, 63, 67, 63, 63, 68, 63, 63, 0, 63, 63, 63, 63, 63 } ; static pat_decl_y_const short int pat_decl_y__nxt[167] = { 0, 10, 11, 12, 13, 14, 15, 16, 17, 10, 10, 18, 19, 20, 21, 22, 22, 22, 23, 24, 25, 10, 26, 27, 28, 27, 29, 27, 30, 10, 10, 31, 32, 13, 14, 15, 16, 17, 33, 33, 18, 33, 20, 33, 33, 33, 33, 23, 24, 25, 10, 26, 33, 34, 10, 35, 33, 36, 10, 38, 38, 39, 39, 40, 40, 41, 41, 44, 44, 46, 46, 46, 46, 51, 52, 53, 51, 52, 53, 55, 46, 46, 46, 46, 41, 41, 59, 59, 59, 41, 41, 60, 62, 58, 61, 63, 50, 47, 50, 50, 50, 50, 50, 50, 59, 59, 59, 42, 42, 42, 42, 42, 49, 49, 49, 54, 54, 58, 54, 57, 57, 57, 57, 57, 56, 43, 53, 52, 51, 50, 48, 47, 45, 43, 63, 37, 37, 9, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 } ; static pat_decl_y_const short int pat_decl_y__chk[167] = { 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 8, 7, 8, 7, 8, 13, 13, 15, 15, 22, 22, 22, 22, 28, 29, 30, 38, 39, 40, 41, 46, 46, 46, 46, 51, 51, 52, 52, 52, 41, 41, 68, 60, 57, 59, 50, 49, 47, 28, 29, 30, 38, 39, 40, 59, 59, 59, 64, 64, 64, 64, 64, 65, 65, 65, 66, 66, 45, 66, 67, 67, 67, 67, 67, 44, 42, 36, 35, 34, 27, 25, 24, 19, 14, 9, 6, 5, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 } ; static pat_decl_y__state_type pat_decl_y__last_accepting_state; static char *pat_decl_y__last_accepting_cpos; /* 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 pat_decl_y_more() pat_decl_y_more_used_but_not_detected #define PAT_DECL_Y__MORE_ADJ 0 #define PAT_DECL_Y__RESTORE_PAT_DECL_Y__MORE_OFFSET char *pat_decl_y_text; #line 1 "../../../src/ppt/src/pat_decl_l.l" #define INITIAL 0 #line 2 "../../../src/ppt/src/pat_decl_l.l" /* * This file is part of the Alliance CAD System * Copyright (C) Laboratoire LIP6 - Département ASIM * Universite Pierre et Marie Curie * * Home page : http://www-asim.lip6.fr/alliance/ * E-mail : mailto:alliance-users@asim.lip6.fr * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Library General Public License as published * by the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ###--------------------------------------------------------------### */ /* file : pat_pars.lex */ /* date : Mar 13 2000 */ /* version : v109 */ /* author : Pirouz BAZARGAN SABET */ /* content : parser-driver function */ /* ###--------------------------------------------------------------### */ #include #include "mut.h" #include "pat.h" #include "pat_type.h" #include "pat_decl_y.h" extern int pat_decl_y_char; extern PAT_DECL_Y_STYPE pat_decl_y_lval; extern int pat_decl_y_nerrs; /* ICI LUDO #ifdef PAT_DECL_Y__DECL #undef PAT_DECL_Y__DECL #endif #define PAT_DECL_Y__DECL int pat_lex (lval_pnt) PAT_DECL_Y_STYPE *lval_pnt; #define pat_decl_y_lval (*lval_pnt) FIN LUDO */ /* ###--------------------------------------------------------------### */ /* function : lcl_search */ /* description : check that an identifier is a reserved word or not */ /* called func. : addht, addhtitem, gethtitem, namealloc */ /* ###--------------------------------------------------------------### */ static int lcl_search (key) char *key; { static ht *pt_hash = NULL; if (pt_hash == NULL) { pt_hash = addht (32); addhtitem (pt_hash, namealloc ("begin" ), BEGIN_ ); addhtitem (pt_hash, namealloc ("downto" ), DOWNTO ); addhtitem (pt_hash, namealloc ("end" ), END_ ); addhtitem (pt_hash, namealloc ("fs" ), FS ); addhtitem (pt_hash, namealloc ("in" ), _IN ); addhtitem (pt_hash, namealloc ("inout" ), _INOUT ); addhtitem (pt_hash, namealloc ("inspect" ), INSPECT ); addhtitem (pt_hash, namealloc ("ms" ), MS ); addhtitem (pt_hash, namealloc ("ns" ), NS ); addhtitem (pt_hash, namealloc ("ps" ), PS ); addhtitem (pt_hash, namealloc ("out" ), _OUT ); addhtitem (pt_hash, namealloc ("register"), REGISTER); addhtitem (pt_hash, namealloc ("save" ), SAVE ); addhtitem (pt_hash, namealloc ("signal" ), SIGNAL ); addhtitem (pt_hash, namealloc ("spy" ), SPY ); addhtitem (pt_hash, namealloc ("to" ), TO ); addhtitem (pt_hash, namealloc ("trace" ), TRACE ); addhtitem (pt_hash, namealloc ("us" ), US ); } return (gethtitem (pt_hash, namealloc (key))); } static char buff [1024]; #define INS_PAT 1 #define OUT_PAT 2 #define DTC_FRM 3 /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef PAT_DECL_Y__SKIP_PAT_DECL_Y_WRAP #ifdef __cplusplus extern "C" int pat_decl_y_wrap PAT_DECL_Y__PROTO(( void )); #else extern int pat_decl_y_wrap PAT_DECL_Y__PROTO(( void )); #endif #endif #ifndef PAT_DECL_Y__NO_UNPUT static void pat_decl_y_unput PAT_DECL_Y__PROTO(( int c, char *buf_ptr )); #endif #ifndef pat_decl_y_text_ptr static void pat_decl_y__flex_strncpy PAT_DECL_Y__PROTO(( char *, pat_decl_y_const char *, int )); #endif #ifdef PAT_DECL_Y__NEED_STRLEN static int pat_decl_y__flex_strlen PAT_DECL_Y__PROTO(( pat_decl_y_const char * )); #endif #ifndef PAT_DECL_Y__NO_INPUT #ifdef __cplusplus static int pat_decl_y_input PAT_DECL_Y__PROTO(( void )); #else static int input PAT_DECL_Y__PROTO(( void )); #endif #endif #if PAT_DECL_Y__STACK_USED static int pat_decl_y__start_stack_ptr = 0; static int pat_decl_y__start_stack_depth = 0; static int *pat_decl_y__start_stack = 0; #ifndef PAT_DECL_Y__NO_PUSH_STATE static void pat_decl_y__push_state PAT_DECL_Y__PROTO(( int new_state )); #endif #ifndef PAT_DECL_Y__NO_POP_STATE static void pat_decl_y__pop_state PAT_DECL_Y__PROTO(( void )); #endif #ifndef PAT_DECL_Y__NO_TOP_STATE static int pat_decl_y__top_state PAT_DECL_Y__PROTO(( void )); #endif #else #define PAT_DECL_Y__NO_PUSH_STATE 1 #define PAT_DECL_Y__NO_POP_STATE 1 #define PAT_DECL_Y__NO_TOP_STATE 1 #endif #ifdef PAT_DECL_Y__MALLOC_DECL PAT_DECL_Y__MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef PAT_DECL_Y__READ_BUF_SIZE #define PAT_DECL_Y__READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( pat_decl_y_text, pat_decl_y_leng, 1, pat_decl_y_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or PAT_DECL_Y__NULL, * is returned in "result". */ #ifndef PAT_DECL_Y__INPUT #define PAT_DECL_Y__INPUT(buf,result,max_size) \ if ( pat_decl_y__current_buffer->pat_decl_y__is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( pat_decl_y_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( pat_decl_y_in ) ) \ PAT_DECL_Y__FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, pat_decl_y_in )) == 0) \ && ferror( pat_decl_y_in ) ) \ PAT_DECL_Y__FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "pat_decl_y_terminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef pat_decl_y_terminate #define pat_decl_y_terminate() return PAT_DECL_Y__NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef PAT_DECL_Y__START_STACK_INCR #define PAT_DECL_Y__START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef PAT_DECL_Y__FATAL_ERROR #define PAT_DECL_Y__FATAL_ERROR(msg) pat_decl_y__fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef PAT_DECL_Y__DECL #define PAT_DECL_Y__DECL int pat_decl_y_lex PAT_DECL_Y__PROTO(( void )) #endif /* Code executed at the beginning of each rule, after pat_decl_y_text and pat_decl_y_leng * have been set up. */ #ifndef PAT_DECL_Y__USER_ACTION #define PAT_DECL_Y__USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef PAT_DECL_Y__BREAK #define PAT_DECL_Y__BREAK break; #endif #define PAT_DECL_Y__RULE_SETUP \ PAT_DECL_Y__USER_ACTION PAT_DECL_Y__DECL { register pat_decl_y__state_type pat_decl_y__current_state; register char *pat_decl_y__cp = NULL, *pat_decl_y__bp = NULL; register int pat_decl_y__act; #line 101 "../../../src/ppt/src/pat_decl_l.l" if ( pat_decl_y__init ) { pat_decl_y__init = 0; #ifdef PAT_DECL_Y__USER_INIT PAT_DECL_Y__USER_INIT; #endif if ( ! pat_decl_y__start ) pat_decl_y__start = 1; /* first start state */ if ( ! pat_decl_y_in ) pat_decl_y_in = stdin; if ( ! pat_decl_y_out ) pat_decl_y_out = stdout; if ( ! pat_decl_y__current_buffer ) pat_decl_y__current_buffer = pat_decl_y__create_buffer( pat_decl_y_in, PAT_DECL_Y__BUF_SIZE ); pat_decl_y__load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { pat_decl_y__cp = pat_decl_y__c_buf_p; /* Support of pat_decl_y_text. */ *pat_decl_y__cp = pat_decl_y__hold_char; /* pat_decl_y__bp points to the position in pat_decl_y__ch_buf of the start of * the current run. */ pat_decl_y__bp = pat_decl_y__cp; pat_decl_y__current_state = pat_decl_y__start; pat_decl_y__match: do { register PAT_DECL_Y__CHAR pat_decl_y__c = pat_decl_y__ec[PAT_DECL_Y__SC_TO_UI(*pat_decl_y__cp)]; if ( pat_decl_y__accept[pat_decl_y__current_state] ) { pat_decl_y__last_accepting_state = pat_decl_y__current_state; pat_decl_y__last_accepting_cpos = pat_decl_y__cp; } while ( pat_decl_y__chk[pat_decl_y__base[pat_decl_y__current_state] + pat_decl_y__c] != pat_decl_y__current_state ) { pat_decl_y__current_state = (int) pat_decl_y__def[pat_decl_y__current_state]; if ( pat_decl_y__current_state >= 64 ) pat_decl_y__c = pat_decl_y__meta[(unsigned int) pat_decl_y__c]; } pat_decl_y__current_state = pat_decl_y__nxt[pat_decl_y__base[pat_decl_y__current_state] + (unsigned int) pat_decl_y__c]; ++pat_decl_y__cp; } while ( pat_decl_y__base[pat_decl_y__current_state] != 137 ); pat_decl_y__find_action: pat_decl_y__act = pat_decl_y__accept[pat_decl_y__current_state]; if ( pat_decl_y__act == 0 ) { /* have to back up */ pat_decl_y__cp = pat_decl_y__last_accepting_cpos; pat_decl_y__current_state = pat_decl_y__last_accepting_state; pat_decl_y__act = pat_decl_y__accept[pat_decl_y__current_state]; } PAT_DECL_Y__DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( pat_decl_y__act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of PAT_DECL_Y__DO_BEFORE_ACTION */ *pat_decl_y__cp = pat_decl_y__hold_char; pat_decl_y__cp = pat_decl_y__last_accepting_cpos; pat_decl_y__current_state = pat_decl_y__last_accepting_state; goto pat_decl_y__find_action; case 1: PAT_DECL_Y__RULE_SETUP #line 102 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Colon\n");*/ BEGIN INS_PAT; return (Colon); } PAT_DECL_Y__BREAK case 2: PAT_DECL_Y__RULE_SETUP #line 107 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Semicolon\n");*/ BEGIN OUT_PAT; if (pat_decl_y_leng < 16) pat_decl_y_lval.valu = pat_decl_y_leng - 1; else pat_decl_y_lval.valu = 15; return (Semicolons); } PAT_DECL_Y__BREAK case 3: PAT_DECL_Y__RULE_SETUP #line 118 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Dot\n");*/ BEGIN OUT_PAT; return (Dot); } PAT_DECL_Y__BREAK case 4: PAT_DECL_Y__RULE_SETUP #line 123 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Comma\n");*/ return (Comma); } PAT_DECL_Y__BREAK case 5: PAT_DECL_Y__RULE_SETUP #line 127 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("_LTSym\n");*/ return (_LTSym); } PAT_DECL_Y__BREAK case 6: PAT_DECL_Y__RULE_SETUP #line 131 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("_GTSym\n");*/ return (_GTSym); } PAT_DECL_Y__BREAK case 7: PAT_DECL_Y__RULE_SETUP #line 135 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("LeftParen\n");*/ BEGIN INITIAL; return (LeftParen); } PAT_DECL_Y__BREAK case 8: PAT_DECL_Y__RULE_SETUP #line 140 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("RightParen\n");*/ BEGIN DTC_FRM; return (RightParen); } PAT_DECL_Y__BREAK case 9: PAT_DECL_Y__RULE_SETUP #line 145 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Plus\n");*/ return (Plus); } PAT_DECL_Y__BREAK case 10: PAT_DECL_Y__RULE_SETUP #line 149 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("_LESym\n");*/ return (_LESym); } PAT_DECL_Y__BREAK case 11: PAT_DECL_Y__RULE_SETUP #line 153 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Format\n");*/ pat_decl_y_lval.immd = pat_decl_y_text[0]; return (Format); } PAT_DECL_Y__BREAK case 12: PAT_DECL_Y__RULE_SETUP #line 158 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("OneBit BitStringLit\n");*/ strcpy (buff,pat_decl_y_text); pat_decl_y_lval.text = buff; return (BitStringLit); } PAT_DECL_Y__BREAK case 13: PAT_DECL_Y__RULE_SETUP #line 164 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Hexa BitStringLit\n");*/ strcpy (buff,pat_decl_y_text); pat_decl_y_lval.text = buff; return (BitStringLit); } PAT_DECL_Y__BREAK case 14: PAT_DECL_Y__RULE_SETUP #line 170 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Octal BitStringLit\n");*/ strcpy (buff,pat_decl_y_text); pat_decl_y_lval.text = buff; return (BitStringLit); } PAT_DECL_Y__BREAK case 15: PAT_DECL_Y__RULE_SETUP #line 176 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("Binary BitStringLit\n");*/ strcpy (buff,pat_decl_y_text); pat_decl_y_lval.text = buff; return (BitStringLit); } PAT_DECL_Y__BREAK case 16: PAT_DECL_Y__RULE_SETUP #line 182 "../../../src/ppt/src/pat_decl_l.l" { /*printf ("AbstractLit\n");*/ pat_decl_y_lval.valu = atoi (pat_decl_y_text); return (AbstractLit); } PAT_DECL_Y__BREAK case 17: PAT_DECL_Y__RULE_SETUP #line 187 "../../../src/ppt/src/pat_decl_l.l" { int i = 0; int j = 0; /*printf ("Literal\n");*/ while ((buff[j] = pat_decl_y_text[i++]) != '\0') { if ((buff[j] != ' ' ) && (buff[j] != '\t') && (buff[j] != '\n')) { if ((buff[j] == 'U') || (buff[j] == 'u')) { buff[j] = '*'; } j++; } else { if (buff[j] == '\n') PAT_LINNUM++; } } buff[j] = '\0'; pat_decl_y_lval.text = buff; return (Literal); } PAT_DECL_Y__BREAK case 18: PAT_DECL_Y__RULE_SETUP #line 215 "../../../src/ppt/src/pat_decl_l.l" { int code ; pat_decl_y_lval.text = namealloc (pat_decl_y_text); if ((code = lcl_search (pat_decl_y_lval.text)) == -1) { /*printf ("Identifier : %s\n", pat_decl_y_text);*/ BEGIN DTC_FRM; return (Identifier); } else { /*printf ("KeyWord : %s\n", pat_decl_y_text);*/ return (code); } } PAT_DECL_Y__BREAK case 19: *pat_decl_y__cp = pat_decl_y__hold_char; /* undo effects of setting up pat_decl_y_text */ pat_decl_y__c_buf_p = pat_decl_y__cp -= 1; PAT_DECL_Y__DO_BEFORE_ACTION; /* set up pat_decl_y_text again */ PAT_DECL_Y__RULE_SETUP #line 231 "../../../src/ppt/src/pat_decl_l.l" { pat_decl_y_lval.text = namealloc (&pat_decl_y_text[1]); return (Comment); } PAT_DECL_Y__BREAK case 20: *pat_decl_y__cp = pat_decl_y__hold_char; /* undo effects of setting up pat_decl_y_text */ pat_decl_y__c_buf_p = pat_decl_y__cp -= 1; PAT_DECL_Y__DO_BEFORE_ACTION; /* set up pat_decl_y_text again */ PAT_DECL_Y__RULE_SETUP #line 235 "../../../src/ppt/src/pat_decl_l.l" { } PAT_DECL_Y__BREAK case 21: PAT_DECL_Y__RULE_SETUP #line 237 "../../../src/ppt/src/pat_decl_l.l" { } PAT_DECL_Y__BREAK case 22: PAT_DECL_Y__RULE_SETUP #line 239 "../../../src/ppt/src/pat_decl_l.l" { PAT_LINNUM++; } PAT_DECL_Y__BREAK case 23: PAT_DECL_Y__RULE_SETUP #line 242 "../../../src/ppt/src/pat_decl_l.l" { return (UnknownChar); } PAT_DECL_Y__BREAK case 24: PAT_DECL_Y__RULE_SETUP #line 245 "../../../src/ppt/src/pat_decl_l.l" ECHO; PAT_DECL_Y__BREAK case PAT_DECL_Y__STATE_EOF(INITIAL): case PAT_DECL_Y__STATE_EOF(INS_PAT): case PAT_DECL_Y__STATE_EOF(OUT_PAT): case PAT_DECL_Y__STATE_EOF(DTC_FRM): pat_decl_y_terminate(); case PAT_DECL_Y__END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int pat_decl_y__amount_of_matched_text = (int) (pat_decl_y__cp - pat_decl_y_text_ptr) - 1; /* Undo the effects of PAT_DECL_Y__DO_BEFORE_ACTION. */ *pat_decl_y__cp = pat_decl_y__hold_char; PAT_DECL_Y__RESTORE_PAT_DECL_Y__MORE_OFFSET if ( pat_decl_y__current_buffer->pat_decl_y__buffer_status == PAT_DECL_Y__BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed pat_decl_y_in at a new source and called * pat_decl_y_lex(). If so, then we have to assure * consistency between pat_decl_y__current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ pat_decl_y__n_chars = pat_decl_y__current_buffer->pat_decl_y__n_chars; pat_decl_y__current_buffer->pat_decl_y__input_file = pat_decl_y_in; pat_decl_y__current_buffer->pat_decl_y__buffer_status = PAT_DECL_Y__BUFFER_NORMAL; } /* Note that here we test for pat_decl_y__c_buf_p "<=" to the position * of the first EOB in the buffer, since pat_decl_y__c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( pat_decl_y__c_buf_p <= &pat_decl_y__current_buffer->pat_decl_y__ch_buf[pat_decl_y__n_chars] ) { /* This was really a NUL. */ pat_decl_y__state_type pat_decl_y__next_state; pat_decl_y__c_buf_p = pat_decl_y_text_ptr + pat_decl_y__amount_of_matched_text; pat_decl_y__current_state = pat_decl_y__get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * pat_decl_y__get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ pat_decl_y__next_state = pat_decl_y__try_NUL_trans( pat_decl_y__current_state ); pat_decl_y__bp = pat_decl_y_text_ptr + PAT_DECL_Y__MORE_ADJ; if ( pat_decl_y__next_state ) { /* Consume the NUL. */ pat_decl_y__cp = ++pat_decl_y__c_buf_p; pat_decl_y__current_state = pat_decl_y__next_state; goto pat_decl_y__match; } else { pat_decl_y__cp = pat_decl_y__c_buf_p; goto pat_decl_y__find_action; } } else switch ( pat_decl_y__get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { pat_decl_y__did_buffer_switch_on_eof = 0; if ( pat_decl_y_wrap() ) { /* Note: because we've taken care in * pat_decl_y__get_next_buffer() to have set up * pat_decl_y_text, we can now set up * pat_decl_y__c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * PAT_DECL_Y__NULL, it'll still work - another * PAT_DECL_Y__NULL will get returned. */ pat_decl_y__c_buf_p = pat_decl_y_text_ptr + PAT_DECL_Y__MORE_ADJ; pat_decl_y__act = PAT_DECL_Y__STATE_EOF(PAT_DECL_Y__START); goto do_action; } else { if ( ! pat_decl_y__did_buffer_switch_on_eof ) PAT_DECL_Y__NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: pat_decl_y__c_buf_p = pat_decl_y_text_ptr + pat_decl_y__amount_of_matched_text; pat_decl_y__current_state = pat_decl_y__get_previous_state(); pat_decl_y__cp = pat_decl_y__c_buf_p; pat_decl_y__bp = pat_decl_y_text_ptr + PAT_DECL_Y__MORE_ADJ; goto pat_decl_y__match; case EOB_ACT_LAST_MATCH: pat_decl_y__c_buf_p = &pat_decl_y__current_buffer->pat_decl_y__ch_buf[pat_decl_y__n_chars]; pat_decl_y__current_state = pat_decl_y__get_previous_state(); pat_decl_y__cp = pat_decl_y__c_buf_p; pat_decl_y__bp = pat_decl_y_text_ptr + PAT_DECL_Y__MORE_ADJ; goto pat_decl_y__find_action; } break; } default: PAT_DECL_Y__FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of pat_decl_y_lex */ /* pat_decl_y__get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int pat_decl_y__get_next_buffer() { register char *dest = pat_decl_y__current_buffer->pat_decl_y__ch_buf; register char *source = pat_decl_y_text_ptr; register int number_to_move, i; int ret_val; if ( pat_decl_y__c_buf_p > &pat_decl_y__current_buffer->pat_decl_y__ch_buf[pat_decl_y__n_chars + 1] ) PAT_DECL_Y__FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( pat_decl_y__current_buffer->pat_decl_y__fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( pat_decl_y__c_buf_p - pat_decl_y_text_ptr - PAT_DECL_Y__MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (pat_decl_y__c_buf_p - pat_decl_y_text_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( pat_decl_y__current_buffer->pat_decl_y__buffer_status == PAT_DECL_Y__BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ pat_decl_y__current_buffer->pat_decl_y__n_chars = pat_decl_y__n_chars = 0; else { int num_to_read = pat_decl_y__current_buffer->pat_decl_y__buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef PAT_DECL_Y__USES_REJECT PAT_DECL_Y__FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ PAT_DECL_Y__BUFFER_STATE b = pat_decl_y__current_buffer; int pat_decl_y__c_buf_p_offset = (int) (pat_decl_y__c_buf_p - b->pat_decl_y__ch_buf); if ( b->pat_decl_y__is_our_buffer ) { int new_size = b->pat_decl_y__buf_size * 2; if ( new_size <= 0 ) b->pat_decl_y__buf_size += b->pat_decl_y__buf_size / 8; else b->pat_decl_y__buf_size *= 2; b->pat_decl_y__ch_buf = (char *) /* Include room in for 2 EOB chars. */ pat_decl_y__flex_realloc( (void *) b->pat_decl_y__ch_buf, b->pat_decl_y__buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->pat_decl_y__ch_buf = 0; if ( ! b->pat_decl_y__ch_buf ) PAT_DECL_Y__FATAL_ERROR( "fatal error - scanner input buffer overflow" ); pat_decl_y__c_buf_p = &b->pat_decl_y__ch_buf[pat_decl_y__c_buf_p_offset]; num_to_read = pat_decl_y__current_buffer->pat_decl_y__buf_size - number_to_move - 1; #endif } if ( num_to_read > PAT_DECL_Y__READ_BUF_SIZE ) num_to_read = PAT_DECL_Y__READ_BUF_SIZE; /* Read in more data. */ PAT_DECL_Y__INPUT( (&pat_decl_y__current_buffer->pat_decl_y__ch_buf[number_to_move]), pat_decl_y__n_chars, num_to_read ); pat_decl_y__current_buffer->pat_decl_y__n_chars = pat_decl_y__n_chars; } if ( pat_decl_y__n_chars == 0 ) { if ( number_to_move == PAT_DECL_Y__MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; pat_decl_y_restart( pat_decl_y_in ); } else { ret_val = EOB_ACT_LAST_MATCH; pat_decl_y__current_buffer->pat_decl_y__buffer_status = PAT_DECL_Y__BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; pat_decl_y__n_chars += number_to_move; pat_decl_y__current_buffer->pat_decl_y__ch_buf[pat_decl_y__n_chars] = PAT_DECL_Y__END_OF_BUFFER_CHAR; pat_decl_y__current_buffer->pat_decl_y__ch_buf[pat_decl_y__n_chars + 1] = PAT_DECL_Y__END_OF_BUFFER_CHAR; pat_decl_y_text_ptr = &pat_decl_y__current_buffer->pat_decl_y__ch_buf[0]; return ret_val; } /* pat_decl_y__get_previous_state - get the state just before the EOB char was reached */ static pat_decl_y__state_type pat_decl_y__get_previous_state() { register pat_decl_y__state_type pat_decl_y__current_state; register char *pat_decl_y__cp; pat_decl_y__current_state = pat_decl_y__start; for ( pat_decl_y__cp = pat_decl_y_text_ptr + PAT_DECL_Y__MORE_ADJ; pat_decl_y__cp < pat_decl_y__c_buf_p; ++pat_decl_y__cp ) { register PAT_DECL_Y__CHAR pat_decl_y__c = (*pat_decl_y__cp ? pat_decl_y__ec[PAT_DECL_Y__SC_TO_UI(*pat_decl_y__cp)] : 1); if ( pat_decl_y__accept[pat_decl_y__current_state] ) { pat_decl_y__last_accepting_state = pat_decl_y__current_state; pat_decl_y__last_accepting_cpos = pat_decl_y__cp; } while ( pat_decl_y__chk[pat_decl_y__base[pat_decl_y__current_state] + pat_decl_y__c] != pat_decl_y__current_state ) { pat_decl_y__current_state = (int) pat_decl_y__def[pat_decl_y__current_state]; if ( pat_decl_y__current_state >= 64 ) pat_decl_y__c = pat_decl_y__meta[(unsigned int) pat_decl_y__c]; } pat_decl_y__current_state = pat_decl_y__nxt[pat_decl_y__base[pat_decl_y__current_state] + (unsigned int) pat_decl_y__c]; } return pat_decl_y__current_state; } /* pat_decl_y__try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = pat_decl_y__try_NUL_trans( current_state ); */ #ifdef PAT_DECL_Y__USE_PROTOS static pat_decl_y__state_type pat_decl_y__try_NUL_trans( pat_decl_y__state_type pat_decl_y__current_state ) #else static pat_decl_y__state_type pat_decl_y__try_NUL_trans( pat_decl_y__current_state ) pat_decl_y__state_type pat_decl_y__current_state; #endif { register int pat_decl_y__is_jam; register char *pat_decl_y__cp = pat_decl_y__c_buf_p; register PAT_DECL_Y__CHAR pat_decl_y__c = 1; if ( pat_decl_y__accept[pat_decl_y__current_state] ) { pat_decl_y__last_accepting_state = pat_decl_y__current_state; pat_decl_y__last_accepting_cpos = pat_decl_y__cp; } while ( pat_decl_y__chk[pat_decl_y__base[pat_decl_y__current_state] + pat_decl_y__c] != pat_decl_y__current_state ) { pat_decl_y__current_state = (int) pat_decl_y__def[pat_decl_y__current_state]; if ( pat_decl_y__current_state >= 64 ) pat_decl_y__c = pat_decl_y__meta[(unsigned int) pat_decl_y__c]; } pat_decl_y__current_state = pat_decl_y__nxt[pat_decl_y__base[pat_decl_y__current_state] + (unsigned int) pat_decl_y__c]; pat_decl_y__is_jam = (pat_decl_y__current_state == 63); return pat_decl_y__is_jam ? 0 : pat_decl_y__current_state; } #ifndef PAT_DECL_Y__NO_UNPUT #ifdef PAT_DECL_Y__USE_PROTOS static void pat_decl_y_unput( int c, register char *pat_decl_y__bp ) #else static void pat_decl_y_unput( c, pat_decl_y__bp ) int c; register char *pat_decl_y__bp; #endif { register char *pat_decl_y__cp = pat_decl_y__c_buf_p; /* undo effects of setting up pat_decl_y_text */ *pat_decl_y__cp = pat_decl_y__hold_char; if ( pat_decl_y__cp < pat_decl_y__current_buffer->pat_decl_y__ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = pat_decl_y__n_chars + 2; register char *dest = &pat_decl_y__current_buffer->pat_decl_y__ch_buf[ pat_decl_y__current_buffer->pat_decl_y__buf_size + 2]; register char *source = &pat_decl_y__current_buffer->pat_decl_y__ch_buf[number_to_move]; while ( source > pat_decl_y__current_buffer->pat_decl_y__ch_buf ) *--dest = *--source; pat_decl_y__cp += (int) (dest - source); pat_decl_y__bp += (int) (dest - source); pat_decl_y__current_buffer->pat_decl_y__n_chars = pat_decl_y__n_chars = pat_decl_y__current_buffer->pat_decl_y__buf_size; if ( pat_decl_y__cp < pat_decl_y__current_buffer->pat_decl_y__ch_buf + 2 ) PAT_DECL_Y__FATAL_ERROR( "flex scanner push-back overflow" ); } *--pat_decl_y__cp = (char) c; pat_decl_y_text_ptr = pat_decl_y__bp; pat_decl_y__hold_char = *pat_decl_y__cp; pat_decl_y__c_buf_p = pat_decl_y__cp; } #endif /* ifndef PAT_DECL_Y__NO_UNPUT */ #ifndef PAT_DECL_Y__NO_INPUT #ifdef __cplusplus static int pat_decl_y_input() #else static int input() #endif { int c; *pat_decl_y__c_buf_p = pat_decl_y__hold_char; if ( *pat_decl_y__c_buf_p == PAT_DECL_Y__END_OF_BUFFER_CHAR ) { /* pat_decl_y__c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( pat_decl_y__c_buf_p < &pat_decl_y__current_buffer->pat_decl_y__ch_buf[pat_decl_y__n_chars] ) /* This was really a NUL. */ *pat_decl_y__c_buf_p = '\0'; else { /* need more input */ int offset = pat_decl_y__c_buf_p - pat_decl_y_text_ptr; ++pat_decl_y__c_buf_p; switch ( pat_decl_y__get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because pat_decl_y__g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ pat_decl_y_restart( pat_decl_y_in ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( pat_decl_y_wrap() ) return EOF; if ( ! pat_decl_y__did_buffer_switch_on_eof ) PAT_DECL_Y__NEW_FILE; #ifdef __cplusplus return pat_decl_y_input(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: pat_decl_y__c_buf_p = pat_decl_y_text_ptr + offset; break; } } } c = *(unsigned char *) pat_decl_y__c_buf_p; /* cast for 8-bit char's */ *pat_decl_y__c_buf_p = '\0'; /* preserve pat_decl_y_text */ pat_decl_y__hold_char = *++pat_decl_y__c_buf_p; return c; } #endif /* PAT_DECL_Y__NO_INPUT */ #ifdef PAT_DECL_Y__USE_PROTOS void pat_decl_y_restart( FILE *input_file ) #else void pat_decl_y_restart( input_file ) FILE *input_file; #endif { if ( ! pat_decl_y__current_buffer ) pat_decl_y__current_buffer = pat_decl_y__create_buffer( pat_decl_y_in, PAT_DECL_Y__BUF_SIZE ); pat_decl_y__init_buffer( pat_decl_y__current_buffer, input_file ); pat_decl_y__load_buffer_state(); } #ifdef PAT_DECL_Y__USE_PROTOS void pat_decl_y__switch_to_buffer( PAT_DECL_Y__BUFFER_STATE new_buffer ) #else void pat_decl_y__switch_to_buffer( new_buffer ) PAT_DECL_Y__BUFFER_STATE new_buffer; #endif { if ( pat_decl_y__current_buffer == new_buffer ) return; if ( pat_decl_y__current_buffer ) { /* Flush out information for old buffer. */ *pat_decl_y__c_buf_p = pat_decl_y__hold_char; pat_decl_y__current_buffer->pat_decl_y__buf_pos = pat_decl_y__c_buf_p; pat_decl_y__current_buffer->pat_decl_y__n_chars = pat_decl_y__n_chars; } pat_decl_y__current_buffer = new_buffer; pat_decl_y__load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (pat_decl_y_wrap()) processing, but the only time this flag * is looked at is after pat_decl_y_wrap() is called, so it's safe * to go ahead and always set it. */ pat_decl_y__did_buffer_switch_on_eof = 1; } #ifdef PAT_DECL_Y__USE_PROTOS void pat_decl_y__load_buffer_state( void ) #else void pat_decl_y__load_buffer_state() #endif { pat_decl_y__n_chars = pat_decl_y__current_buffer->pat_decl_y__n_chars; pat_decl_y_text_ptr = pat_decl_y__c_buf_p = pat_decl_y__current_buffer->pat_decl_y__buf_pos; pat_decl_y_in = pat_decl_y__current_buffer->pat_decl_y__input_file; pat_decl_y__hold_char = *pat_decl_y__c_buf_p; } #ifdef PAT_DECL_Y__USE_PROTOS PAT_DECL_Y__BUFFER_STATE pat_decl_y__create_buffer( FILE *file, int size ) #else PAT_DECL_Y__BUFFER_STATE pat_decl_y__create_buffer( file, size ) FILE *file; int size; #endif { PAT_DECL_Y__BUFFER_STATE b; b = (PAT_DECL_Y__BUFFER_STATE) pat_decl_y__flex_alloc( sizeof( struct pat_decl_y__buffer_state ) ); if ( ! b ) PAT_DECL_Y__FATAL_ERROR( "out of dynamic memory in pat_decl_y__create_buffer()" ); b->pat_decl_y__buf_size = size; /* pat_decl_y__ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->pat_decl_y__ch_buf = (char *) pat_decl_y__flex_alloc( b->pat_decl_y__buf_size + 2 ); if ( ! b->pat_decl_y__ch_buf ) PAT_DECL_Y__FATAL_ERROR( "out of dynamic memory in pat_decl_y__create_buffer()" ); b->pat_decl_y__is_our_buffer = 1; pat_decl_y__init_buffer( b, file ); return b; } #ifdef PAT_DECL_Y__USE_PROTOS void pat_decl_y__delete_buffer( PAT_DECL_Y__BUFFER_STATE b ) #else void pat_decl_y__delete_buffer( b ) PAT_DECL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == pat_decl_y__current_buffer ) pat_decl_y__current_buffer = (PAT_DECL_Y__BUFFER_STATE) 0; if ( b->pat_decl_y__is_our_buffer ) pat_decl_y__flex_free( (void *) b->pat_decl_y__ch_buf ); pat_decl_y__flex_free( (void *) b ); } #ifdef PAT_DECL_Y__USE_PROTOS void pat_decl_y__init_buffer( PAT_DECL_Y__BUFFER_STATE b, FILE *file ) #else void pat_decl_y__init_buffer( b, file ) PAT_DECL_Y__BUFFER_STATE b; FILE *file; #endif { pat_decl_y__flush_buffer( b ); b->pat_decl_y__input_file = file; b->pat_decl_y__fill_buffer = 1; #if PAT_DECL_Y__ALWAYS_INTERACTIVE b->pat_decl_y__is_interactive = 1; #else #if PAT_DECL_Y__NEVER_INTERACTIVE b->pat_decl_y__is_interactive = 0; #else b->pat_decl_y__is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef PAT_DECL_Y__USE_PROTOS void pat_decl_y__flush_buffer( PAT_DECL_Y__BUFFER_STATE b ) #else void pat_decl_y__flush_buffer( b ) PAT_DECL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; b->pat_decl_y__n_chars = 0; /* 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. */ b->pat_decl_y__ch_buf[0] = PAT_DECL_Y__END_OF_BUFFER_CHAR; b->pat_decl_y__ch_buf[1] = PAT_DECL_Y__END_OF_BUFFER_CHAR; b->pat_decl_y__buf_pos = &b->pat_decl_y__ch_buf[0]; b->pat_decl_y__at_bol = 1; b->pat_decl_y__buffer_status = PAT_DECL_Y__BUFFER_NEW; if ( b == pat_decl_y__current_buffer ) pat_decl_y__load_buffer_state(); } #ifndef PAT_DECL_Y__NO_SCAN_BUFFER #ifdef PAT_DECL_Y__USE_PROTOS PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_buffer( char *base, pat_decl_y__size_t size ) #else PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_buffer( base, size ) char *base; pat_decl_y__size_t size; #endif { PAT_DECL_Y__BUFFER_STATE b; if ( size < 2 || base[size-2] != PAT_DECL_Y__END_OF_BUFFER_CHAR || base[size-1] != PAT_DECL_Y__END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (PAT_DECL_Y__BUFFER_STATE) pat_decl_y__flex_alloc( sizeof( struct pat_decl_y__buffer_state ) ); if ( ! b ) PAT_DECL_Y__FATAL_ERROR( "out of dynamic memory in pat_decl_y__scan_buffer()" ); b->pat_decl_y__buf_size = size - 2; /* "- 2" to take care of EOB's */ b->pat_decl_y__buf_pos = b->pat_decl_y__ch_buf = base; b->pat_decl_y__is_our_buffer = 0; b->pat_decl_y__input_file = 0; b->pat_decl_y__n_chars = b->pat_decl_y__buf_size; b->pat_decl_y__is_interactive = 0; b->pat_decl_y__at_bol = 1; b->pat_decl_y__fill_buffer = 0; b->pat_decl_y__buffer_status = PAT_DECL_Y__BUFFER_NEW; pat_decl_y__switch_to_buffer( b ); return b; } #endif #ifndef PAT_DECL_Y__NO_SCAN_STRING #ifdef PAT_DECL_Y__USE_PROTOS PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_string( pat_decl_y_const char *pat_decl_y__str ) #else PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_string( pat_decl_y__str ) pat_decl_y_const char *pat_decl_y__str; #endif { int len; for ( len = 0; pat_decl_y__str[len]; ++len ) ; return pat_decl_y__scan_bytes( pat_decl_y__str, len ); } #endif #ifndef PAT_DECL_Y__NO_SCAN_BYTES #ifdef PAT_DECL_Y__USE_PROTOS PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_bytes( pat_decl_y_const char *bytes, int len ) #else PAT_DECL_Y__BUFFER_STATE pat_decl_y__scan_bytes( bytes, len ) pat_decl_y_const char *bytes; int len; #endif { PAT_DECL_Y__BUFFER_STATE b; char *buf; pat_decl_y__size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) pat_decl_y__flex_alloc( n ); if ( ! buf ) PAT_DECL_Y__FATAL_ERROR( "out of dynamic memory in pat_decl_y__scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = PAT_DECL_Y__END_OF_BUFFER_CHAR; b = pat_decl_y__scan_buffer( buf, n ); if ( ! b ) PAT_DECL_Y__FATAL_ERROR( "bad buffer in pat_decl_y__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->pat_decl_y__is_our_buffer = 1; return b; } #endif #ifndef PAT_DECL_Y__NO_PUSH_STATE #ifdef PAT_DECL_Y__USE_PROTOS static void pat_decl_y__push_state( int new_state ) #else static void pat_decl_y__push_state( new_state ) int new_state; #endif { if ( pat_decl_y__start_stack_ptr >= pat_decl_y__start_stack_depth ) { pat_decl_y__size_t new_size; pat_decl_y__start_stack_depth += PAT_DECL_Y__START_STACK_INCR; new_size = pat_decl_y__start_stack_depth * sizeof( int ); if ( ! pat_decl_y__start_stack ) pat_decl_y__start_stack = (int *) pat_decl_y__flex_alloc( new_size ); else pat_decl_y__start_stack = (int *) pat_decl_y__flex_realloc( (void *) pat_decl_y__start_stack, new_size ); if ( ! pat_decl_y__start_stack ) PAT_DECL_Y__FATAL_ERROR( "out of memory expanding start-condition stack" ); } pat_decl_y__start_stack[pat_decl_y__start_stack_ptr++] = PAT_DECL_Y__START; BEGIN(new_state); } #endif #ifndef PAT_DECL_Y__NO_POP_STATE static void pat_decl_y__pop_state() { if ( --pat_decl_y__start_stack_ptr < 0 ) PAT_DECL_Y__FATAL_ERROR( "start-condition stack underflow" ); BEGIN(pat_decl_y__start_stack[pat_decl_y__start_stack_ptr]); } #endif #ifndef PAT_DECL_Y__NO_TOP_STATE static int pat_decl_y__top_state() { return pat_decl_y__start_stack[pat_decl_y__start_stack_ptr - 1]; } #endif #ifndef PAT_DECL_Y__EXIT_FAILURE #define PAT_DECL_Y__EXIT_FAILURE 2 #endif #ifdef PAT_DECL_Y__USE_PROTOS static void pat_decl_y__fatal_error( pat_decl_y_const char msg[] ) #else static void pat_decl_y__fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( PAT_DECL_Y__EXIT_FAILURE ); } /* Redefine pat_decl_y_less() so it works in section 3 code. */ #undef pat_decl_y_less #define pat_decl_y_less(n) \ do \ { \ /* Undo effects of setting up pat_decl_y_text. */ \ pat_decl_y_text[pat_decl_y_leng] = pat_decl_y__hold_char; \ pat_decl_y__c_buf_p = pat_decl_y_text + n; \ pat_decl_y__hold_char = *pat_decl_y__c_buf_p; \ *pat_decl_y__c_buf_p = '\0'; \ pat_decl_y_leng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef pat_decl_y_text_ptr #ifdef PAT_DECL_Y__USE_PROTOS static void pat_decl_y__flex_strncpy( char *s1, pat_decl_y_const char *s2, int n ) #else static void pat_decl_y__flex_strncpy( s1, s2, n ) char *s1; pat_decl_y_const char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef PAT_DECL_Y__NEED_STRLEN #ifdef PAT_DECL_Y__USE_PROTOS static int pat_decl_y__flex_strlen( pat_decl_y_const char *s ) #else static int pat_decl_y__flex_strlen( s ) pat_decl_y_const char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef PAT_DECL_Y__USE_PROTOS static void *pat_decl_y__flex_alloc( pat_decl_y__size_t size ) #else static void *pat_decl_y__flex_alloc( size ) pat_decl_y__size_t size; #endif { return (void *) malloc( size ); } #ifdef PAT_DECL_Y__USE_PROTOS static void *pat_decl_y__flex_realloc( void *ptr, pat_decl_y__size_t size ) #else static void *pat_decl_y__flex_realloc( ptr, size ) void *ptr; pat_decl_y__size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef PAT_DECL_Y__USE_PROTOS static void pat_decl_y__flex_free( void *ptr ) #else static void pat_decl_y__flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if PAT_DECL_Y__MAIN int main() { pat_decl_y_lex(); return 0; } #endif #line 245 "../../../src/ppt/src/pat_decl_l.l" /* ###--------------------------------------------------------------### */ /* function : pat_decl_y_wrap */ /* description : return 1 */ /* called func. : none */ /* ###--------------------------------------------------------------### */ int pat_decl_y_wrap () { return (1); }