/* 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 mipsYY_FLEX_MAJOR_VERSION 2 #define mipsYY_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 mipsYY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define mipsYY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define mipsYY_USE_PROTOS #define mipsYY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define mipsYY_USE_CONST #define mipsYY_USE_PROTOS #endif #ifdef mipsYY_USE_CONST #define mipsyyconst const #else #define mipsyyconst #endif #ifdef mipsYY_USE_PROTOS #define mipsYY_PROTO(proto) proto #else #define mipsYY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define mipsYY_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 mipsYY_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 mipsyy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The mipsYYSTATE alias is for lex * compatibility. */ #define mipsYY_START ((mipsyy_start - 1) / 2) #define mipsYYSTATE mipsYY_START /* Action number for EOF rule of a given start state. */ #define mipsYY_STATE_EOF(state) (mipsYY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define mipsYY_NEW_FILE mipsyyrestart( mipsyyin ) #define mipsYY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define mipsYY_BUF_SIZE 16384 typedef struct mipsyy_buffer_state *mipsYY_BUFFER_STATE; extern int mipsyyleng; extern FILE *mipsyyin, *mipsyyout; #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 ) * mipsyyless( 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 mipsyyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define mipsyyless(n) \ do \ { \ /* Undo effects of setting up mipsyytext. */ \ *mipsyy_cp = mipsyy_hold_char; \ mipsYY_RESTORE_mipsYY_MORE_OFFSET \ mipsyy_c_buf_p = mipsyy_cp = mipsyy_bp + n - mipsYY_MORE_ADJ; \ mipsYY_DO_BEFORE_ACTION; /* set up mipsyytext again */ \ } \ while ( 0 ) #define unput(c) mipsyyunput( c, mipsyytext_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 mipsyy_size_t; struct mipsyy_buffer_state { FILE *mipsyy_input_file; char *mipsyy_ch_buf; /* input buffer */ char *mipsyy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ mipsyy_size_t mipsyy_buf_size; /* Number of characters read into mipsyy_ch_buf, not including EOB * characters. */ int mipsyy_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 mipsyy_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 mipsyy_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 mipsyy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int mipsyy_fill_buffer; int mipsyy_buffer_status; #define mipsYY_BUFFER_NEW 0 #define mipsYY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as mipsYY_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 mipsyyrestart()), so that the user can continue scanning by * just pointing mipsyyin at a new input file. */ #define mipsYY_BUFFER_EOF_PENDING 2 }; static mipsYY_BUFFER_STATE mipsyy_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 mipsYY_CURRENT_BUFFER mipsyy_current_buffer /* mipsyy_hold_char holds the character lost when mipsyytext is formed. */ static char mipsyy_hold_char; static int mipsyy_n_chars; /* number of characters read into mipsyy_ch_buf */ int mipsyyleng; /* Points to current character in buffer. */ static char *mipsyy_c_buf_p = (char *) 0; static int mipsyy_init = 1; /* whether we need to initialize */ static int mipsyy_start = 0; /* start state number */ /* Flag which is used to allow mipsyywrap()'s to do buffer switches * instead of setting up a fresh mipsyyin. A bit of a hack ... */ static int mipsyy_did_buffer_switch_on_eof; void mipsyyrestart mipsYY_PROTO(( FILE *input_file )); void mipsyy_switch_to_buffer mipsYY_PROTO(( mipsYY_BUFFER_STATE new_buffer )); void mipsyy_load_buffer_state mipsYY_PROTO(( void )); mipsYY_BUFFER_STATE mipsyy_create_buffer mipsYY_PROTO(( FILE *file, int size )); void mipsyy_delete_buffer mipsYY_PROTO(( mipsYY_BUFFER_STATE b )); void mipsyy_init_buffer mipsYY_PROTO(( mipsYY_BUFFER_STATE b, FILE *file )); void mipsyy_flush_buffer mipsYY_PROTO(( mipsYY_BUFFER_STATE b )); #define mipsYY_FLUSH_BUFFER mipsyy_flush_buffer( mipsyy_current_buffer ) mipsYY_BUFFER_STATE mipsyy_scan_buffer mipsYY_PROTO(( char *base, mipsyy_size_t size )); mipsYY_BUFFER_STATE mipsyy_scan_string mipsYY_PROTO(( mipsyyconst char *mipsyy_str )); mipsYY_BUFFER_STATE mipsyy_scan_bytes mipsYY_PROTO(( mipsyyconst char *bytes, int len )); static void *mipsyy_flex_alloc mipsYY_PROTO(( mipsyy_size_t )); static void *mipsyy_flex_realloc mipsYY_PROTO(( void *, mipsyy_size_t )); static void mipsyy_flex_free mipsYY_PROTO(( void * )); #define mipsyy_new_buffer mipsyy_create_buffer #define mipsyy_set_interactive(is_interactive) \ { \ if ( ! mipsyy_current_buffer ) \ mipsyy_current_buffer = mipsyy_create_buffer( mipsyyin, mipsYY_BUF_SIZE ); \ mipsyy_current_buffer->mipsyy_is_interactive = is_interactive; \ } #define mipsyy_set_bol(at_bol) \ { \ if ( ! mipsyy_current_buffer ) \ mipsyy_current_buffer = mipsyy_create_buffer( mipsyyin, mipsYY_BUF_SIZE ); \ mipsyy_current_buffer->mipsyy_at_bol = at_bol; \ } #define mipsYY_AT_BOL() (mipsyy_current_buffer->mipsyy_at_bol) typedef unsigned char mipsYY_CHAR; FILE *mipsyyin = (FILE *) 0, *mipsyyout = (FILE *) 0; typedef int mipsyy_state_type; extern char *mipsyytext; #define mipsyytext_ptr mipsyytext static mipsyy_state_type mipsyy_get_previous_state mipsYY_PROTO(( void )); static mipsyy_state_type mipsyy_try_NUL_trans mipsYY_PROTO(( mipsyy_state_type current_state )); static int mipsyy_get_next_buffer mipsYY_PROTO(( void )); static void mipsyy_fatal_error mipsYY_PROTO(( mipsyyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up mipsyytext. */ #define mipsYY_DO_BEFORE_ACTION \ mipsyytext_ptr = mipsyy_bp; \ mipsyyleng = (int) (mipsyy_cp - mipsyy_bp); \ mipsyy_hold_char = *mipsyy_cp; \ *mipsyy_cp = '\0'; \ mipsyy_c_buf_p = mipsyy_cp; #define mipsYY_NUM_RULES 26 #define mipsYY_END_OF_BUFFER 27 static mipsyyconst short int mipsyy_accept[47] = { 0, 0, 0, 27, 26, 3, 1, 26, 4, 26, 5, 15, 16, 11, 9, 17, 14, 24, 10, 22, 22, 2, 26, 26, 26, 8, 6, 7, 0, 23, 18, 18, 18, 24, 24, 22, 0, 0, 0, 0, 25, 12, 13, 21, 20, 19, 0 } ; static mipsyyconst int mipsyy_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, 6, 1, 7, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, 21, 21, 22, 23, 24, 1, 25, 1, 1, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 1, 1, 1, 28, 29, 1, 26, 30, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 32, 27, 27, 1, 33, 1, 34, 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 mipsyyconst int mipsyy_meta[35] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 5, 3, 1, 3, 4, 6, 6, 1, 1 } ; static mipsyyconst short int mipsyy_base[52] = { 0, 0, 0, 98, 99, 99, 99, 93, 99, 19, 99, 99, 99, 99, 99, 99, 99, 27, 99, 12, 15, 99, 93, 62, 51, 99, 99, 99, 63, 62, 99, 31, 35, 39, 40, 0, 41, 43, 0, 52, 99, 99, 99, 48, 54, 0, 99, 74, 78, 81, 87, 90 } ; static mipsyyconst short int mipsyy_def[52] = { 0, 46, 1, 46, 46, 46, 46, 47, 46, 46, 46, 46, 46, 46, 46, 46, 46, 48, 46, 49, 49, 46, 50, 46, 46, 46, 46, 46, 47, 47, 46, 9, 46, 48, 48, 20, 46, 46, 51, 50, 46, 46, 46, 46, 46, 51, 0, 46, 46, 46, 46, 46 } ; static mipsyyconst short int mipsyy_nxt[134] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 21, 22, 23, 24, 17, 17, 25, 17, 17, 17, 17, 26, 27, 30, 31, 31, 32, 30, 30, 33, 36, 37, 38, 46, 46, 46, 30, 30, 30, 30, 30, 33, 33, 40, 33, 43, 43, 44, 44, 44, 44, 44, 43, 43, 29, 29, 33, 33, 44, 44, 44, 44, 44, 28, 42, 28, 28, 28, 28, 34, 34, 34, 34, 35, 41, 35, 39, 39, 39, 39, 39, 39, 45, 45, 40, 29, 46, 3, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46 } ; static mipsyyconst short int mipsyy_chk[134] = { 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, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 17, 19, 19, 19, 20, 20, 20, 31, 31, 31, 32, 32, 33, 34, 39, 17, 36, 36, 37, 37, 37, 37, 37, 43, 43, 29, 28, 33, 34, 44, 44, 44, 44, 44, 47, 24, 47, 47, 47, 47, 48, 48, 48, 48, 49, 23, 49, 50, 50, 50, 50, 50, 50, 51, 51, 22, 7, 3, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46 } ; static mipsyy_state_type mipsyy_last_accepting_state; static char *mipsyy_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 mipsyymore() mipsyymore_used_but_not_detected #define mipsYY_MORE_ADJ 0 #define mipsYY_RESTORE_mipsYY_MORE_OFFSET char *mipsyytext; #line 1 "../../../src/mips_asm/src/mips_l.l" #define INITIAL 0 /* * 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 progam 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 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 : mips_mips.lex */ /* date : Dec 6 1999 */ /* version : v0.3 */ /* author : Pirouz BAZARGAN SABET */ /* description : MIPS assembler - lex rules */ /* ###--------------------------------------------------------------### */ #line 33 "../../../src/mips_asm/src/mips_l.l" #include #include "mut.h" #include "mips_type.h" #include "mips_y.h" #include "mips_defs.h" #include "mips_lex.h" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef mipsYY_SKIP_mipsYYWRAP #ifdef __cplusplus extern "C" int mipsyywrap mipsYY_PROTO(( void )); #else extern int mipsyywrap mipsYY_PROTO(( void )); #endif #endif #ifndef mipsYY_NO_UNPUT static void mipsyyunput mipsYY_PROTO(( int c, char *buf_ptr )); #endif #ifndef mipsyytext_ptr static void mipsyy_flex_strncpy mipsYY_PROTO(( char *, mipsyyconst char *, int )); #endif #ifdef mipsYY_NEED_STRLEN static int mipsyy_flex_strlen mipsYY_PROTO(( mipsyyconst char * )); #endif #ifndef mipsYY_NO_INPUT #ifdef __cplusplus static int mipsyyinput mipsYY_PROTO(( void )); #else static int input mipsYY_PROTO(( void )); #endif #endif #if mipsYY_STACK_USED static int mipsyy_start_stack_ptr = 0; static int mipsyy_start_stack_depth = 0; static int *mipsyy_start_stack = 0; #ifndef mipsYY_NO_PUSH_STATE static void mipsyy_push_state mipsYY_PROTO(( int new_state )); #endif #ifndef mipsYY_NO_POP_STATE static void mipsyy_pop_state mipsYY_PROTO(( void )); #endif #ifndef mipsYY_NO_TOP_STATE static int mipsyy_top_state mipsYY_PROTO(( void )); #endif #else #define mipsYY_NO_PUSH_STATE 1 #define mipsYY_NO_POP_STATE 1 #define mipsYY_NO_TOP_STATE 1 #endif #ifdef mipsYY_MALLOC_DECL mipsYY_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 mipsYY_READ_BUF_SIZE #define mipsYY_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( mipsyytext, mipsyyleng, 1, mipsyyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or mipsYY_NULL, * is returned in "result". */ #ifndef mipsYY_INPUT #define mipsYY_INPUT(buf,result,max_size) \ if ( mipsyy_current_buffer->mipsyy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( mipsyyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( mipsyyin ) ) \ mipsYY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, mipsyyin )) == 0) \ && ferror( mipsyyin ) ) \ mipsYY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "mipsyyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef mipsyyterminate #define mipsyyterminate() return mipsYY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef mipsYY_START_STACK_INCR #define mipsYY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef mipsYY_FATAL_ERROR #define mipsYY_FATAL_ERROR(msg) mipsyy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef mipsYY_DECL #define mipsYY_DECL int mipsyylex mipsYY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after mipsyytext and mipsyyleng * have been set up. */ #ifndef mipsYY_USER_ACTION #define mipsYY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef mipsYY_BREAK #define mipsYY_BREAK break; #endif #define mipsYY_RULE_SETUP \ mipsYY_USER_ACTION mipsYY_DECL { register mipsyy_state_type mipsyy_current_state; register char *mipsyy_cp = NULL, *mipsyy_bp = NULL; register int mipsyy_act; #line 51 "../../../src/mips_asm/src/mips_l.l" if ( mipsyy_init ) { mipsyy_init = 0; #ifdef mipsYY_USER_INIT mipsYY_USER_INIT; #endif if ( ! mipsyy_start ) mipsyy_start = 1; /* first start state */ if ( ! mipsyyin ) mipsyyin = stdin; if ( ! mipsyyout ) mipsyyout = stdout; if ( ! mipsyy_current_buffer ) mipsyy_current_buffer = mipsyy_create_buffer( mipsyyin, mipsYY_BUF_SIZE ); mipsyy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { mipsyy_cp = mipsyy_c_buf_p; /* Support of mipsyytext. */ *mipsyy_cp = mipsyy_hold_char; /* mipsyy_bp points to the position in mipsyy_ch_buf of the start of * the current run. */ mipsyy_bp = mipsyy_cp; mipsyy_current_state = mipsyy_start; mipsyy_match: do { register mipsYY_CHAR mipsyy_c = mipsyy_ec[mipsYY_SC_TO_UI(*mipsyy_cp)]; if ( mipsyy_accept[mipsyy_current_state] ) { mipsyy_last_accepting_state = mipsyy_current_state; mipsyy_last_accepting_cpos = mipsyy_cp; } while ( mipsyy_chk[mipsyy_base[mipsyy_current_state] + mipsyy_c] != mipsyy_current_state ) { mipsyy_current_state = (int) mipsyy_def[mipsyy_current_state]; if ( mipsyy_current_state >= 47 ) mipsyy_c = mipsyy_meta[(unsigned int) mipsyy_c]; } mipsyy_current_state = mipsyy_nxt[mipsyy_base[mipsyy_current_state] + (unsigned int) mipsyy_c]; ++mipsyy_cp; } while ( mipsyy_base[mipsyy_current_state] != 99 ); mipsyy_find_action: mipsyy_act = mipsyy_accept[mipsyy_current_state]; if ( mipsyy_act == 0 ) { /* have to back up */ mipsyy_cp = mipsyy_last_accepting_cpos; mipsyy_current_state = mipsyy_last_accepting_state; mipsyy_act = mipsyy_accept[mipsyy_current_state]; } mipsYY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( mipsyy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of mipsYY_DO_BEFORE_ACTION */ *mipsyy_cp = mipsyy_hold_char; mipsyy_cp = mipsyy_last_accepting_cpos; mipsyy_current_state = mipsyy_last_accepting_state; goto mipsyy_find_action; case 1: mipsYY_RULE_SETUP #line 52 "../../../src/mips_asm/src/mips_l.l" { /*printf ("CarriageReturn : %d\n", MPS_LINNUM);*/ MPS_LINNUM++; return (CarriageReturn); } mipsYY_BREAK case 2: mipsYY_RULE_SETUP #line 57 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Colon\n");*/ return (Colon); } mipsYY_BREAK case 3: mipsYY_RULE_SETUP #line 61 "../../../src/mips_asm/src/mips_l.l" { /*printf ("space\n");*/ } mipsYY_BREAK case 4: mipsYY_RULE_SETUP #line 64 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Sharp\n");*/ return (Sharp); } mipsYY_BREAK case 5: mipsYY_RULE_SETUP #line 68 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Ampersand\n");*/ return (Ampersand); } mipsYY_BREAK case 6: mipsYY_RULE_SETUP #line 72 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Bar\n");*/ return (Bar); } mipsYY_BREAK case 7: mipsYY_RULE_SETUP #line 76 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Tilda\n");*/ return (Tilda); } mipsYY_BREAK case 8: mipsYY_RULE_SETUP #line 80 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Circomflex\n");*/ return (Circomflex); } mipsYY_BREAK case 9: mipsYY_RULE_SETUP #line 84 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Plus\n");*/ return (Plus); } mipsYY_BREAK case 10: mipsYY_RULE_SETUP #line 88 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Slash\n");*/ return (Slash); } mipsYY_BREAK case 11: mipsYY_RULE_SETUP #line 92 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Star\n");*/ return (Star); } mipsYY_BREAK case 12: mipsYY_RULE_SETUP #line 96 "../../../src/mips_asm/src/mips_l.l" { /*printf ("DoubleLess\n");*/ return (DoubleLess); } mipsYY_BREAK case 13: mipsYY_RULE_SETUP #line 100 "../../../src/mips_asm/src/mips_l.l" { /*printf ("DoubleGreat\n");*/ return (DoubleGreat); } mipsYY_BREAK case 14: mipsYY_RULE_SETUP #line 104 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Minus\n");*/ return (Minus); } mipsYY_BREAK case 15: mipsYY_RULE_SETUP #line 108 "../../../src/mips_asm/src/mips_l.l" { /*printf ("LeftParen\n");*/ return (LeftParen); } mipsYY_BREAK case 16: mipsYY_RULE_SETUP #line 112 "../../../src/mips_asm/src/mips_l.l" { /*printf ("RightParen\n");*/ return (RightParen); } mipsYY_BREAK case 17: mipsYY_RULE_SETUP #line 116 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Comma\n");*/ return (Comma); } mipsYY_BREAK case 18: mipsYY_RULE_SETUP #line 120 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Register : %s\n", mipsyytext);*/ sscanf (&mipsyytext[1], "%lu", &mipsyylval.valu); return (Register); } mipsYY_BREAK case 19: mipsYY_RULE_SETUP #line 125 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Literal (X) : %s\n", mipsyytext);*/ mipsyylval.valu = hextoint (mipsyytext); return (Litteral); } mipsYY_BREAK case 20: mipsYY_RULE_SETUP #line 130 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Literal (O) : %s\n", mipsyytext);*/ mipsyylval.valu = octtoint (mipsyytext); return (Litteral); } mipsYY_BREAK case 21: mipsYY_RULE_SETUP #line 135 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Literal (B) : %s\n", mipsyytext);*/ mipsyylval.valu = bintoint (mipsyytext); return (Litteral); } mipsYY_BREAK case 22: mipsYY_RULE_SETUP #line 140 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Literal (D) : %s\n", mipsyytext);*/ if (sscanf (mipsyytext, "%ld", &mipsyylval.valu) == 0) mipsyylval.valu = 0; return (Litteral); } mipsYY_BREAK case 23: mipsYY_RULE_SETUP #line 147 "../../../src/mips_asm/src/mips_l.l" { extern char *mips_allocstr (); /*printf ("String : %s\n", mipsyytext);*/ mipsyylval.text = mips_allocstr (mipsyytext); return (String); } mipsYY_BREAK case 24: mipsYY_RULE_SETUP #line 154 "../../../src/mips_asm/src/mips_l.l" { int type ; extern char *mips_allocstr (); mipsyylval.text = mips_allocstr (mipsyytext); type = searchtype (mipsyylval.text); if (type == -1) { /*printf ("Identifier : %s\n", mipsyytext);*/ return (Identifier); } else { /*printf ("Key Word : %s\n", mipsyytext);*/ mipsyylval.valu = searchvalu (mipsyylval.text); return (type); } } mipsYY_BREAK case 25: *mipsyy_cp = mipsyy_hold_char; /* undo effects of setting up mipsyytext */ mipsyy_c_buf_p = mipsyy_cp -= 1; mipsYY_DO_BEFORE_ACTION; /* set up mipsyytext again */ mipsYY_RULE_SETUP #line 173 "../../../src/mips_asm/src/mips_l.l" { /*printf ("Comment : %s\n", mipsyytext);*/ } mipsYY_BREAK case 26: mipsYY_RULE_SETUP #line 176 "../../../src/mips_asm/src/mips_l.l" ECHO; mipsYY_BREAK case mipsYY_STATE_EOF(INITIAL): mipsyyterminate(); case mipsYY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int mipsyy_amount_of_matched_text = (int) (mipsyy_cp - mipsyytext_ptr) - 1; /* Undo the effects of mipsYY_DO_BEFORE_ACTION. */ *mipsyy_cp = mipsyy_hold_char; mipsYY_RESTORE_mipsYY_MORE_OFFSET if ( mipsyy_current_buffer->mipsyy_buffer_status == mipsYY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed mipsyyin at a new source and called * mipsyylex(). If so, then we have to assure * consistency between mipsyy_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. */ mipsyy_n_chars = mipsyy_current_buffer->mipsyy_n_chars; mipsyy_current_buffer->mipsyy_input_file = mipsyyin; mipsyy_current_buffer->mipsyy_buffer_status = mipsYY_BUFFER_NORMAL; } /* Note that here we test for mipsyy_c_buf_p "<=" to the position * of the first EOB in the buffer, since mipsyy_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 ( mipsyy_c_buf_p <= &mipsyy_current_buffer->mipsyy_ch_buf[mipsyy_n_chars] ) { /* This was really a NUL. */ mipsyy_state_type mipsyy_next_state; mipsyy_c_buf_p = mipsyytext_ptr + mipsyy_amount_of_matched_text; mipsyy_current_state = mipsyy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * mipsyy_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). */ mipsyy_next_state = mipsyy_try_NUL_trans( mipsyy_current_state ); mipsyy_bp = mipsyytext_ptr + mipsYY_MORE_ADJ; if ( mipsyy_next_state ) { /* Consume the NUL. */ mipsyy_cp = ++mipsyy_c_buf_p; mipsyy_current_state = mipsyy_next_state; goto mipsyy_match; } else { mipsyy_cp = mipsyy_c_buf_p; goto mipsyy_find_action; } } else switch ( mipsyy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { mipsyy_did_buffer_switch_on_eof = 0; if ( mipsyywrap() ) { /* Note: because we've taken care in * mipsyy_get_next_buffer() to have set up * mipsyytext, we can now set up * mipsyy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * mipsYY_NULL, it'll still work - another * mipsYY_NULL will get returned. */ mipsyy_c_buf_p = mipsyytext_ptr + mipsYY_MORE_ADJ; mipsyy_act = mipsYY_STATE_EOF(mipsYY_START); goto do_action; } else { if ( ! mipsyy_did_buffer_switch_on_eof ) mipsYY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: mipsyy_c_buf_p = mipsyytext_ptr + mipsyy_amount_of_matched_text; mipsyy_current_state = mipsyy_get_previous_state(); mipsyy_cp = mipsyy_c_buf_p; mipsyy_bp = mipsyytext_ptr + mipsYY_MORE_ADJ; goto mipsyy_match; case EOB_ACT_LAST_MATCH: mipsyy_c_buf_p = &mipsyy_current_buffer->mipsyy_ch_buf[mipsyy_n_chars]; mipsyy_current_state = mipsyy_get_previous_state(); mipsyy_cp = mipsyy_c_buf_p; mipsyy_bp = mipsyytext_ptr + mipsYY_MORE_ADJ; goto mipsyy_find_action; } break; } default: mipsYY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of mipsyylex */ /* mipsyy_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 mipsyy_get_next_buffer() { register char *dest = mipsyy_current_buffer->mipsyy_ch_buf; register char *source = mipsyytext_ptr; register int number_to_move, i; int ret_val; if ( mipsyy_c_buf_p > &mipsyy_current_buffer->mipsyy_ch_buf[mipsyy_n_chars + 1] ) mipsYY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( mipsyy_current_buffer->mipsyy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( mipsyy_c_buf_p - mipsyytext_ptr - mipsYY_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) (mipsyy_c_buf_p - mipsyytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( mipsyy_current_buffer->mipsyy_buffer_status == mipsYY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ mipsyy_current_buffer->mipsyy_n_chars = mipsyy_n_chars = 0; else { int num_to_read = mipsyy_current_buffer->mipsyy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef mipsYY_USES_REJECT mipsYY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ mipsYY_BUFFER_STATE b = mipsyy_current_buffer; int mipsyy_c_buf_p_offset = (int) (mipsyy_c_buf_p - b->mipsyy_ch_buf); if ( b->mipsyy_is_our_buffer ) { int new_size = b->mipsyy_buf_size * 2; if ( new_size <= 0 ) b->mipsyy_buf_size += b->mipsyy_buf_size / 8; else b->mipsyy_buf_size *= 2; b->mipsyy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ mipsyy_flex_realloc( (void *) b->mipsyy_ch_buf, b->mipsyy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->mipsyy_ch_buf = 0; if ( ! b->mipsyy_ch_buf ) mipsYY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); mipsyy_c_buf_p = &b->mipsyy_ch_buf[mipsyy_c_buf_p_offset]; num_to_read = mipsyy_current_buffer->mipsyy_buf_size - number_to_move - 1; #endif } if ( num_to_read > mipsYY_READ_BUF_SIZE ) num_to_read = mipsYY_READ_BUF_SIZE; /* Read in more data. */ mipsYY_INPUT( (&mipsyy_current_buffer->mipsyy_ch_buf[number_to_move]), mipsyy_n_chars, num_to_read ); mipsyy_current_buffer->mipsyy_n_chars = mipsyy_n_chars; } if ( mipsyy_n_chars == 0 ) { if ( number_to_move == mipsYY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; mipsyyrestart( mipsyyin ); } else { ret_val = EOB_ACT_LAST_MATCH; mipsyy_current_buffer->mipsyy_buffer_status = mipsYY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; mipsyy_n_chars += number_to_move; mipsyy_current_buffer->mipsyy_ch_buf[mipsyy_n_chars] = mipsYY_END_OF_BUFFER_CHAR; mipsyy_current_buffer->mipsyy_ch_buf[mipsyy_n_chars + 1] = mipsYY_END_OF_BUFFER_CHAR; mipsyytext_ptr = &mipsyy_current_buffer->mipsyy_ch_buf[0]; return ret_val; } /* mipsyy_get_previous_state - get the state just before the EOB char was reached */ static mipsyy_state_type mipsyy_get_previous_state() { register mipsyy_state_type mipsyy_current_state; register char *mipsyy_cp; mipsyy_current_state = mipsyy_start; for ( mipsyy_cp = mipsyytext_ptr + mipsYY_MORE_ADJ; mipsyy_cp < mipsyy_c_buf_p; ++mipsyy_cp ) { register mipsYY_CHAR mipsyy_c = (*mipsyy_cp ? mipsyy_ec[mipsYY_SC_TO_UI(*mipsyy_cp)] : 1); if ( mipsyy_accept[mipsyy_current_state] ) { mipsyy_last_accepting_state = mipsyy_current_state; mipsyy_last_accepting_cpos = mipsyy_cp; } while ( mipsyy_chk[mipsyy_base[mipsyy_current_state] + mipsyy_c] != mipsyy_current_state ) { mipsyy_current_state = (int) mipsyy_def[mipsyy_current_state]; if ( mipsyy_current_state >= 47 ) mipsyy_c = mipsyy_meta[(unsigned int) mipsyy_c]; } mipsyy_current_state = mipsyy_nxt[mipsyy_base[mipsyy_current_state] + (unsigned int) mipsyy_c]; } return mipsyy_current_state; } /* mipsyy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = mipsyy_try_NUL_trans( current_state ); */ #ifdef mipsYY_USE_PROTOS static mipsyy_state_type mipsyy_try_NUL_trans( mipsyy_state_type mipsyy_current_state ) #else static mipsyy_state_type mipsyy_try_NUL_trans( mipsyy_current_state ) mipsyy_state_type mipsyy_current_state; #endif { register int mipsyy_is_jam; register char *mipsyy_cp = mipsyy_c_buf_p; register mipsYY_CHAR mipsyy_c = 1; if ( mipsyy_accept[mipsyy_current_state] ) { mipsyy_last_accepting_state = mipsyy_current_state; mipsyy_last_accepting_cpos = mipsyy_cp; } while ( mipsyy_chk[mipsyy_base[mipsyy_current_state] + mipsyy_c] != mipsyy_current_state ) { mipsyy_current_state = (int) mipsyy_def[mipsyy_current_state]; if ( mipsyy_current_state >= 47 ) mipsyy_c = mipsyy_meta[(unsigned int) mipsyy_c]; } mipsyy_current_state = mipsyy_nxt[mipsyy_base[mipsyy_current_state] + (unsigned int) mipsyy_c]; mipsyy_is_jam = (mipsyy_current_state == 46); return mipsyy_is_jam ? 0 : mipsyy_current_state; } #ifndef mipsYY_NO_UNPUT #ifdef mipsYY_USE_PROTOS static void mipsyyunput( int c, register char *mipsyy_bp ) #else static void mipsyyunput( c, mipsyy_bp ) int c; register char *mipsyy_bp; #endif { register char *mipsyy_cp = mipsyy_c_buf_p; /* undo effects of setting up mipsyytext */ *mipsyy_cp = mipsyy_hold_char; if ( mipsyy_cp < mipsyy_current_buffer->mipsyy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = mipsyy_n_chars + 2; register char *dest = &mipsyy_current_buffer->mipsyy_ch_buf[ mipsyy_current_buffer->mipsyy_buf_size + 2]; register char *source = &mipsyy_current_buffer->mipsyy_ch_buf[number_to_move]; while ( source > mipsyy_current_buffer->mipsyy_ch_buf ) *--dest = *--source; mipsyy_cp += (int) (dest - source); mipsyy_bp += (int) (dest - source); mipsyy_current_buffer->mipsyy_n_chars = mipsyy_n_chars = mipsyy_current_buffer->mipsyy_buf_size; if ( mipsyy_cp < mipsyy_current_buffer->mipsyy_ch_buf + 2 ) mipsYY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--mipsyy_cp = (char) c; mipsyytext_ptr = mipsyy_bp; mipsyy_hold_char = *mipsyy_cp; mipsyy_c_buf_p = mipsyy_cp; } #endif /* ifndef mipsYY_NO_UNPUT */ #ifndef mipsYY_NO_INPUT #ifdef __cplusplus static int mipsyyinput() #else static int input() #endif { int c; *mipsyy_c_buf_p = mipsyy_hold_char; if ( *mipsyy_c_buf_p == mipsYY_END_OF_BUFFER_CHAR ) { /* mipsyy_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 ( mipsyy_c_buf_p < &mipsyy_current_buffer->mipsyy_ch_buf[mipsyy_n_chars] ) /* This was really a NUL. */ *mipsyy_c_buf_p = '\0'; else { /* need more input */ int offset = mipsyy_c_buf_p - mipsyytext_ptr; ++mipsyy_c_buf_p; switch ( mipsyy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because mipsyy_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. */ mipsyyrestart( mipsyyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( mipsyywrap() ) return EOF; if ( ! mipsyy_did_buffer_switch_on_eof ) mipsYY_NEW_FILE; #ifdef __cplusplus return mipsyyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: mipsyy_c_buf_p = mipsyytext_ptr + offset; break; } } } c = *(unsigned char *) mipsyy_c_buf_p; /* cast for 8-bit char's */ *mipsyy_c_buf_p = '\0'; /* preserve mipsyytext */ mipsyy_hold_char = *++mipsyy_c_buf_p; return c; } #endif /* mipsYY_NO_INPUT */ #ifdef mipsYY_USE_PROTOS void mipsyyrestart( FILE *input_file ) #else void mipsyyrestart( input_file ) FILE *input_file; #endif { if ( ! mipsyy_current_buffer ) mipsyy_current_buffer = mipsyy_create_buffer( mipsyyin, mipsYY_BUF_SIZE ); mipsyy_init_buffer( mipsyy_current_buffer, input_file ); mipsyy_load_buffer_state(); } #ifdef mipsYY_USE_PROTOS void mipsyy_switch_to_buffer( mipsYY_BUFFER_STATE new_buffer ) #else void mipsyy_switch_to_buffer( new_buffer ) mipsYY_BUFFER_STATE new_buffer; #endif { if ( mipsyy_current_buffer == new_buffer ) return; if ( mipsyy_current_buffer ) { /* Flush out information for old buffer. */ *mipsyy_c_buf_p = mipsyy_hold_char; mipsyy_current_buffer->mipsyy_buf_pos = mipsyy_c_buf_p; mipsyy_current_buffer->mipsyy_n_chars = mipsyy_n_chars; } mipsyy_current_buffer = new_buffer; mipsyy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (mipsyywrap()) processing, but the only time this flag * is looked at is after mipsyywrap() is called, so it's safe * to go ahead and always set it. */ mipsyy_did_buffer_switch_on_eof = 1; } #ifdef mipsYY_USE_PROTOS void mipsyy_load_buffer_state( void ) #else void mipsyy_load_buffer_state() #endif { mipsyy_n_chars = mipsyy_current_buffer->mipsyy_n_chars; mipsyytext_ptr = mipsyy_c_buf_p = mipsyy_current_buffer->mipsyy_buf_pos; mipsyyin = mipsyy_current_buffer->mipsyy_input_file; mipsyy_hold_char = *mipsyy_c_buf_p; } #ifdef mipsYY_USE_PROTOS mipsYY_BUFFER_STATE mipsyy_create_buffer( FILE *file, int size ) #else mipsYY_BUFFER_STATE mipsyy_create_buffer( file, size ) FILE *file; int size; #endif { mipsYY_BUFFER_STATE b; b = (mipsYY_BUFFER_STATE) mipsyy_flex_alloc( sizeof( struct mipsyy_buffer_state ) ); if ( ! b ) mipsYY_FATAL_ERROR( "out of dynamic memory in mipsyy_create_buffer()" ); b->mipsyy_buf_size = size; /* mipsyy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->mipsyy_ch_buf = (char *) mipsyy_flex_alloc( b->mipsyy_buf_size + 2 ); if ( ! b->mipsyy_ch_buf ) mipsYY_FATAL_ERROR( "out of dynamic memory in mipsyy_create_buffer()" ); b->mipsyy_is_our_buffer = 1; mipsyy_init_buffer( b, file ); return b; } #ifdef mipsYY_USE_PROTOS void mipsyy_delete_buffer( mipsYY_BUFFER_STATE b ) #else void mipsyy_delete_buffer( b ) mipsYY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == mipsyy_current_buffer ) mipsyy_current_buffer = (mipsYY_BUFFER_STATE) 0; if ( b->mipsyy_is_our_buffer ) mipsyy_flex_free( (void *) b->mipsyy_ch_buf ); mipsyy_flex_free( (void *) b ); } #ifdef mipsYY_USE_PROTOS void mipsyy_init_buffer( mipsYY_BUFFER_STATE b, FILE *file ) #else void mipsyy_init_buffer( b, file ) mipsYY_BUFFER_STATE b; FILE *file; #endif { mipsyy_flush_buffer( b ); b->mipsyy_input_file = file; b->mipsyy_fill_buffer = 1; #if mipsYY_ALWAYS_INTERACTIVE b->mipsyy_is_interactive = 1; #else #if mipsYY_NEVER_INTERACTIVE b->mipsyy_is_interactive = 0; #else b->mipsyy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef mipsYY_USE_PROTOS void mipsyy_flush_buffer( mipsYY_BUFFER_STATE b ) #else void mipsyy_flush_buffer( b ) mipsYY_BUFFER_STATE b; #endif { if ( ! b ) return; b->mipsyy_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->mipsyy_ch_buf[0] = mipsYY_END_OF_BUFFER_CHAR; b->mipsyy_ch_buf[1] = mipsYY_END_OF_BUFFER_CHAR; b->mipsyy_buf_pos = &b->mipsyy_ch_buf[0]; b->mipsyy_at_bol = 1; b->mipsyy_buffer_status = mipsYY_BUFFER_NEW; if ( b == mipsyy_current_buffer ) mipsyy_load_buffer_state(); } #ifndef mipsYY_NO_SCAN_BUFFER #ifdef mipsYY_USE_PROTOS mipsYY_BUFFER_STATE mipsyy_scan_buffer( char *base, mipsyy_size_t size ) #else mipsYY_BUFFER_STATE mipsyy_scan_buffer( base, size ) char *base; mipsyy_size_t size; #endif { mipsYY_BUFFER_STATE b; if ( size < 2 || base[size-2] != mipsYY_END_OF_BUFFER_CHAR || base[size-1] != mipsYY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (mipsYY_BUFFER_STATE) mipsyy_flex_alloc( sizeof( struct mipsyy_buffer_state ) ); if ( ! b ) mipsYY_FATAL_ERROR( "out of dynamic memory in mipsyy_scan_buffer()" ); b->mipsyy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->mipsyy_buf_pos = b->mipsyy_ch_buf = base; b->mipsyy_is_our_buffer = 0; b->mipsyy_input_file = 0; b->mipsyy_n_chars = b->mipsyy_buf_size; b->mipsyy_is_interactive = 0; b->mipsyy_at_bol = 1; b->mipsyy_fill_buffer = 0; b->mipsyy_buffer_status = mipsYY_BUFFER_NEW; mipsyy_switch_to_buffer( b ); return b; } #endif #ifndef mipsYY_NO_SCAN_STRING #ifdef mipsYY_USE_PROTOS mipsYY_BUFFER_STATE mipsyy_scan_string( mipsyyconst char *mipsyy_str ) #else mipsYY_BUFFER_STATE mipsyy_scan_string( mipsyy_str ) mipsyyconst char *mipsyy_str; #endif { int len; for ( len = 0; mipsyy_str[len]; ++len ) ; return mipsyy_scan_bytes( mipsyy_str, len ); } #endif #ifndef mipsYY_NO_SCAN_BYTES #ifdef mipsYY_USE_PROTOS mipsYY_BUFFER_STATE mipsyy_scan_bytes( mipsyyconst char *bytes, int len ) #else mipsYY_BUFFER_STATE mipsyy_scan_bytes( bytes, len ) mipsyyconst char *bytes; int len; #endif { mipsYY_BUFFER_STATE b; char *buf; mipsyy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) mipsyy_flex_alloc( n ); if ( ! buf ) mipsYY_FATAL_ERROR( "out of dynamic memory in mipsyy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = mipsYY_END_OF_BUFFER_CHAR; b = mipsyy_scan_buffer( buf, n ); if ( ! b ) mipsYY_FATAL_ERROR( "bad buffer in mipsyy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->mipsyy_is_our_buffer = 1; return b; } #endif #ifndef mipsYY_NO_PUSH_STATE #ifdef mipsYY_USE_PROTOS static void mipsyy_push_state( int new_state ) #else static void mipsyy_push_state( new_state ) int new_state; #endif { if ( mipsyy_start_stack_ptr >= mipsyy_start_stack_depth ) { mipsyy_size_t new_size; mipsyy_start_stack_depth += mipsYY_START_STACK_INCR; new_size = mipsyy_start_stack_depth * sizeof( int ); if ( ! mipsyy_start_stack ) mipsyy_start_stack = (int *) mipsyy_flex_alloc( new_size ); else mipsyy_start_stack = (int *) mipsyy_flex_realloc( (void *) mipsyy_start_stack, new_size ); if ( ! mipsyy_start_stack ) mipsYY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } mipsyy_start_stack[mipsyy_start_stack_ptr++] = mipsYY_START; BEGIN(new_state); } #endif #ifndef mipsYY_NO_POP_STATE static void mipsyy_pop_state() { if ( --mipsyy_start_stack_ptr < 0 ) mipsYY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(mipsyy_start_stack[mipsyy_start_stack_ptr]); } #endif #ifndef mipsYY_NO_TOP_STATE static int mipsyy_top_state() { return mipsyy_start_stack[mipsyy_start_stack_ptr - 1]; } #endif #ifndef mipsYY_EXIT_FAILURE #define mipsYY_EXIT_FAILURE 2 #endif #ifdef mipsYY_USE_PROTOS static void mipsyy_fatal_error( mipsyyconst char msg[] ) #else static void mipsyy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( mipsYY_EXIT_FAILURE ); } /* Redefine mipsyyless() so it works in section 3 code. */ #undef mipsyyless #define mipsyyless(n) \ do \ { \ /* Undo effects of setting up mipsyytext. */ \ mipsyytext[mipsyyleng] = mipsyy_hold_char; \ mipsyy_c_buf_p = mipsyytext + n; \ mipsyy_hold_char = *mipsyy_c_buf_p; \ *mipsyy_c_buf_p = '\0'; \ mipsyyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef mipsyytext_ptr #ifdef mipsYY_USE_PROTOS static void mipsyy_flex_strncpy( char *s1, mipsyyconst char *s2, int n ) #else static void mipsyy_flex_strncpy( s1, s2, n ) char *s1; mipsyyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef mipsYY_NEED_STRLEN #ifdef mipsYY_USE_PROTOS static int mipsyy_flex_strlen( mipsyyconst char *s ) #else static int mipsyy_flex_strlen( s ) mipsyyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef mipsYY_USE_PROTOS static void *mipsyy_flex_alloc( mipsyy_size_t size ) #else static void *mipsyy_flex_alloc( size ) mipsyy_size_t size; #endif { return (void *) malloc( size ); } #ifdef mipsYY_USE_PROTOS static void *mipsyy_flex_realloc( void *ptr, mipsyy_size_t size ) #else static void *mipsyy_flex_realloc( ptr, size ) void *ptr; mipsyy_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 mipsYY_USE_PROTOS static void mipsyy_flex_free( void *ptr ) #else static void mipsyy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if mipsYY_MAIN int main() { mipsyylex(); return 0; } #endif #line 176 "../../../src/mips_asm/src/mips_l.l" static int searchtype (str) char *str; { extern char *mips_allocstr () ; static ht *type_hashpt = NULL; if (type_hashpt == NULL) { type_hashpt = addht (128); addhtitem (type_hashpt, mips_allocstr ("zero" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("at" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("v0" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("v1" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("a0" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("a1" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("a2" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("a3" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t0" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t1" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t2" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t3" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t4" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t5" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t6" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t7" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s0" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s1" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s2" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s3" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s4" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s5" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s6" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s7" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t8" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("t9" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("k0" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("k1" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("gp" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("sp" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("s8" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("ra" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r0" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r1" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r2" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r3" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r4" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r5" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r6" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r7" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r8" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r9" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r10" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r11" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r12" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r13" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r14" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r15" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r16" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r17" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r18" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r19" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r20" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r21" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r22" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r23" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r24" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r25" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r26" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r27" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r28" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r29" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r30" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("r31" ), IntegerRegister ); addhtitem (type_hashpt, mips_allocstr ("badvaddr"), CP0Register ); addhtitem (type_hashpt, mips_allocstr ("status" ), CP0Register ); addhtitem (type_hashpt, mips_allocstr ("cause" ), CP0Register ); addhtitem (type_hashpt, mips_allocstr ("epc" ), CP0Register ); addhtitem (type_hashpt, mips_allocstr (".align" ), _ALIGN ); addhtitem (type_hashpt, mips_allocstr (".ascii" ), _ASCII ); addhtitem (type_hashpt, mips_allocstr (".asciiz" ), _ASCIIZ ); addhtitem (type_hashpt, mips_allocstr (".byte" ), _BYTE ); addhtitem (type_hashpt, mips_allocstr (".bytez" ), _BYTEZ ); addhtitem (type_hashpt, mips_allocstr (".data" ), _DATA ); addhtitem (type_hashpt, mips_allocstr (".end" ), _END ); addhtitem (type_hashpt, mips_allocstr (".equ" ), _EQU ); addhtitem (type_hashpt, mips_allocstr (".global" ), _GLOBAL ); addhtitem (type_hashpt, mips_allocstr (".org" ), _ORG ); addhtitem (type_hashpt, mips_allocstr (".skip" ), _SKIP ); addhtitem (type_hashpt, mips_allocstr (".space" ), _SPACE ); addhtitem (type_hashpt, mips_allocstr (".start" ), _START ); addhtitem (type_hashpt, mips_allocstr (".text" ), _TEXT ); addhtitem (type_hashpt, mips_allocstr (".word" ), _WORD ); addhtitem (type_hashpt, mips_allocstr ("nop" ), Macro_n ); addhtitem (type_hashpt, mips_allocstr ("loadi" ), Macro_rd_longi ); addhtitem (type_hashpt, mips_allocstr ("la" ), Macro_rd_longi ); addhtitem (type_hashpt, mips_allocstr ("li" ), Macro_rd_longi ); addhtitem (type_hashpt, mips_allocstr ("add" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("addi" ), Codop_rd_rs_imd ); addhtitem (type_hashpt, mips_allocstr ("addu" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("addiu" ), Codop_rd_rs_imd ); addhtitem (type_hashpt, mips_allocstr ("and" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("andi" ), Codop_rd_rs_imd ); addhtitem (type_hashpt, mips_allocstr ("beq" ), Codop_rs_rt_labl); addhtitem (type_hashpt, mips_allocstr ("bgez" ), Codop_rs_labl ); addhtitem (type_hashpt, mips_allocstr ("bgezal" ), Codop_rs_labl ); addhtitem (type_hashpt, mips_allocstr ("bgtz" ), Codop_rs_labl ); addhtitem (type_hashpt, mips_allocstr ("blez" ), Codop_rs_labl ); addhtitem (type_hashpt, mips_allocstr ("bltz" ), Codop_rs_labl ); addhtitem (type_hashpt, mips_allocstr ("bltzal" ), Codop_rs_labl ); addhtitem (type_hashpt, mips_allocstr ("bne" ), Codop_rs_rt_labl); addhtitem (type_hashpt, mips_allocstr ("break" ), Codop_imd ); addhtitem (type_hashpt, mips_allocstr ("j" ), Codop_labl ); addhtitem (type_hashpt, mips_allocstr ("jal" ), Codop_labl ); addhtitem (type_hashpt, mips_allocstr ("jalr" ), Codop_od_rs ); addhtitem (type_hashpt, mips_allocstr ("jr" ), Codop_rs ); addhtitem (type_hashpt, mips_allocstr ("lb" ), Codop_rd_mem ); addhtitem (type_hashpt, mips_allocstr ("lbu" ), Codop_rd_mem ); addhtitem (type_hashpt, mips_allocstr ("lh" ), Codop_rd_mem ); addhtitem (type_hashpt, mips_allocstr ("lhu" ), Codop_rd_mem ); addhtitem (type_hashpt, mips_allocstr ("lui" ), Codop_rd_imd ); addhtitem (type_hashpt, mips_allocstr ("lw" ), Codop_rd_mem ); addhtitem (type_hashpt, mips_allocstr ("mfc0" ), Codop_rt_cp0rd ); addhtitem (type_hashpt, mips_allocstr ("mfhi" ), Codop_rd ); addhtitem (type_hashpt, mips_allocstr ("mflo" ), Codop_rd ); addhtitem (type_hashpt, mips_allocstr ("mtc0" ), Codop_rt_cp0rd ); addhtitem (type_hashpt, mips_allocstr ("mthi" ), Codop_rs ); addhtitem (type_hashpt, mips_allocstr ("mtlo" ), Codop_rs ); addhtitem (type_hashpt, mips_allocstr ("nor" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("or" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("ori" ), Codop_rd_rs_imd ); addhtitem (type_hashpt, mips_allocstr ("rfe" ), Codop_n ); addhtitem (type_hashpt, mips_allocstr ("sb" ), Codop_rt_mem ); addhtitem (type_hashpt, mips_allocstr ("sh" ), Codop_rt_mem ); addhtitem (type_hashpt, mips_allocstr ("sleep" ), Codop_n ); addhtitem (type_hashpt, mips_allocstr ("sll" ), Codop_rd_rt_sham); addhtitem (type_hashpt, mips_allocstr ("sllv" ), Codop_rd_rt_rs ); addhtitem (type_hashpt, mips_allocstr ("slt" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("slti" ), Codop_rd_rs_imd ); addhtitem (type_hashpt, mips_allocstr ("sltiu" ), Codop_rd_rs_imd ); addhtitem (type_hashpt, mips_allocstr ("sltu" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("sra" ), Codop_rd_rt_sham); addhtitem (type_hashpt, mips_allocstr ("srav" ), Codop_rd_rt_rs ); addhtitem (type_hashpt, mips_allocstr ("srl" ), Codop_rd_rt_sham); addhtitem (type_hashpt, mips_allocstr ("srlv" ), Codop_rd_rt_rs ); addhtitem (type_hashpt, mips_allocstr ("sub" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("subu" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("sw" ), Codop_rt_mem ); addhtitem (type_hashpt, mips_allocstr ("swap" ), Codop_rt_mem ); addhtitem (type_hashpt, mips_allocstr ("syscall" ), Codop_n ); addhtitem (type_hashpt, mips_allocstr ("xor" ), Codop_rd_rs_rt ); addhtitem (type_hashpt, mips_allocstr ("xori" ), Codop_rd_rs_imd ); } return (gethtitem (type_hashpt, str)); } static int searchvalu (str) char *str; { extern char *mips_allocstr () ; static ht *valu_hashpt = NULL; if (valu_hashpt == NULL) { valu_hashpt = addht (128); addhtitem (valu_hashpt, mips_allocstr ("zero" ), 0 ); addhtitem (valu_hashpt, mips_allocstr ("at" ), 1 ); addhtitem (valu_hashpt, mips_allocstr ("v0" ), 2 ); addhtitem (valu_hashpt, mips_allocstr ("v1" ), 3 ); addhtitem (valu_hashpt, mips_allocstr ("a0" ), 4 ); addhtitem (valu_hashpt, mips_allocstr ("a1" ), 5 ); addhtitem (valu_hashpt, mips_allocstr ("a2" ), 6 ); addhtitem (valu_hashpt, mips_allocstr ("a3" ), 7 ); addhtitem (valu_hashpt, mips_allocstr ("t0" ), 8 ); addhtitem (valu_hashpt, mips_allocstr ("t1" ), 9 ); addhtitem (valu_hashpt, mips_allocstr ("t2" ), 10 ); addhtitem (valu_hashpt, mips_allocstr ("t3" ), 11 ); addhtitem (valu_hashpt, mips_allocstr ("t4" ), 12 ); addhtitem (valu_hashpt, mips_allocstr ("t5" ), 13 ); addhtitem (valu_hashpt, mips_allocstr ("t6" ), 14 ); addhtitem (valu_hashpt, mips_allocstr ("t7" ), 15 ); addhtitem (valu_hashpt, mips_allocstr ("s0" ), 16 ); addhtitem (valu_hashpt, mips_allocstr ("s1" ), 17 ); addhtitem (valu_hashpt, mips_allocstr ("s2" ), 18 ); addhtitem (valu_hashpt, mips_allocstr ("s3" ), 19 ); addhtitem (valu_hashpt, mips_allocstr ("s4" ), 20 ); addhtitem (valu_hashpt, mips_allocstr ("s5" ), 21 ); addhtitem (valu_hashpt, mips_allocstr ("s6" ), 22 ); addhtitem (valu_hashpt, mips_allocstr ("s7" ), 23 ); addhtitem (valu_hashpt, mips_allocstr ("t8" ), 24 ); addhtitem (valu_hashpt, mips_allocstr ("t9" ), 25 ); addhtitem (valu_hashpt, mips_allocstr ("k0" ), 26 ); addhtitem (valu_hashpt, mips_allocstr ("k1" ), 27 ); addhtitem (valu_hashpt, mips_allocstr ("gp" ), 28 ); addhtitem (valu_hashpt, mips_allocstr ("sp" ), 29 ); addhtitem (valu_hashpt, mips_allocstr ("s8" ), 30 ); addhtitem (valu_hashpt, mips_allocstr ("ra" ), 31 ); addhtitem (valu_hashpt, mips_allocstr ("r0" ), 0 ); addhtitem (valu_hashpt, mips_allocstr ("r1" ), 1 ); addhtitem (valu_hashpt, mips_allocstr ("r2" ), 2 ); addhtitem (valu_hashpt, mips_allocstr ("r3" ), 3 ); addhtitem (valu_hashpt, mips_allocstr ("r4" ), 4 ); addhtitem (valu_hashpt, mips_allocstr ("r5" ), 5 ); addhtitem (valu_hashpt, mips_allocstr ("r6" ), 6 ); addhtitem (valu_hashpt, mips_allocstr ("r7" ), 7 ); addhtitem (valu_hashpt, mips_allocstr ("r8" ), 8 ); addhtitem (valu_hashpt, mips_allocstr ("r9" ), 9 ); addhtitem (valu_hashpt, mips_allocstr ("r10" ), 10 ); addhtitem (valu_hashpt, mips_allocstr ("r11" ), 11 ); addhtitem (valu_hashpt, mips_allocstr ("r12" ), 12 ); addhtitem (valu_hashpt, mips_allocstr ("r13" ), 13 ); addhtitem (valu_hashpt, mips_allocstr ("r14" ), 14 ); addhtitem (valu_hashpt, mips_allocstr ("r15" ), 15 ); addhtitem (valu_hashpt, mips_allocstr ("r16" ), 16 ); addhtitem (valu_hashpt, mips_allocstr ("r17" ), 17 ); addhtitem (valu_hashpt, mips_allocstr ("r18" ), 18 ); addhtitem (valu_hashpt, mips_allocstr ("r19" ), 19 ); addhtitem (valu_hashpt, mips_allocstr ("r20" ), 20 ); addhtitem (valu_hashpt, mips_allocstr ("r21" ), 21 ); addhtitem (valu_hashpt, mips_allocstr ("r22" ), 22 ); addhtitem (valu_hashpt, mips_allocstr ("r23" ), 23 ); addhtitem (valu_hashpt, mips_allocstr ("r24" ), 24 ); addhtitem (valu_hashpt, mips_allocstr ("r25" ), 25 ); addhtitem (valu_hashpt, mips_allocstr ("r26" ), 26 ); addhtitem (valu_hashpt, mips_allocstr ("r27" ), 27 ); addhtitem (valu_hashpt, mips_allocstr ("r28" ), 28 ); addhtitem (valu_hashpt, mips_allocstr ("r29" ), 29 ); addhtitem (valu_hashpt, mips_allocstr ("r30" ), 30 ); addhtitem (valu_hashpt, mips_allocstr ("r31" ), 31 ); addhtitem (valu_hashpt, mips_allocstr ("badvaddr"), _BADVADDR); addhtitem (valu_hashpt, mips_allocstr ("status" ), _STATUS ); addhtitem (valu_hashpt, mips_allocstr ("cause" ), _CAUSE ); addhtitem (valu_hashpt, mips_allocstr ("epc" ), _EPC ); addhtitem (valu_hashpt, mips_allocstr (".align" ), _ALIGN ); addhtitem (valu_hashpt, mips_allocstr (".ascii" ), _ASCII ); addhtitem (valu_hashpt, mips_allocstr (".asciiz" ), _ASCIIZ ); addhtitem (valu_hashpt, mips_allocstr (".byte" ), _BYTE ); addhtitem (valu_hashpt, mips_allocstr (".bytez" ), _BYTEZ ); addhtitem (valu_hashpt, mips_allocstr (".data" ), _DATA ); addhtitem (valu_hashpt, mips_allocstr (".end" ), _END ); addhtitem (valu_hashpt, mips_allocstr (".equ" ), _EQU ); addhtitem (valu_hashpt, mips_allocstr (".global" ), _GLOBAL ); addhtitem (valu_hashpt, mips_allocstr (".org" ), _ORG ); addhtitem (valu_hashpt, mips_allocstr (".skip" ), _SKIP ); addhtitem (valu_hashpt, mips_allocstr (".space" ), _SPACE ); addhtitem (valu_hashpt, mips_allocstr (".start" ), _START ); addhtitem (valu_hashpt, mips_allocstr (".text" ), _TEXT ); addhtitem (valu_hashpt, mips_allocstr (".word" ), _WORD ); addhtitem (valu_hashpt, mips_allocstr ("nop" ), _NOP ); addhtitem (valu_hashpt, mips_allocstr ("loadi" ), _LOADI ); addhtitem (valu_hashpt, mips_allocstr ("la" ), _LOADI ); addhtitem (valu_hashpt, mips_allocstr ("li" ), _LOADI ); addhtitem (valu_hashpt, mips_allocstr ("add" ), _ADD ); addhtitem (valu_hashpt, mips_allocstr ("addi" ), _ADDI ); addhtitem (valu_hashpt, mips_allocstr ("addu" ), _ADDU ); addhtitem (valu_hashpt, mips_allocstr ("addiu" ), _ADDIU ); addhtitem (valu_hashpt, mips_allocstr ("and" ), _AND ); addhtitem (valu_hashpt, mips_allocstr ("andi" ), _ANDI ); addhtitem (valu_hashpt, mips_allocstr ("beq" ), _BEQ ); addhtitem (valu_hashpt, mips_allocstr ("bgez" ), _BGEZ ); addhtitem (valu_hashpt, mips_allocstr ("bgezal" ), _BGEZAL ); addhtitem (valu_hashpt, mips_allocstr ("bgtz" ), _BGTZ ); addhtitem (valu_hashpt, mips_allocstr ("blez" ), _BLEZ ); addhtitem (valu_hashpt, mips_allocstr ("bltz" ), _BLTZ ); addhtitem (valu_hashpt, mips_allocstr ("bltzal" ), _BLTZAL ); addhtitem (valu_hashpt, mips_allocstr ("bne" ), _BNE ); addhtitem (valu_hashpt, mips_allocstr ("break" ), _BREAK ); addhtitem (valu_hashpt, mips_allocstr ("j" ), _J ); addhtitem (valu_hashpt, mips_allocstr ("jal" ), _JAL ); addhtitem (valu_hashpt, mips_allocstr ("jalr" ), _JALR ); addhtitem (valu_hashpt, mips_allocstr ("jr" ), _JR ); addhtitem (valu_hashpt, mips_allocstr ("lb" ), _LB ); addhtitem (valu_hashpt, mips_allocstr ("lbu" ), _LBU ); addhtitem (valu_hashpt, mips_allocstr ("lh" ), _LH ); addhtitem (valu_hashpt, mips_allocstr ("lhu" ), _LHU ); addhtitem (valu_hashpt, mips_allocstr ("lui" ), _LUI ); addhtitem (valu_hashpt, mips_allocstr ("lw" ), _LW ); addhtitem (valu_hashpt, mips_allocstr ("mfc0" ), _MFC0 ); addhtitem (valu_hashpt, mips_allocstr ("mfhi" ), _MFHI ); addhtitem (valu_hashpt, mips_allocstr ("mflo" ), _MFLO ); addhtitem (valu_hashpt, mips_allocstr ("mtc0" ), _MTC0 ); addhtitem (valu_hashpt, mips_allocstr ("mthi" ), _MTHI ); addhtitem (valu_hashpt, mips_allocstr ("mtlo" ), _MTLO ); addhtitem (valu_hashpt, mips_allocstr ("nor" ), _NOR ); addhtitem (valu_hashpt, mips_allocstr ("or" ), _OR ); addhtitem (valu_hashpt, mips_allocstr ("ori" ), _ORI ); addhtitem (valu_hashpt, mips_allocstr ("rfe" ), _RSTFE ); addhtitem (valu_hashpt, mips_allocstr ("sb" ), _SB ); addhtitem (valu_hashpt, mips_allocstr ("sh" ), _SH ); addhtitem (valu_hashpt, mips_allocstr ("sleep" ), _SLEEP ); addhtitem (valu_hashpt, mips_allocstr ("sll" ), _SLL ); addhtitem (valu_hashpt, mips_allocstr ("sllv" ), _SLLV ); addhtitem (valu_hashpt, mips_allocstr ("slt" ), _SLT ); addhtitem (valu_hashpt, mips_allocstr ("slti" ), _SLTI ); addhtitem (valu_hashpt, mips_allocstr ("sltiu" ), _SLTIU ); addhtitem (valu_hashpt, mips_allocstr ("sltu" ), _SLTU ); addhtitem (valu_hashpt, mips_allocstr ("sra" ), _SRA ); addhtitem (valu_hashpt, mips_allocstr ("srav" ), _SRAV ); addhtitem (valu_hashpt, mips_allocstr ("srl" ), _SRL ); addhtitem (valu_hashpt, mips_allocstr ("srlv" ), _SRLV ); addhtitem (valu_hashpt, mips_allocstr ("sub" ), _SUB ); addhtitem (valu_hashpt, mips_allocstr ("subu" ), _SUBU ); addhtitem (valu_hashpt, mips_allocstr ("sw" ), _SW ); addhtitem (valu_hashpt, mips_allocstr ("swap" ), _SWAP ); addhtitem (valu_hashpt, mips_allocstr ("syscall" ), _SYSCALL ); addhtitem (valu_hashpt, mips_allocstr ("xor" ), _XOR ); addhtitem (valu_hashpt, mips_allocstr ("xori" ), _XORI ); } return (gethtitem (valu_hashpt, str)); } static unsigned long hextoint (str) char *str; { unsigned long valu = 0; char c = 0; while ((c = *str) != '\0') { if ((c >= '0') && (c <= '9')) valu = (valu << 4) + c - '0'; else if ((c >= 'a') && (c <= 'f')) valu = (valu << 4) + c - 'a' + 10; else if ((c >= 'A') && (c <= 'F')) valu = (valu << 4) + c - 'A' + 10; str++; } return (valu); } static unsigned long octtoint (str) char *str; { unsigned long valu = 0; char c = 0; while ((c = *str) != '\0') { if ((c >= '0') && (c <= '7')) valu = (valu << 3) + c - '0'; str++; } return (valu); } static unsigned long bintoint (str) char *str; { unsigned long valu = 0; char c = 0; while ((c = *str) != '\0') { if ((c == '0') || (c == '1')) valu = (valu << 1) + c - '0'; str++; } return (valu); } int mipsyywrap () { return (1); }