diff options
author | Phil Blundell <philb@gnu.org> | 2001-03-12 15:41:13 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 2001-03-12 15:41:13 +0000 |
commit | 461b5d83743e6419aea419322607836ed4255f22 (patch) | |
tree | d344d84b8bc1e6afe9cd815be664c5f35054ed20 /binutils | |
parent | 691387c5ed6c4ad68afd38956d7993b5d5a935b2 (diff) | |
download | gdb-461b5d83743e6419aea419322607836ed4255f22.zip gdb-461b5d83743e6419aea419322607836ed4255f22.tar.gz gdb-461b5d83743e6419aea419322607836ed4255f22.tar.bz2 |
Add generated files to release branch.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/arlex.c | 1835 | ||||
-rw-r--r-- | binutils/arparse.c | 1090 | ||||
-rw-r--r-- | binutils/arparse.h | 26 | ||||
-rw-r--r-- | binutils/binutils.info | 69 | ||||
-rw-r--r-- | binutils/binutils.info-1 | 1310 | ||||
-rw-r--r-- | binutils/binutils.info-2 | 1403 | ||||
-rw-r--r-- | binutils/binutils.info-3 | 527 | ||||
-rw-r--r-- | binutils/config.texi | 1 | ||||
-rw-r--r-- | binutils/deflex.c | 1844 | ||||
-rw-r--r-- | binutils/defparse.c | 1202 | ||||
-rw-r--r-- | binutils/defparse.h | 34 | ||||
-rw-r--r-- | binutils/nlmheader.c | 1991 | ||||
-rw-r--r-- | binutils/nlmheader.h | 43 | ||||
-rw-r--r-- | binutils/rclex.c | 2589 | ||||
-rw-r--r-- | binutils/rcparse.c | 3152 | ||||
-rw-r--r-- | binutils/rcparse.h | 125 | ||||
-rw-r--r-- | binutils/sysinfo.c | 1309 | ||||
-rw-r--r-- | binutils/sysinfo.h | 13 | ||||
-rw-r--r-- | binutils/syslex.c | 1683 |
19 files changed, 20246 insertions, 0 deletions
diff --git a/binutils/arlex.c b/binutils/arlex.c new file mode 100644 index 0000000..23ca1f0 --- /dev/null +++ b/binutils/arlex.c @@ -0,0 +1,1835 @@ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_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 YY_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 yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#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 ) + * yyless( 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 yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_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 yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_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 yy_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 yy_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 yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_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 YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 40 +#define YY_END_OF_BUFFER 41 +static yyconst short int yy_accept[177] = + { 0, + 0, 0, 41, 40, 39, 38, 35, 32, 33, 36, + 40, 34, 37, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 36, 31, 37, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 7, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 22, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + + 35, 35, 35, 10, 11, 12, 35, 15, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 25, 26, 27, + 35, 30, 35, 35, 35, 3, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 18, 35, 35, 35, 35, + 35, 35, 35, 1, 2, 4, 5, 35, 35, 35, + 35, 35, 16, 17, 19, 20, 35, 35, 35, 35, + 35, 35, 8, 9, 13, 14, 35, 23, 24, 28, + 29, 35, 35, 6, 21, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 1, 4, 1, 1, 1, 5, + 6, 7, 8, 9, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 10, 1, + 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, + 4, 17, 18, 4, 4, 19, 20, 21, 22, 23, + 4, 24, 25, 26, 27, 28, 4, 29, 30, 4, + 1, 1, 1, 1, 4, 1, 31, 32, 33, 34, + + 35, 36, 4, 37, 38, 4, 4, 39, 40, 41, + 42, 43, 4, 44, 45, 46, 47, 48, 4, 49, + 50, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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 yyconst int yy_meta[51] = + { 0, + 1, 2, 1, 3, 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, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + } ; + +static yyconst short int yy_base[180] = + { 0, + 0, 0, 193, 194, 194, 194, 0, 194, 194, 0, + 190, 194, 0, 177, 32, 37, 32, 163, 174, 170, + 164, 171, 174, 169, 149, 15, 22, 17, 135, 146, + 142, 136, 143, 146, 141, 0, 0, 194, 0, 161, + 159, 158, 153, 147, 156, 143, 149, 148, 141, 150, + 141, 135, 138, 127, 125, 124, 119, 113, 122, 109, + 115, 114, 107, 116, 107, 101, 104, 43, 136, 135, + 130, 129, 0, 119, 123, 118, 114, 118, 119, 122, + 124, 25, 104, 103, 98, 97, 0, 87, 91, 86, + 82, 86, 87, 90, 92, 105, 100, 97, 94, 93, + + 105, 106, 102, 0, 0, 0, 104, 0, 92, 75, + 70, 67, 64, 63, 75, 76, 72, 0, 0, 0, + 74, 0, 62, 91, 88, 0, 86, 85, 73, 85, + 79, 83, 70, 62, 59, 0, 57, 56, 44, 56, + 50, 54, 41, 0, 0, 0, 0, 63, 58, 59, + 67, 66, 0, 0, 0, 0, 38, 33, 34, 42, + 41, 51, 0, 0, 0, 0, 30, 0, 0, 0, + 0, 43, 21, 0, 0, 194, 65, 66, 69 + } ; + +static yyconst short int yy_def[180] = + { 0, + 176, 1, 176, 176, 176, 176, 177, 176, 176, 178, + 176, 176, 179, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 178, 176, 179, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 0, 176, 176, 176 + } ; + +static yyconst short int yy_nxt[245] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 7, 15, 16, 17, 18, 19, 7, 20, 7, + 7, 21, 7, 22, 23, 7, 7, 24, 7, 7, + 25, 7, 26, 27, 28, 29, 30, 7, 31, 7, + 7, 32, 7, 33, 34, 7, 7, 35, 7, 7, + 41, 43, 45, 55, 44, 42, 57, 59, 56, 58, + 46, 96, 97, 110, 111, 60, 37, 36, 37, 39, + 175, 39, 174, 173, 172, 171, 170, 169, 168, 167, + 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + + 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, + 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, + 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, + 116, 115, 114, 113, 112, 109, 108, 107, 106, 105, + 104, 103, 102, 101, 100, 99, 98, 95, 94, 93, + 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, + 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, + 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, + 62, 61, 54, 53, 52, 51, 50, 49, 48, 47, + 40, 38, 176, 3, 176, 176, 176, 176, 176, 176, + + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176 + } ; + +static yyconst short int yy_chk[245] = + { 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, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 15, 16, 17, 26, 16, 15, 27, 28, 26, 27, + 17, 68, 68, 82, 82, 28, 178, 177, 178, 179, + 173, 179, 172, 167, 162, 161, 160, 159, 158, 157, + 152, 151, 150, 149, 148, 143, 142, 141, 140, 139, + 138, 137, 135, 134, 133, 132, 131, 130, 129, 128, + + 127, 125, 124, 123, 121, 117, 116, 115, 114, 113, + 112, 111, 110, 109, 107, 103, 102, 101, 100, 99, + 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, + 88, 86, 85, 84, 83, 81, 80, 79, 78, 77, + 76, 75, 74, 72, 71, 70, 69, 67, 66, 65, + 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, + 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, + 44, 43, 42, 41, 40, 35, 34, 33, 32, 31, + 30, 29, 25, 24, 23, 22, 21, 20, 19, 18, + 14, 11, 3, 176, 176, 176, 176, 176, 176, 176, + + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_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 yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "arlex.l" +#define INITIAL 0 +#line 2 "arlex.l" +/* arlex.l - Strange script language lexer */ + +/* Copyright (C) 1992, 95, 1997 Free Software Foundation, Inc. + +This file is part of GNU Binutils. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* Contributed by Steve Chamberlain + sac@cygnus.com + +*/ +#define DONTDECLARE_MALLOC +#include <ansidecl.h> +#include "libiberty.h" +#include "arparse.h" + +int linenumber; +#line 505 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#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 YY_READ_BUF_SIZE +#define YY_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( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 38 "arlex.l" + + +#line 659 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 177 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 194 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 40 "arlex.l" +{ return ADDLIB; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 41 "arlex.l" +{ return ADDMOD; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 42 "arlex.l" +{ return CLEAR; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 43 "arlex.l" +{ return CREATE; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 44 "arlex.l" +{ return DELETE; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 45 "arlex.l" +{ return DIRECTORY; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 46 "arlex.l" +{ return END; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 47 "arlex.l" +{ return EXTRACT; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 48 "arlex.l" +{ return FULLDIR; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 49 "arlex.l" +{ return HELP; } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 50 "arlex.l" +{ return LIST; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 51 "arlex.l" +{ return OPEN; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 52 "arlex.l" +{ return REPLACE; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 53 "arlex.l" +{ return VERBOSE; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 54 "arlex.l" +{ return SAVE; } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 55 "arlex.l" +{ return ADDLIB; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 56 "arlex.l" +{ return ADDMOD; } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 57 "arlex.l" +{ return CLEAR; } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 58 "arlex.l" +{ return CREATE; } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 59 "arlex.l" +{ return DELETE; } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 60 "arlex.l" +{ return DIRECTORY; } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 61 "arlex.l" +{ return END; } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 62 "arlex.l" +{ return EXTRACT; } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 63 "arlex.l" +{ return FULLDIR; } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 64 "arlex.l" +{ return HELP; } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 65 "arlex.l" +{ return LIST; } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 66 "arlex.l" +{ return OPEN; } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 67 "arlex.l" +{ return REPLACE; } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 68 "arlex.l" +{ return VERBOSE; } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 69 "arlex.l" +{ return SAVE; } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 70 "arlex.l" +{ linenumber ++; } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 71 "arlex.l" +{ return '('; } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 72 "arlex.l" +{ return ')'; } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 73 "arlex.l" +{ return ','; } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 74 "arlex.l" +{ + yylval.name = xstrdup (yytext); + return FILENAME; + } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 78 "arlex.l" +{ } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 79 "arlex.l" +{ } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 80 "arlex.l" +{ } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 81 "arlex.l" +{ linenumber ++; return NEWLINE; } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 83 "arlex.l" +ECHO; + YY_BREAK +#line 945 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_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. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_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). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_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 yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_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) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 177 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 177 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 176); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_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 YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 83 "arlex.l" + +#ifndef yywrap +/* Needed for lex, though not flex. */ +int yywrap() { return 1; } +#endif diff --git a/binutils/arparse.c b/binutils/arparse.c new file mode 100644 index 0000000..23d6565 --- /dev/null +++ b/binutils/arparse.c @@ -0,0 +1,1090 @@ + +/* A Bison parser, made from arparse.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define NEWLINE 257 +#define VERBOSE 258 +#define FILENAME 259 +#define ADDLIB 260 +#define LIST 261 +#define ADDMOD 262 +#define CLEAR 263 +#define CREATE 264 +#define DELETE 265 +#define DIRECTORY 266 +#define END 267 +#define EXTRACT 268 +#define FULLDIR 269 +#define HELP 270 +#define QUIT 271 +#define REPLACE 272 +#define SAVE 273 +#define OPEN 274 + +#line 1 "arparse.y" + +/* arparse.y - Stange script language parser */ + +/* Copyright (C) 1992, 93, 95, 97, 98, 1999 Free Software Foundation, Inc. + +This file is part of GNU Binutils. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* Contributed by Steve Chamberlain + sac@cygnus.com + +*/ +#define DONTDECLARE_MALLOC +#include "bfd.h" +#include "bucomm.h" +#include "arsup.h" +extern int verbose; +extern int yylex PARAMS ((void)); +static int yyerror PARAMS ((const char *)); + +#line 36 "arparse.y" +typedef union { + char *name; +struct list *list ; + +} YYSTYPE; +#include <stdio.h> + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 53 +#define YYFLAG -32768 +#define YYNTBASE 24 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 274 ? yytranslate[x] : 45) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, + 22, 2, 2, 23, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 1, 4, 7, 8, 11, 13, 15, 17, 19, + 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, + 41, 42, 45, 48, 50, 53, 56, 58, 60, 63, + 66, 70, 75, 77, 78, 82, 83, 87, 88, 90, + 91 +}; + +static const short yyrhs[] = { -1, + 25, 26, 0, 26, 27, 0, 0, 28, 3, 0, + 36, 0, 37, 0, 44, 0, 39, 0, 38, 0, + 31, 0, 33, 0, 35, 0, 29, 0, 30, 0, + 32, 0, 34, 0, 13, 0, 1, 0, 5, 0, + 0, 14, 42, 0, 18, 42, 0, 9, 0, 11, + 42, 0, 8, 42, 0, 7, 0, 19, 0, 20, + 5, 0, 10, 5, 0, 6, 5, 41, 0, 12, + 5, 41, 40, 0, 5, 0, 0, 21, 42, 22, + 0, 0, 42, 43, 5, 0, 0, 23, 0, 0, + 4, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 66, 68, 70, 72, 75, 78, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 98, 103, 108, 113, 117, 122, 127, 134, 139, + 145, 149, 156, 159, 162, 165, 169, 176, 180, 182, + 186 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","NEWLINE", +"VERBOSE","FILENAME","ADDLIB","LIST","ADDMOD","CLEAR","CREATE","DELETE","DIRECTORY", +"END","EXTRACT","FULLDIR","HELP","QUIT","REPLACE","SAVE","OPEN","'('","')'", +"','","start","@1","session","command_line","command","extract_command","replace_command", +"clear_command","delete_command","addmod_command","list_command","save_command", +"open_command","create_command","addlib_command","directory_command","optional_filename", +"modulelist","modulename","optcomma","verbose_command", NULL +}; +#endif + +static const short yyr1[] = { 0, + 25, 24, 26, 26, 27, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 40, 41, 41, 42, 42, 43, 43, + 44 +}; + +static const short yyr2[] = { 0, + 0, 2, 2, 0, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 2, 1, 2, 2, 1, 1, 2, 2, + 3, 4, 1, 0, 3, 0, 3, 0, 1, 0, + 1 +}; + +static const short yydefact[] = { 1, + 4, 0, 19, 41, 20, 0, 27, 38, 24, 0, + 38, 0, 18, 38, 38, 28, 0, 3, 0, 14, + 15, 11, 16, 12, 17, 13, 6, 7, 10, 9, + 8, 36, 26, 30, 25, 36, 22, 23, 29, 5, + 38, 31, 39, 0, 34, 40, 37, 33, 32, 35, + 0, 0, 0 +}; + +static const short yydefgoto[] = { 51, + 1, 2, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 49, 42, 33, 44, 31 +}; + +static const short yypact[] = {-32768, +-32768, 5,-32768,-32768,-32768, -4,-32768,-32768,-32768, 2, +-32768, 21,-32768,-32768,-32768,-32768, 22,-32768, 25,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 8, -3,-32768, -3, 8, -3, -3,-32768,-32768, +-32768,-32768,-32768, 26, 27, -1,-32768,-32768,-32768,-32768, + 33, 34,-32768 +}; + +static const short yypgoto[] = {-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 0, -11,-32768,-32768 +}; + + +#define YYLAST 36 + + +static const short yytable[] = { 35, + 32, -40, 37, 38, -2, 3, 34, -21, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 43, + 50, 43, 15, 16, 17, 36, 39, 40, 41, 46, + 47, 48, 52, 53, 0, 45 +}; + +static const short yycheck[] = { 11, + 5, 5, 14, 15, 0, 1, 5, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, + 22, 23, 18, 19, 20, 5, 5, 3, 21, 41, + 5, 5, 0, 0, -1, 36 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/misc/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include <alloca.h> +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include <malloc.h> +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include <malloc.h> */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/misc/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 1: +#line 67 "arparse.y" +{ prompt(); ; + break;} +case 5: +#line 76 "arparse.y" +{ prompt(); ; + break;} +case 18: +#line 91 "arparse.y" +{ ar_end(); return 0; ; + break;} +case 20: +#line 93 "arparse.y" +{ yyerror("foo"); ; + break;} +case 22: +#line 100 "arparse.y" +{ ar_extract(yyvsp[0].list); ; + break;} +case 23: +#line 105 "arparse.y" +{ ar_replace(yyvsp[0].list); ; + break;} +case 24: +#line 110 "arparse.y" +{ ar_clear(); ; + break;} +case 25: +#line 115 "arparse.y" +{ ar_delete(yyvsp[0].list); ; + break;} +case 26: +#line 119 "arparse.y" +{ ar_addmod(yyvsp[0].list); ; + break;} +case 27: +#line 124 "arparse.y" +{ ar_list(); ; + break;} +case 28: +#line 129 "arparse.y" +{ ar_save(); ; + break;} +case 29: +#line 136 "arparse.y" +{ ar_open(yyvsp[0].name,0); ; + break;} +case 30: +#line 141 "arparse.y" +{ ar_open(yyvsp[0].name,1); ; + break;} +case 31: +#line 147 "arparse.y" +{ ar_addlib(yyvsp[-1].name,yyvsp[0].list); ; + break;} +case 32: +#line 151 "arparse.y" +{ ar_directory(yyvsp[-2].name, yyvsp[-1].list, yyvsp[0].name); ; + break;} +case 33: +#line 158 "arparse.y" +{ yyval.name = yyvsp[0].name; ; + break;} +case 34: +#line 159 "arparse.y" +{ yyval.name = 0; ; + break;} +case 35: +#line 164 "arparse.y" +{ yyval.list = yyvsp[-1].list; ; + break;} +case 36: +#line 166 "arparse.y" +{ yyval.list = 0; ; + break;} +case 37: +#line 171 "arparse.y" +{ struct list *n = (struct list *) malloc(sizeof(struct list)); + n->next = yyvsp[-2].list; + n->name = yyvsp[0].name; + yyval.list = n; + ; + break;} +case 38: +#line 176 "arparse.y" +{ yyval.list = 0; ; + break;} +case 41: +#line 188 "arparse.y" +{ verbose = !verbose; ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/misc/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 192 "arparse.y" + + +static int +yyerror (x) + const char *x ATTRIBUTE_UNUSED; +{ + extern int linenumber; + + printf (_("Syntax error in archive script, line %d\n"), linenumber + 1); + return 0; +} diff --git a/binutils/arparse.h b/binutils/arparse.h new file mode 100644 index 0000000..9604537 --- /dev/null +++ b/binutils/arparse.h @@ -0,0 +1,26 @@ +typedef union { + char *name; +struct list *list ; + +} YYSTYPE; +#define NEWLINE 257 +#define VERBOSE 258 +#define FILENAME 259 +#define ADDLIB 260 +#define LIST 261 +#define ADDMOD 262 +#define CLEAR 263 +#define CREATE 264 +#define DELETE 265 +#define DIRECTORY 266 +#define END 267 +#define EXTRACT 268 +#define FULLDIR 269 +#define HELP 270 +#define QUIT 271 +#define REPLACE 272 +#define SAVE 273 +#define OPEN 274 + + +extern YYSTYPE yylval; diff --git a/binutils/binutils.info b/binutils/binutils.info new file mode 100644 index 0000000..3a6fcb2 --- /dev/null +++ b/binutils/binutils.info @@ -0,0 +1,69 @@ +This is binutils.info, produced by makeinfo version 4.0 from +binutils.texi. + +START-INFO-DIR-ENTRY +* Binutils: (binutils). The GNU binary utilities. +* ar: (binutils)ar. Create, modify, and extract from archives +* nm: (binutils)nm. List symbols from object files +* objcopy: (binutils)objcopy. Copy and translate object files +* objdump: (binutils)objdump. Display information from object files +* ranlib: (binutils)ranlib. Generate index to archive contents +* readelf: (binutils)readelf. Display the contents of ELF format files. +* size: (binutils)size. List section sizes and total size +* strings: (binutils)strings. List printable strings from files +* strip: (binutils)strip. Discard symbols +* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols +* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt +* addr2line: (binutils)addr2line. Convert addresses to file and line +* nlmconv: (binutils)nlmconv. Converts object code into an NLM +* windres: (binutils)windres. Manipulate Windows resources +* dlltool: (binutils)dlltool. Create files needed to build and use DLLs +END-INFO-DIR-ENTRY + + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". + + +Indirect: +binutils.info-1: 1680 +binutils.info-2: 51587 +binutils.info-3: 99087 + +Tag Table: +(Indirect) +Node: Top1680 +Node: ar3180 +Node: ar cmdline5354 +Node: ar scripts13482 +Node: nm19161 +Node: objcopy26579 +Node: objdump40220 +Node: ranlib50838 +Node: size51587 +Node: strings54318 +Node: strip56143 +Node: c++filt59108 +Ref: c++filt-Footnote-162045 +Node: addr2line62151 +Node: nlmconv64746 +Node: windres67350 +Node: dlltool72402 +Node: readelf81743 +Node: Selecting The Target System84911 +Node: Target Selection85928 +Node: Architecture Selection88629 +Node: Linker Emulation Selection89860 +Node: Reporting Bugs90738 +Node: Bug Criteria91514 +Node: Bug Reporting92060 +Node: GNU Free Documentation License99087 +Node: Index117515 + +End Tag Table diff --git a/binutils/binutils.info-1 b/binutils/binutils.info-1 new file mode 100644 index 0000000..15c9197 --- /dev/null +++ b/binutils/binutils.info-1 @@ -0,0 +1,1310 @@ +This is binutils.info, produced by makeinfo version 4.0 from +binutils.texi. + +START-INFO-DIR-ENTRY +* Binutils: (binutils). The GNU binary utilities. +* ar: (binutils)ar. Create, modify, and extract from archives +* nm: (binutils)nm. List symbols from object files +* objcopy: (binutils)objcopy. Copy and translate object files +* objdump: (binutils)objdump. Display information from object files +* ranlib: (binutils)ranlib. Generate index to archive contents +* readelf: (binutils)readelf. Display the contents of ELF format files. +* size: (binutils)size. List section sizes and total size +* strings: (binutils)strings. List printable strings from files +* strip: (binutils)strip. Discard symbols +* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols +* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt +* addr2line: (binutils)addr2line. Convert addresses to file and line +* nlmconv: (binutils)nlmconv. Converts object code into an NLM +* windres: (binutils)windres. Manipulate Windows resources +* dlltool: (binutils)dlltool. Create files needed to build and use DLLs +END-INFO-DIR-ENTRY + + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". + + +File: binutils.info, Node: Top, Next: ar, Up: (dir) + +Introduction +************ + + This brief manual contains preliminary documentation for the GNU +binary utilities (collectively version 2.10.91): + + This document is distributed under the terms of the GNU Free +Documentation License. A copy of the license is included in the +section entitled "GNU Free Documentation License". + +* Menu: + +* ar:: Create, modify, and extract from archives +* nm:: List symbols from object files +* objcopy:: Copy and translate object files +* objdump:: Display information from object files +* ranlib:: Generate index to archive contents +* readelf:: Display the contents of ELF format files. +* size:: List section sizes and total size +* strings:: List printable strings from files +* strip:: Discard symbols +* c++filt:: Filter to demangle encoded C++ symbols +* cxxfilt: c++filt. MS-DOS name for c++filt +* addr2line:: Convert addresses to file and line +* nlmconv:: Converts object code into an NLM +* windres:: Manipulate Windows resources +* dlltool:: Create files needed to build and use DLLs +* Selecting The Target System:: How these utilities determine the target. +* Reporting Bugs:: Reporting Bugs +* GNU Free Documentation License:: GNU Free Documentation License +* Index:: Index + + +File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top + +ar +** + + ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] + ar -M [ <mri-script ] + + The GNU `ar' program creates, modifies, and extracts from archives. +An "archive" is a single file holding a collection of other files in a +structure that makes it possible to retrieve the original individual +files (called "members" of the archive). + + The original files' contents, mode (permissions), timestamp, owner, +and group are preserved in the archive, and can be restored on +extraction. + + GNU `ar' can maintain archives whose members have names of any +length; however, depending on how `ar' is configured on your system, a +limit on member-name length may be imposed for compatibility with +archive formats maintained with other tools. If it exists, the limit +is often 15 characters (typical of formats related to a.out) or 16 +characters (typical of formats related to coff). + + `ar' is considered a binary utility because archives of this sort +are most often used as "libraries" holding commonly needed subroutines. + + `ar' creates an index to the symbols defined in relocatable object +modules in the archive when you specify the modifier `s'. Once +created, this index is updated in the archive whenever `ar' makes a +change to its contents (save for the `q' update operation). An archive +with such an index speeds up linking to the library, and allows +routines in the library to call each other without regard to their +placement in the archive. + + You may use `nm -s' or `nm --print-armap' to list this index table. +If an archive lacks the table, another form of `ar' called `ranlib' can +be used to add just the table. + + GNU `ar' is designed to be compatible with two different facilities. +You can control its activity using command-line options, like the +different varieties of `ar' on Unix systems; or, if you specify the +single command-line option `-M', you can control it with a script +supplied via standard input, like the MRI "librarian" program. + +* Menu: + +* ar cmdline:: Controlling `ar' on the command line +* ar scripts:: Controlling `ar' with a script + + +File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar + +Controlling `ar' on the command line +==================================== + + ar [-X32_64] [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] + + When you use `ar' in the Unix style, `ar' insists on at least two +arguments to execute: one keyletter specifying the _operation_ +(optionally accompanied by other keyletters specifying _modifiers_), +and the archive name to act on. + + Most operations can also accept further MEMBER arguments, specifying +particular files to operate on. + + GNU `ar' allows you to mix the operation code P and modifier flags +MOD in any order, within the first command-line argument. + + If you wish, you may begin the first command-line argument with a +dash. + + The P keyletter specifies what operation to execute; it may be any +of the following, but you must specify only one of them: + +`d' + _Delete_ modules from the archive. Specify the names of modules to + be deleted as MEMBER...; the archive is untouched if you specify + no files to delete. + + If you specify the `v' modifier, `ar' lists each module as it is + deleted. + +`m' + Use this operation to _move_ members in an archive. + + The ordering of members in an archive can make a difference in how + programs are linked using the library, if a symbol is defined in + more than one member. + + If no modifiers are used with `m', any members you name in the + MEMBER arguments are moved to the _end_ of the archive; you can + use the `a', `b', or `i' modifiers to move them to a specified + place instead. + +`p' + _Print_ the specified members of the archive, to the standard + output file. If the `v' modifier is specified, show the member + name before copying its contents to standard output. + + If you specify no MEMBER arguments, all the files in the archive + are printed. + +`q' + _Quick append_; Historically, add the files MEMBER... to the end of + ARCHIVE, without checking for replacement. + + The modifiers `a', `b', and `i' do _not_ affect this operation; + new members are always placed at the end of the archive. + + The modifier `v' makes `ar' list each file as it is appended. + + Since the point of this operation is speed, the archive's symbol + table index is not updated, even if it already existed; you can + use `ar s' or `ranlib' explicitly to update the symbol table index. + + However, too many different systems assume quick append rebuilds + the index, so GNU ar implements `q' as a synonym for `r'. + +`r' + Insert the files MEMBER... into ARCHIVE (with _replacement_). This + operation differs from `q' in that any previously existing members + are deleted if their names match those being added. + + If one of the files named in MEMBER... does not exist, `ar' + displays an error message, and leaves undisturbed any existing + members of the archive matching that name. + + By default, new members are added at the end of the file; but you + may use one of the modifiers `a', `b', or `i' to request placement + relative to some existing member. + + The modifier `v' used with this operation elicits a line of output + for each file inserted, along with one of the letters `a' or `r' + to indicate whether the file was appended (no old member deleted) + or replaced. + +`t' + Display a _table_ listing the contents of ARCHIVE, or those of the + files listed in MEMBER... that are present in the archive. + Normally only the member name is shown; if you also want to see + the modes (permissions), timestamp, owner, group, and size, you can + request that by also specifying the `v' modifier. + + If you do not specify a MEMBER, all files in the archive are + listed. + + If there is more than one file with the same name (say, `fie') in + an archive (say `b.a'), `ar t b.a fie' lists only the first + instance; to see them all, you must ask for a complete listing--in + our example, `ar t b.a'. + +`x' + _Extract_ members (named MEMBER) from the archive. You can use + the `v' modifier with this operation, to request that `ar' list + each name as it extracts it. + + If you do not specify a MEMBER, all files in the archive are + extracted. + + A number of modifiers (MOD) may immediately follow the P keyletter, +to specify variations on an operation's behavior: + +`a' + Add new files _after_ an existing member of the archive. If you + use the modifier `a', the name of an existing archive member must + be present as the RELPOS argument, before the ARCHIVE + specification. + +`b' + Add new files _before_ an existing member of the archive. If you + use the modifier `b', the name of an existing archive member must + be present as the RELPOS argument, before the ARCHIVE + specification. (same as `i'). + +`c' + _Create_ the archive. The specified ARCHIVE is always created if + it did not exist, when you request an update. But a warning is + issued unless you specify in advance that you expect to create it, + by using this modifier. + +`f' + Truncate names in the archive. GNU `ar' will normally permit file + names of any length. This will cause it to create archives which + are not compatible with the native `ar' program on some systems. + If this is a concern, the `f' modifier may be used to truncate file + names when putting them in the archive. + +`i' + Insert new files _before_ an existing member of the archive. If + you use the modifier `i', the name of an existing archive member + must be present as the RELPOS argument, before the ARCHIVE + specification. (same as `b'). + +`l' + This modifier is accepted but not used. + +`N' + Uses the COUNT parameter. This is used if there are multiple + entries in the archive with the same name. Extract or delete + instance COUNT of the given name from the archive. + +`o' + Preserve the _original_ dates of members when extracting them. If + you do not specify this modifier, files extracted from the archive + are stamped with the time of extraction. + +`P' + Use the full path name when matching names in the archive. GNU + `ar' can not create an archive with a full path name (such archives + are not POSIX complaint), but other archive creators can. This + option will cause GNU `ar' to match file names using a complete + path name, which can be convenient when extracting a single file + from an archive created by another tool. + +`s' + Write an object-file index into the archive, or update an existing + one, even if no other change is made to the archive. You may use + this modifier flag either with any operation, or alone. Running + `ar s' on an archive is equivalent to running `ranlib' on it. + +`S' + Do not generate an archive symbol table. This can speed up + building a large library in several steps. The resulting archive + can not be used with the linker. In order to build a symbol + table, you must omit the `S' modifier on the last execution of + `ar', or you must run `ranlib' on the archive. + +`u' + Normally, `ar r'... inserts all files listed into the archive. If + you would like to insert _only_ those of the files you list that + are newer than existing members of the same names, use this + modifier. The `u' modifier is allowed only for the operation `r' + (replace). In particular, the combination `qu' is not allowed, + since checking the timestamps would lose any speed advantage from + the operation `q'. + +`v' + This modifier requests the _verbose_ version of an operation. Many + operations display additional information, such as filenames + processed, when the modifier `v' is appended. + +`V' + This modifier shows the version number of `ar'. + + `ar' ignores an initial option spelt `-X32_64', for compatibility +with AIX. The behaviour produced by this option is the default for GNU +`ar'. `ar' does not support any of the other `-X' options; in +particular, it does not support `-X32' which is the default for AIX +`ar'. + + +File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar + +Controlling `ar' with a script +============================== + + ar -M [ <SCRIPT ] + + If you use the single command-line option `-M' with `ar', you can +control its operation with a rudimentary command language. This form +of `ar' operates interactively if standard input is coming directly +from a terminal. During interactive use, `ar' prompts for input (the +prompt is `AR >'), and continues executing even after errors. If you +redirect standard input to a script file, no prompts are issued, and +`ar' abandons execution (with a nonzero exit code) on any error. + + The `ar' command language is _not_ designed to be equivalent to the +command-line options; in fact, it provides somewhat less control over +archives. The only purpose of the command language is to ease the +transition to GNU `ar' for developers who already have scripts written +for the MRI "librarian" program. + + The syntax for the `ar' command language is straightforward: + * commands are recognized in upper or lower case; for example, `LIST' + is the same as `list'. In the following descriptions, commands are + shown in upper case for clarity. + + * a single command may appear on each line; it is the first word on + the line. + + * empty lines are allowed, and have no effect. + + * comments are allowed; text after either of the characters `*' or + `;' is ignored. + + * Whenever you use a list of names as part of the argument to an `ar' + command, you can separate the individual names with either commas + or blanks. Commas are shown in the explanations below, for + clarity. + + * `+' is used as a line continuation character; if `+' appears at + the end of a line, the text on the following line is considered + part of the current command. + + Here are the commands you can use in `ar' scripts, or when using +`ar' interactively. Three of them have special significance: + + `OPEN' or `CREATE' specify a "current archive", which is a temporary +file required for most of the other commands. + + `SAVE' commits the changes so far specified by the script. Prior to +`SAVE', commands affect only the temporary copy of the current archive. + +`ADDLIB ARCHIVE' +`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)' + Add all the contents of ARCHIVE (or, if specified, each named + MODULE from ARCHIVE) to the current archive. + + Requires prior use of `OPEN' or `CREATE'. + +`ADDMOD MEMBER, MEMBER, ... MEMBER' + Add each named MEMBER as a module in the current archive. + + Requires prior use of `OPEN' or `CREATE'. + +`CLEAR' + Discard the contents of the current archive, canceling the effect + of any operations since the last `SAVE'. May be executed (with no + effect) even if no current archive is specified. + +`CREATE ARCHIVE' + Creates an archive, and makes it the current archive (required for + many other commands). The new archive is created with a temporary + name; it is not actually saved as ARCHIVE until you use `SAVE'. + You can overwrite existing archives; similarly, the contents of any + existing file named ARCHIVE will not be destroyed until `SAVE'. + +`DELETE MODULE, MODULE, ... MODULE' + Delete each listed MODULE from the current archive; equivalent to + `ar -d ARCHIVE MODULE ... MODULE'. + + Requires prior use of `OPEN' or `CREATE'. + +`DIRECTORY ARCHIVE (MODULE, ... MODULE)' +`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE' + List each named MODULE present in ARCHIVE. The separate command + `VERBOSE' specifies the form of the output: when verbose output is + off, output is like that of `ar -t ARCHIVE MODULE...'. When + verbose output is on, the listing is like `ar -tv ARCHIVE + MODULE...'. + + Output normally goes to the standard output stream; however, if you + specify OUTPUTFILE as a final argument, `ar' directs the output to + that file. + +`END' + Exit from `ar', with a `0' exit code to indicate successful + completion. This command does not save the output file; if you + have changed the current archive since the last `SAVE' command, + those changes are lost. + +`EXTRACT MODULE, MODULE, ... MODULE' + Extract each named MODULE from the current archive, writing them + into the current directory as separate files. Equivalent to `ar -x + ARCHIVE MODULE...'. + + Requires prior use of `OPEN' or `CREATE'. + +`LIST' + Display full contents of the current archive, in "verbose" style + regardless of the state of `VERBOSE'. The effect is like `ar tv + ARCHIVE'. (This single command is a GNU `ar' enhancement, rather + than present for MRI compatibility.) + + Requires prior use of `OPEN' or `CREATE'. + +`OPEN ARCHIVE' + Opens an existing archive for use as the current archive (required + for many other commands). Any changes as the result of subsequent + commands will not actually affect ARCHIVE until you next use + `SAVE'. + +`REPLACE MODULE, MODULE, ... MODULE' + In the current archive, replace each existing MODULE (named in the + `REPLACE' arguments) from files in the current working directory. + To execute this command without errors, both the file, and the + module in the current archive, must exist. + + Requires prior use of `OPEN' or `CREATE'. + +`VERBOSE' + Toggle an internal flag governing the output from `DIRECTORY'. + When the flag is on, `DIRECTORY' output matches output from `ar + -tv '.... + +`SAVE' + Commit your changes to the current archive, and actually save it + as a file with the name specified in the last `CREATE' or `OPEN' + command. + + Requires prior use of `OPEN' or `CREATE'. + + +File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top + +nm +** + + nm [ -a | --debug-syms ] [ -g | --extern-only ] + [ -B ] [ -C | --demangle[=STYLE] ] [ -D | --dynamic ] + [ -s | --print-armap ] [ -A | -o | --print-file-name ] + [ -n | -v | --numeric-sort ] [ -p | --no-sort ] + [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] + [ -t RADIX | --radix=RADIX ] [ -P | --portability ] + [ --target=BFDNAME ] [ -f FORMAT | --format=FORMAT ] + [ --defined-only ] [-l | --line-numbers ] [ --no-demangle ] + [ -V | --version ] [ -X 32_64 ] [ --help ] [ OBJFILE... ] + + GNU `nm' lists the symbols from object files OBJFILE.... If no +object files are listed as arguments, `nm' assumes the file `a.out'. + + For each symbol, `nm' shows: + + * The symbol value, in the radix selected by options (see below), or + hexadecimal by default. + + * The symbol type. At least the following types are used; others + are, as well, depending on the object file format. If lowercase, + the symbol is local; if uppercase, the symbol is global (external). + + `A' + The symbol's value is absolute, and will not be changed by + further linking. + + `B' + The symbol is in the uninitialized data section (known as + BSS). + + `C' + The symbol is common. Common symbols are uninitialized data. + When linking, multiple common symbols may appear with the + same name. If the symbol is defined anywhere, the common + symbols are treated as undefined references. For more + details on common symbols, see the discussion of -warn-common + in *Note Linker options: (ld.info)Options. + + `D' + The symbol is in the initialized data section. + + `G' + The symbol is in an initialized data section for small + objects. Some object file formats permit more efficient + access to small data objects, such as a global int variable + as opposed to a large global array. + + `I' + The symbol is an indirect reference to another symbol. This + is a GNU extension to the a.out object file format which is + rarely used. + + `N' + The symbol is a debugging symbol. + + `R' + The symbol is in a read only data section. + + `S' + The symbol is in an uninitialized data section for small + objects. + + `T' + The symbol is in the text (code) section. + + `U' + The symbol is undefined. + + `V' + The symbol is a weak object. When a weak defined symbol is + linked with a normal defined symbol, the normal defined + symbol is used with no error. When a weak undefined symbol + is linked and the symbol is not defined, the value of the + weak symbol becomes zero with no error. + + `W' + The symbol is a weak symbol that has not been specifically + tagged as a weak object symbol. When a weak defined symbol + is linked with a normal defined symbol, the normal defined + symbol is used with no error. When a weak undefined symbol + is linked and the symbol is not defined, the value of the + weak symbol becomes zero with no error. + + `-' + The symbol is a stabs symbol in an a.out object file. In + this case, the next values printed are the stabs other field, + the stabs desc field, and the stab type. Stabs symbols are + used to hold debugging information; for more information, see + *Note Stabs: (stabs.info)Top. + + `?' + The symbol type is unknown, or object file format specific. + + * The symbol name. + + The long and short forms of options, shown here as alternatives, are +equivalent. + +`-A' +`-o' +`--print-file-name' + Precede each symbol by the name of the input file (or archive + member) in which it was found, rather than identifying the input + file once only, before all of its symbols. + +`-a' +`--debug-syms' + Display all symbols, even debugger-only symbols; normally these + are not listed. + +`-B' + The same as `--format=bsd' (for compatibility with the MIPS `nm'). + +`-C' +`--demangle[=STYLE]' + Decode ("demangle") low-level symbol names into user-level names. + Besides removing any initial underscore prepended by the system, + this makes C++ function names readable. Different compilers have + different mangling styles. The optional demangling style argument + can be used to choose an appropriate demangling style for your + compiler. *Note c++filt::, for more information on demangling. + +`--no-demangle' + Do not demangle low-level symbol names. This is the default. + +`-D' +`--dynamic' + Display the dynamic symbols rather than the normal symbols. This + is only meaningful for dynamic objects, such as certain types of + shared libraries. + +`-f FORMAT' +`--format=FORMAT' + Use the output format FORMAT, which can be `bsd', `sysv', or + `posix'. The default is `bsd'. Only the first character of + FORMAT is significant; it can be either upper or lower case. + +`-g' +`--extern-only' + Display only external symbols. + +`-l' +`--line-numbers' + For each symbol, use debugging information to try to find a + filename and line number. For a defined symbol, look for the line + number of the address of the symbol. For an undefined symbol, + look for the line number of a relocation entry which refers to the + symbol. If line number information can be found, print it after + the other symbol information. + +`-n' +`-v' +`--numeric-sort' + Sort symbols numerically by their addresses, rather than + alphabetically by their names. + +`-p' +`--no-sort' + Do not bother to sort the symbols in any order; print them in the + order encountered. + +`-P' +`--portability' + Use the POSIX.2 standard output format instead of the default + format. Equivalent to `-f posix'. + +`-s' +`--print-armap' + When listing symbols from archive members, include the index: a + mapping (stored in the archive by `ar' or `ranlib') of which + modules contain definitions for which names. + +`-r' +`--reverse-sort' + Reverse the order of the sort (whether numeric or alphabetic); let + the last come first. + +`--size-sort' + Sort symbols by size. The size is computed as the difference + between the value of the symbol and the value of the symbol with + the next higher value. The size of the symbol is printed, rather + than the value. + +`-t RADIX' +`--radix=RADIX' + Use RADIX as the radix for printing the symbol values. It must be + `d' for decimal, `o' for octal, or `x' for hexadecimal. + +`--target=BFDNAME' + Specify an object code format other than your system's default + format. *Note Target Selection::, for more information. + +`-u' +`--undefined-only' + Display only undefined symbols (those external to each object + file). + +`--defined-only' + Display only defined symbols for each object file. + +`-V' +`--version' + Show the version number of `nm' and exit. + +`-X' + This option is ignored for compatibility with the AIX version of + `nm'. It takes one parameter which must be the string `32_64'. + The default mode of AIX `nm' corresponds to `-X 32', which is not + supported by GNU `nm'. + +`--help' + Show a summary of the options to `nm' and exit. + + +File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top + +objcopy +******* + + objcopy [ -F BFDNAME | --target=BFDNAME ] + [ -I BFDNAME | --input-target=BFDNAME ] + [ -O BFDNAME | --output-target=BFDNAME ] + [ -S | --strip-all ] [ -g | --strip-debug ] + [ -K SYMBOLNAME | --keep-symbol=SYMBOLNAME ] + [ -N SYMBOLNAME | --strip-symbol=SYMBOLNAME ] + [ -L SYMBOLNAME | --localize-symbol=SYMBOLNAME ] + [ -W SYMBOLNAME | --weaken-symbol=SYMBOLNAME ] + [ -x | --discard-all ] [ -X | --discard-locals ] + [ -b BYTE | --byte=BYTE ] + [ -i INTERLEAVE | --interleave=INTERLEAVE ] + [ -j SECTIONNAME | --only-section=SECTIONNAME ] + [ -R SECTIONNAME | --remove-section=SECTIONNAME ] + [ -p | --preserve-dates ] [ --debugging ] + [ --gap-fill=VAL ] [ --pad-to=ADDRESS ] + [ --set-start=VAL ] [ --adjust-start=INCR ] + [ --change-addresses=INCR ] + [ --change-section-address SECTION{=,+,-}VAL ] + [ --change-section-lma SECTION{=,+,-}VAL ] + [ --change-section-vma SECTION{=,+,-}VAL ] + [ --change-warnings ] [ --no-change-warnings ] + [ --set-section-flags SECTION=FLAGS ] + [ --add-section SECTIONNAME=FILENAME ] + [ --change-leading-char ] [ --remove-leading-char ] + [ --srec-len=IVAL ] [ --srec-forceS3 ] + [ --redefine-sym OLD=NEW ] [ --weaken ] + [ -v | --verbose ] [ -V | --version ] [ --help ] + INFILE [OUTFILE] + + The GNU `objcopy' utility copies the contents of an object file to +another. `objcopy' uses the GNU BFD Library to read and write the +object files. It can write the destination object file in a format +different from that of the source object file. The exact behavior of +`objcopy' is controlled by command-line options. Note that `objcopy' +should be able to copy a fully linked file between any two formats. +However, copying a relocatable object file between any two formats may +not work as expected. + + `objcopy' creates temporary files to do its translations and deletes +them afterward. `objcopy' uses BFD to do all its translation work; it +has access to all the formats described in BFD and thus is able to +recognize most formats without being told explicitly. *Note BFD: +(ld.info)BFD. + + `objcopy' can be used to generate S-records by using an output +target of `srec' (e.g., use `-O srec'). + + `objcopy' can be used to generate a raw binary file by using an +output target of `binary' (e.g., use `-O binary'). When `objcopy' +generates a raw binary file, it will essentially produce a memory dump +of the contents of the input object file. All symbols and relocation +information will be discarded. The memory dump will start at the load +address of the lowest section copied into the output file. + + When generating an S-record or a raw binary file, it may be helpful +to use `-S' to remove sections containing debugging information. In +some cases `-R' will be useful to remove sections which contain +information that is not needed by the binary file. + + Note - `objcopy' is not able to change the endianness of its input +files. If the input format has an endianness, (some formats do not), +`objcopy' can only copy the inputs into file formats that have the same +endianness or which have no endianness (eg `srec'). + +`INFILE' +`OUTFILE' + The input and output files, respectively. If you do not specify + OUTFILE, `objcopy' creates a temporary file and destructively + renames the result with the name of INFILE. + +`-I BFDNAME' +`--input-target=BFDNAME' + Consider the source file's object format to be BFDNAME, rather than + attempting to deduce it. *Note Target Selection::, for more + information. + +`-O BFDNAME' +`--output-target=BFDNAME' + Write the output file using the object format BFDNAME. *Note + Target Selection::, for more information. + +`-F BFDNAME' +`--target=BFDNAME' + Use BFDNAME as the object format for both the input and the output + file; i.e., simply transfer data from source to destination with no + translation. *Note Target Selection::, for more information. + +`-j SECTIONNAME' +`--only-section=SECTIONNAME' + Copy only the named section from the input file to the output file. + This option may be given more than once. Note that using this + option inappropriately may make the output file unusable. + +`-R SECTIONNAME' +`--remove-section=SECTIONNAME' + Remove any section named SECTIONNAME from the output file. This + option may be given more than once. Note that using this option + inappropriately may make the output file unusable. + +`-S' +`--strip-all' + Do not copy relocation and symbol information from the source file. + +`-g' +`--strip-debug' + Do not copy debugging symbols from the source file. + +`--strip-unneeded' + Strip all symbols that are not needed for relocation processing. + +`-K SYMBOLNAME' +`--keep-symbol=SYMBOLNAME' + Copy only symbol SYMBOLNAME from the source file. This option may + be given more than once. + +`-N SYMBOLNAME' +`--strip-symbol=SYMBOLNAME' + Do not copy symbol SYMBOLNAME from the source file. This option + may be given more than once. + +`-L SYMBOLNAME' +`--localize-symbol=SYMBOLNAME' + Make symbol SYMBOLNAME local to the file, so that it is not + visible externally. This option may be given more than once. + +`-W SYMBOLNAME' +`--weaken-symbol=SYMBOLNAME' + Make symbol SYMBOLNAME weak. This option may be given more than + once. + +`-x' +`--discard-all' + Do not copy non-global symbols from the source file. + +`-X' +`--discard-locals' + Do not copy compiler-generated local symbols. (These usually + start with `L' or `.'.) + +`-b BYTE' +`--byte=BYTE' + Keep only every BYTEth byte of the input file (header data is not + affected). BYTE can be in the range from 0 to INTERLEAVE-1, where + INTERLEAVE is given by the `-i' or `--interleave' option, or the + default of 4. This option is useful for creating files to program + ROM. It is typically used with an `srec' output target. + +`-i INTERLEAVE' +`--interleave=INTERLEAVE' + Only copy one out of every INTERLEAVE bytes. Select which byte to + copy with the -B or `--byte' option. The default is 4. `objcopy' + ignores this option if you do not specify either `-b' or `--byte'. + +`-p' +`--preserve-dates' + Set the access and modification dates of the output file to be the + same as those of the input file. + +`--debugging' + Convert debugging information, if possible. This is not the + default because only certain debugging formats are supported, and + the conversion process can be time consuming. + +`--gap-fill VAL' + Fill gaps between sections with VAL. This operation applies to + the _load address_ (LMA) of the sections. It is done by increasing + the size of the section with the lower address, and filling in the + extra space created with VAL. + +`--pad-to ADDRESS' + Pad the output file up to the load address ADDRESS. This is done + by increasing the size of the last section. The extra space is + filled in with the value specified by `--gap-fill' (default zero). + +`--set-start VAL' + Set the start address of the new file to VAL. Not all object file + formats support setting the start address. + +`--change-start INCR' +`--adjust-start INCR' + Change the start address by adding INCR. Not all object file + formats support setting the start address. + +`--change-addresses INCR' +`--adjust-vma INCR' + Change the VMA and LMA addresses of all sections, as well as the + start address, by adding INCR. Some object file formats do not + permit section addresses to be changed arbitrarily. Note that + this does not relocate the sections; if the program expects + sections to be loaded at a certain address, and this option is + used to change the sections such that they are loaded at a + different address, the program may fail. + +`--change-section-address SECTION{=,+,-}VAL' +`--adjust-section-vma SECTION{=,+,-}VAL' + Set or change both the VMA address and the LMA address of the named + SECTION. If `=' is used, the section address is set to VAL. + Otherwise, VAL is added to or subtracted from the section address. + See the comments under `--change-addresses', above. If SECTION + does not exist in the input file, a warning will be issued, unless + `--no-change-warnings' is used. + +`--change-section-lma SECTION{=,+,-}VAL' + Set or change the LMA address of the named SECTION. The LMA + address is the address where the section will be loaded into + memory at program load time. Normally this is the same as the VMA + address, which is the address of the section at program run time, + but on some systems, especially those where a program is held in + ROM, the two can be different. If `=' is used, the section + address is set to VAL. Otherwise, VAL is added to or subtracted + from the section address. See the comments under + `--change-addresses', above. If SECTION does not exist in the + input file, a warning will be issued, unless + `--no-change-warnings' is used. + +`--change-section-vma SECTION{=,+,-}VAL' + Set or change the VMA address of the named SECTION. The VMA + address is the address where the section will be located once the + program has started executing. Normally this is the same as the + LMA address, which is the address where the section will be loaded + into memory, but on some systems, especially those where a program + is held in ROM, the two can be different. If `=' is used, the + section address is set to VAL. Otherwise, VAL is added to or + subtracted from the section address. See the comments under + `--change-addresses', above. If SECTION does not exist in the + input file, a warning will be issued, unless + `--no-change-warnings' is used. + +`--change-warnings' +`--adjust-warnings' + If `--change-section-address' or `--change-section-lma' or + `--change-section-vma' is used, and the named section does not + exist, issue a warning. This is the default. + +`--no-change-warnings' +`--no-adjust-warnings' + Do not issue a warning if `--change-section-address' or + `--adjust-section-lma' or `--adjust-section-vma' is used, even if + the named section does not exist. + +`--set-section-flags SECTION=FLAGS' + Set the flags for the named section. The FLAGS argument is a + comma separated string of flag names. The recognized names are + `alloc', `contents', `load', `noload', `readonly', `code', `data', + `rom', `share', and `debug'. You can set the `contents' flag for + a section which does not have contents, but it is not meaningful + to clear the `contents' flag of a section which does have + contents-just remove the section instead. Not all flags are + meaningful for all object file formats. + +`--add-section SECTIONNAME=FILENAME' + Add a new section named SECTIONNAME while copying the file. The + contents of the new section are taken from the file FILENAME. The + size of the section will be the size of the file. This option only + works on file formats which can support sections with arbitrary + names. + +`--change-leading-char' + Some object file formats use special characters at the start of + symbols. The most common such character is underscore, which + compilers often add before every symbol. This option tells + `objcopy' to change the leading character of every symbol when it + converts between object file formats. If the object file formats + use the same leading character, this option has no effect. + Otherwise, it will add a character, or remove a character, or + change a character, as appropriate. + +`--remove-leading-char' + If the first character of a global symbol is a special symbol + leading character used by the object file format, remove the + character. The most common symbol leading character is + underscore. This option will remove a leading underscore from all + global symbols. This can be useful if you want to link together + objects of different file formats with different conventions for + symbol names. This is different from `--change-leading-char' + because it always changes the symbol name when appropriate, + regardless of the object file format of the output file. + +`--srec-len=IVAL' + Meaningful only for srec output. Set the maximum length of the + Srecords being produced to IVAL. This length covers both address, + data and crc fields. + +`--srec-forceS3' + Meaningful only for srec output. Avoid generation of S1/S2 + records, creating S3-only record format. + +`--redefine-sym OLD=NEW' + Change the name of a symbol OLD, to NEW. This can be useful when + one is trying link two things together for which you have no + source, and there are name collisions. + +`--weaken' + Change all global symbols in the file to be weak. This can be + useful when building an object which will be linked against other + objects using the `-R' option to the linker. This option is only + effective when using an object file format which supports weak + symbols. + +`-V' +`--version' + Show the version number of `objcopy'. + +`-v' +`--verbose' + Verbose output: list all object files modified. In the case of + archives, `objcopy -V' lists all members of the archive. + +`--help' + Show a summary of the options to `objcopy'. + + +File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top + +objdump +******* + + objdump [ -a | --archive-headers ] + [ -b BFDNAME | --target=BFDNAME ] + [ -C | --demangle[=STYLE] ] + [ -d | --disassemble ] + [ -D | --disassemble-all ] + [ -z | --disassemble-zeroes ] + [ -EB | -EL | --endian={big | little } ] + [ -f | --file-headers ] + [ --file-start-context ] + [ -g | --debugging ] + [ -h | --section-headers | --headers ] + [ -i | --info ] + [ -j SECTION | --section=SECTION ] + [ -l | --line-numbers ] + [ -S | --source ] + [ -m MACHINE | --architecture=MACHINE ] + [ -M OPTIONS | --disassembler-options=OPTIONS] + [ -p | --private-headers ] + [ -r | --reloc ] + [ -R | --dynamic-reloc ] + [ -s | --full-contents ] + [ -G | --stabs ] + [ -t | --syms ] + [ -T | --dynamic-syms ] + [ -x | --all-headers ] + [ -w | --wide ] + [ --start-address=ADDRESS ] + [ --stop-address=ADDRESS ] + [ --prefix-addresses] + [ --[no-]show-raw-insn ] + [ --adjust-vma=OFFSET ] + [ -V | --version ] + [ -H | --help ] + OBJFILE... + + `objdump' displays information about one or more object files. The +options control what particular information to display. This +information is mostly useful to programmers who are working on the +compilation tools, as opposed to programmers who just want their +program to compile and work. + + OBJFILE... are the object files to be examined. When you specify +archives, `objdump' shows information on each of the member object +files. + + The long and short forms of options, shown here as alternatives, are +equivalent. At least one option from the list +`-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x' must be given. + +`-a' +`--archive-header' + If any of the OBJFILE files are archives, display the archive + header information (in a format similar to `ls -l'). Besides the + information you could list with `ar tv', `objdump -a' shows the + object file format of each archive member. + +`--adjust-vma=OFFSET' + When dumping information, first add OFFSET to all the section + addresses. This is useful if the section addresses do not + correspond to the symbol table, which can happen when putting + sections at particular addresses when using a format which can not + represent section addresses, such as a.out. + +`-b BFDNAME' +`--target=BFDNAME' + Specify that the object-code format for the object files is + BFDNAME. This option may not be necessary; OBJDUMP can + automatically recognize many formats. + + For example, + objdump -b oasys -m vax -h fu.o + + displays summary information from the section headers (`-h') of + `fu.o', which is explicitly identified (`-m') as a VAX object file + in the format produced by Oasys compilers. You can list the + formats available with the `-i' option. *Note Target Selection::, + for more information. + +`-C' +`--demangle[=STYLE]' + Decode ("demangle") low-level symbol names into user-level names. + Besides removing any initial underscore prepended by the system, + this makes C++ function names readable. Different compilers have + different mangling styles. The optional demangling style argument + can be used to choose an appropriate demangling style for your + compiler. *Note c++filt::, for more information on demangling. + +`-G' + +`--debugging' + Display debugging information. This attempts to parse debugging + information stored in the file and print it out using a C like + syntax. Only certain types of debugging information have been + implemented. + +`-d' +`--disassemble' + Display the assembler mnemonics for the machine instructions from + OBJFILE. This option only disassembles those sections which are + expected to contain instructions. + +`-D' +`--disassemble-all' + Like `-d', but disassemble the contents of all sections, not just + those expected to contain instructions. + +`--prefix-addresses' + When disassembling, print the complete address on each line. This + is the older disassembly format. + +`--disassemble-zeroes' + Normally the disassembly output will skip blocks of zeroes. This + option directs the disassembler to disassemble those blocks, just + like any other data. + +`-EB' +`-EL' +`--endian={big|little}' + Specify the endianness of the object files. This only affects + disassembly. This can be useful when disassembling a file format + which does not describe endianness information, such as S-records. + +`-f' +`--file-header' + Display summary information from the overall header of each of the + OBJFILE files. + +`--file-start-context' + Specify that when displaying interlisted source code/disassembly + (assumes '-S') from a file that has not yet been displayed, extend + the context to the start of the file. + +`-h' +`--section-header' +`--header' + Display summary information from the section headers of the object + file. + + File segments may be relocated to nonstandard addresses, for + example by using the `-Ttext', `-Tdata', or `-Tbss' options to + `ld'. However, some object file formats, such as a.out, do not + store the starting address of the file segments. In those + situations, although `ld' relocates the sections correctly, using + `objdump -h' to list the file section headers cannot show the + correct addresses. Instead, it shows the usual addresses, which + are implicit for the target. + +`--help' + Print a summary of the options to `objdump' and exit. + +`-i' +`--info' + Display a list showing all architectures and object formats + available for specification with `-b' or `-m'. + +`-j NAME' +`--section=NAME' + Display information only for section NAME. + +`-l' +`--line-numbers' + Label the display (using debugging information) with the filename + and source line numbers corresponding to the object code or relocs + shown. Only useful with `-d', `-D', or `-r'. + +`-m MACHINE' +`--architecture=MACHINE' + Specify the architecture to use when disassembling object files. + This can be useful when disassembling object files which do not + describe architecture information, such as S-records. You can + list the available architectures with the `-i' option. + +`-M OPTIONS' +`--disassembler-options=OPTIONS' + Pass target specific information to the disassembler. Only + supported on some targets. + + If the target is an ARM architecture then this switch can be used + to select which register name set is used during disassembler. + Specifying `-M reg-name-std' (the default) will select the + register names as used in ARM's instruction set documentation, but + with register 13 called 'sp', register 14 called 'lr' and register + 15 called 'pc'. Specifying `-M reg-names-apcs' will select the + name set used by the ARM Procedure Call Standard, whilst + specifying `-M reg-names-raw' will just use `r' followed by the + register number. + + There are also two variants on the APCS register naming scheme + enabled by `-M reg-names-atpcs' and `-M reg-names-special-atpcs' + which use the ARM/Thumb Procedure Call Standard naming + conventions. (Eiuther with the normal register name sor the + special register names). + + This option can also be used for ARM architectures to force the + disassembler to interpret all instructions as THUMB instructions by + using the switch `--disassembler-options=force-thumb'. This can be + useful when attempting to disassemble thumb code produced by other + compilers. + +`-p' +`--private-headers' + Print information that is specific to the object file format. The + exact information printed depends upon the object file format. + For some object file formats, no additional information is printed. + +`-r' +`--reloc' + Print the relocation entries of the file. If used with `-d' or + `-D', the relocations are printed interspersed with the + disassembly. + +`-R' +`--dynamic-reloc' + Print the dynamic relocation entries of the file. This is only + meaningful for dynamic objects, such as certain types of shared + libraries. + +`-s' +`--full-contents' + Display the full contents of any sections requested. + +`-S' +`--source' + Display source code intermixed with disassembly, if possible. + Implies `-d'. + +`--show-raw-insn' + When disassembling instructions, print the instruction in hex as + well as in symbolic form. This is the default except when + `--prefix-addresses' is used. + +`--no-show-raw-insn' + When disassembling instructions, do not print the instruction + bytes. This is the default when `--prefix-addresses' is used. + +`-G' + +`--stabs' + Display the full contents of any sections requested. Display the + contents of the .stab and .stab.index and .stab.excl sections from + an ELF file. This is only useful on systems (such as Solaris 2.0) + in which `.stab' debugging symbol-table entries are carried in an + ELF section. In most other file formats, debugging symbol-table + entries are interleaved with linkage symbols, and are visible in + the `--syms' output. For more information on stabs symbols, see + *Note Stabs: (stabs.info)Top. + +`--start-address=ADDRESS' + Start displaying data at the specified address. This affects the + output of the `-d', `-r' and `-s' options. + +`--stop-address=ADDRESS' + Stop displaying data at the specified address. This affects the + output of the `-d', `-r' and `-s' options. + +`-t' +`--syms' + Print the symbol table entries of the file. This is similar to + the information provided by the `nm' program. + +`-T' +`--dynamic-syms' + Print the dynamic symbol table entries of the file. This is only + meaningful for dynamic objects, such as certain types of shared + libraries. This is similar to the information provided by the `nm' + program when given the `-D' (`--dynamic') option. + +`--version' + Print the version number of `objdump' and exit. + +`-x' +`--all-header' + Display all available header information, including the symbol + table and relocation entries. Using `-x' is equivalent to + specifying all of `-a -f -h -r -t'. + +`-w' +`--wide' + Format some lines for output devices that have more than 80 + columns. + + +File: binutils.info, Node: ranlib, Next: readelf, Prev: objdump, Up: Top + +ranlib +****** + + ranlib [-vV] ARCHIVE + + `ranlib' generates an index to the contents of an archive and stores +it in the archive. The index lists each symbol defined by a member of +an archive that is a relocatable object file. + + You may use `nm -s' or `nm --print-armap' to list this index. + + An archive with such an index speeds up linking to the library and +allows routines in the library to call each other without regard to +their placement in the archive. + + The GNU `ranlib' program is another form of GNU `ar'; running +`ranlib' is completely equivalent to executing `ar -s'. *Note ar::. + +`-v' +`-V' +`--version' + Show the version number of `ranlib'. + diff --git a/binutils/binutils.info-2 b/binutils/binutils.info-2 new file mode 100644 index 0000000..8422d1e --- /dev/null +++ b/binutils/binutils.info-2 @@ -0,0 +1,1403 @@ +This is binutils.info, produced by makeinfo version 4.0 from +binutils.texi. + +START-INFO-DIR-ENTRY +* Binutils: (binutils). The GNU binary utilities. +* ar: (binutils)ar. Create, modify, and extract from archives +* nm: (binutils)nm. List symbols from object files +* objcopy: (binutils)objcopy. Copy and translate object files +* objdump: (binutils)objdump. Display information from object files +* ranlib: (binutils)ranlib. Generate index to archive contents +* readelf: (binutils)readelf. Display the contents of ELF format files. +* size: (binutils)size. List section sizes and total size +* strings: (binutils)strings. List printable strings from files +* strip: (binutils)strip. Discard symbols +* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols +* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt +* addr2line: (binutils)addr2line. Convert addresses to file and line +* nlmconv: (binutils)nlmconv. Converts object code into an NLM +* windres: (binutils)windres. Manipulate Windows resources +* dlltool: (binutils)dlltool. Create files needed to build and use DLLs +END-INFO-DIR-ENTRY + + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". + + +File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top + +size +**** + + size [ -A | -B | --format=COMPATIBILITY ] + [ --help ] [ -d | -o | -x | --radix=NUMBER ] + [ --target=BFDNAME ] [ -V | --version ] + [ OBJFILE... ] + + The GNU `size' utility lists the section sizes--and the total +size--for each of the object or archive files OBJFILE in its argument +list. By default, one line of output is generated for each object file +or each module in an archive. + + OBJFILE... are the object files to be examined. If none are +specified, the file `a.out' will be used. + + The command line options have the following meanings: + +`-A' +`-B' +`--format=COMPATIBILITY' + Using one of these options, you can choose whether the output from + GNU `size' resembles output from System V `size' (using `-A', or + `--format=sysv'), or Berkeley `size' (using `-B', or + `--format=berkeley'). The default is the one-line format similar + to Berkeley's. + + Here is an example of the Berkeley (default) format of output from + `size': + $ size --format=Berkeley ranlib size + text data bss dec hex filename + 294880 81920 11592 388392 5ed28 ranlib + 294880 81920 11888 388688 5ee50 size + + This is the same data, but displayed closer to System V + conventions: + + $ size --format=SysV ranlib size + ranlib : + section size addr + .text 294880 8192 + .data 81920 303104 + .bss 11592 385024 + Total 388392 + + + size : + section size addr + .text 294880 8192 + .data 81920 303104 + .bss 11888 385024 + Total 388688 + +`--help' + Show a summary of acceptable arguments and options. + +`-d' +`-o' +`-x' +`--radix=NUMBER' + Using one of these options, you can control whether the size of + each section is given in decimal (`-d', or `--radix=10'); octal + (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16'). + In `--radix=NUMBER', only the three values (8, 10, 16) are + supported. The total size is always given in two radices; decimal + and hexadecimal for `-d' or `-x' output, or octal and hexadecimal + if you're using `-o'. + +`--target=BFDNAME' + Specify that the object-code format for OBJFILE is BFDNAME. This + option may not be necessary; `size' can automatically recognize + many formats. *Note Target Selection::, for more information. + +`-V' +`--version' + Display the version number of `size'. + + +File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top + +strings +******* + + strings [-afov] [-MIN-LEN] [-n MIN-LEN] [-t RADIX] [-] + [--all] [--print-file-name] [--bytes=MIN-LEN] + [--radix=RADIX] [--target=BFDNAME] + [--help] [--version] FILE... + + For each FILE given, GNU `strings' prints the printable character +sequences that are at least 4 characters long (or the number given with +the options below) and are followed by an unprintable character. By +default, it only prints the strings from the initialized and loaded +sections of object files; for other types of files, it prints the +strings from the whole file. + + `strings' is mainly useful for determining the contents of non-text +files. + +`-a' +`--all' +`-' + Do not scan only the initialized and loaded sections of object + files; scan the whole files. + +`-f' +`--print-file-name' + Print the name of the file before each string. + +`--help' + Print a summary of the program usage on the standard output and + exit. + +`-MIN-LEN' +`-n MIN-LEN' +`--bytes=MIN-LEN' + Print sequences of characters that are at least MIN-LEN characters + long, instead of the default 4. + +`-o' + Like `-t o'. Some other versions of `strings' have `-o' act like + `-t d' instead. Since we can not be compatible with both ways, we + simply chose one. + +`-t RADIX' +`--radix=RADIX' + Print the offset within the file before each string. The single + character argument specifies the radix of the offset--`o' for + octal, `x' for hexadecimal, or `d' for decimal. + +`--target=BFDNAME' + Specify an object code format other than your system's default + format. *Note Target Selection::, for more information. + +`-v' +`--version' + Print the program version number on the standard output and exit. + + +File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top + +strip +***** + + strip [ -F BFDNAME | --target=BFDNAME ] + [ -I BFDNAME | --input-target=BFDNAME ] + [ -O BFDNAME | --output-target=BFDNAME ] + [ -s | --strip-all ] [ -S | -g | --strip-debug ] + [ -K SYMBOLNAME | --keep-symbol=SYMBOLNAME ] + [ -N SYMBOLNAME | --strip-symbol=SYMBOLNAME ] + [ -x | --discard-all ] [ -X | --discard-locals ] + [ -R SECTIONNAME | --remove-section=SECTIONNAME ] + [ -o FILE ] [ -p | --preserve-dates ] + [ -v | --verbose ] [ -V | --version ] [ --help ] + OBJFILE... + + GNU `strip' discards all symbols from object files OBJFILE. The +list of object files may include archives. At least one object file +must be given. + + `strip' modifies the files named in its argument, rather than +writing modified copies under different names. + +`-F BFDNAME' +`--target=BFDNAME' + Treat the original OBJFILE as a file with the object code format + BFDNAME, and rewrite it in the same format. *Note Target + Selection::, for more information. + +`--help' + Show a summary of the options to `strip' and exit. + +`-I BFDNAME' +`--input-target=BFDNAME' + Treat the original OBJFILE as a file with the object code format + BFDNAME. *Note Target Selection::, for more information. + +`-O BFDNAME' +`--output-target=BFDNAME' + Replace OBJFILE with a file in the output format BFDNAME. *Note + Target Selection::, for more information. + +`-R SECTIONNAME' +`--remove-section=SECTIONNAME' + Remove any section named SECTIONNAME from the output file. This + option may be given more than once. Note that using this option + inappropriately may make the output file unusable. + +`-s' +`--strip-all' + Remove all symbols. + +`-g' +`-S' +`--strip-debug' + Remove debugging symbols only. + +`--strip-unneeded' + Remove all symbols that are not needed for relocation processing. + +`-K SYMBOLNAME' +`--keep-symbol=SYMBOLNAME' + Keep only symbol SYMBOLNAME from the source file. This option may + be given more than once. + +`-N SYMBOLNAME' +`--strip-symbol=SYMBOLNAME' + Remove symbol SYMBOLNAME from the source file. This option may be + given more than once, and may be combined with strip options other + than `-K'. + +`-o FILE' + Put the stripped output in FILE, rather than replacing the + existing file. When this argument is used, only one OBJFILE + argument may be specified. + +`-p' +`--preserve-dates' + Preserve the access and modification dates of the file. + +`-x' +`--discard-all' + Remove non-global symbols. + +`-X' +`--discard-locals' + Remove compiler-generated local symbols. (These usually start + with `L' or `.'.) + +`-V' +`--version' + Show the version number for `strip'. + +`-v' +`--verbose' + Verbose output: list all object files modified. In the case of + archives, `strip -v' lists all members of the archive. + + +File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top + +c++filt +******* + + c++filt [ -_ | --strip-underscores ] + [ -j | --java ] + [ -n | --no-strip-underscores ] + [ -s FORMAT | --format=FORMAT ] + [ --help ] [ --version ] [ SYMBOL... ] + + The C++ and Java languages provides function overloading, which means +that you can write many functions with the same name (providing each +takes parameters of different types). All C++ and Java function names +are encoded into a low-level assembly label (this process is known as +"mangling"). The `c++filt' (1) program does the inverse mapping: it +decodes ("demangles") low-level names into user-level names so that the +linker can keep these overloaded functions from clashing. + + Every alphanumeric word (consisting of letters, digits, underscores, +dollars, or periods) seen in the input is a potential label. If the +label decodes into a C++ name, the C++ name replaces the low-level name +in the output. + + You can use `c++filt' to decipher individual symbols: + + c++filt SYMBOL + + If no SYMBOL arguments are given, `c++filt' reads symbol names from +the standard input and writes the demangled names to the standard +output. All results are printed on the standard output. + +`-_' +`--strip-underscores' + On some systems, both the C and C++ compilers put an underscore in + front of every name. For example, the C name `foo' gets the + low-level name `_foo'. This option removes the initial + underscore. Whether `c++filt' removes the underscore by default + is target dependent. + +`-j' +`--java' + Prints demangled names using Java syntax. The default is to use + C++ syntax. + +`-n' +`--no-strip-underscores' + Do not remove the initial underscore. + +`-s FORMAT' +`--format=FORMAT' + GNU `nm' can decode three different methods of mangling, used by + different C++ compilers. The argument to this option selects which + method it uses: + + `gnu' + the one used by the GNU compiler (the default method) + + `lucid' + the one used by the Lucid compiler + + `arm' + the one specified by the C++ Annotated Reference Manual + + `hp' + the one used by the HP compiler + + `edg' + the one used by the EDG compiler + + `gnu-new-abi' + the one used by the GNU compiler with the new ABI. + +`--help' + Print a summary of the options to `c++filt' and exit. + +`--version' + Print the version number of `c++filt' and exit. + + _Warning:_ `c++filt' is a new utility, and the details of its user + interface are subject to change in future releases. In particular, + a command-line option may be required in the the future to decode + a name passed as an argument on the command line; in other words, + + c++filt SYMBOL + + may in a future release become + + c++filt OPTION SYMBOL + + ---------- Footnotes ---------- + + (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS +this program is named `cxxfilt'. + + +File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top + +addr2line +********* + + addr2line [ -b BFDNAME | --target=BFDNAME ] + [ -C | --demangle[=STYLE ] + [ -e FILENAME | --exe=FILENAME ] + [ -f | --functions ] [ -s | --basename ] + [ -H | --help ] [ -V | --version ] + [ addr addr ... ] + + `addr2line' translates program addresses into file names and line +numbers. Given an address and an executable, it uses the debugging +information in the executable to figure out which file name and line +number are associated with a given address. + + The executable to use is specified with the `-e' option. The +default is the file `a.out'. + + `addr2line' has two modes of operation. + + In the first, hexadecimal addresses are specified on the command +line, and `addr2line' displays the file name and line number for each +address. + + In the second, `addr2line' reads hexadecimal addresses from standard +input, and prints the file name and line number for each address on +standard output. In this mode, `addr2line' may be used in a pipe to +convert dynamically chosen addresses. + + The format of the output is `FILENAME:LINENO'. The file name and +line number for each address is printed on a separate line. If the +`-f' option is used, then each `FILENAME:LINENO' line is preceded by a +`FUNCTIONNAME' line which is the name of the function containing the +address. + + If the file name or function name can not be determined, `addr2line' +will print two question marks in their place. If the line number can +not be determined, `addr2line' will print 0. + + The long and short forms of options, shown here as alternatives, are +equivalent. + +`-b BFDNAME' +`--target=BFDNAME' + Specify that the object-code format for the object files is + BFDNAME. + +`-C' +`--demangle[=STYLE]' + Decode ("demangle") low-level symbol names into user-level names. + Besides removing any initial underscore prepended by the system, + this makes C++ function names readable. Different compilers have + different mangling styles. The optional demangling style argument + can be used to choose an appropriate demangling style for your + compiler. *Note c++filt::, for more information on demangling. + +`-e FILENAME' +`--exe=FILENAME' + Specify the name of the executable for which addresses should be + translated. The default file is `a.out'. + +`-f' +`--functions' + Display function names as well as file and line number information. + +`-s' +`--basenames' + Display only the base of each file name. + + +File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top + +nlmconv +******* + + `nlmconv' converts a relocatable object file into a NetWare Loadable +Module. + + _Warning:_ `nlmconv' is not always built as part of the binary + utilities, since it is only useful for NLM targets. + + nlmconv [ -I BFDNAME | --input-target=BFDNAME ] + [ -O BFDNAME | --output-target=BFDNAME ] + [ -T HEADERFILE | --header-file=HEADERFILE ] + [ -d | --debug] [ -l LINKER | --linker=LINKER ] + [ -h | --help ] [ -V | --version ] + INFILE OUTFILE + + `nlmconv' converts the relocatable `i386' object file INFILE into +the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for +NLM header information. For instructions on writing the NLM command +file language used in header files, see the `linkers' section, +`NLMLINK' in particular, of the `NLM Development and Tools Overview', +which is part of the NLM Software Developer's Kit ("NLM SDK"), +available from Novell, Inc. `nlmconv' uses the GNU Binary File +Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for +more information. + + `nlmconv' can perform a link step. In other words, you can list +more than one object file for input if you list them in the definitions +file (rather than simply specifying one input file on the command line). +In this case, `nlmconv' calls the linker for you. + +`-I BFDNAME' +`--input-target=BFDNAME' + Object format of the input file. `nlmconv' can usually determine + the format of a given file (so no default is necessary). *Note + Target Selection::, for more information. + +`-O BFDNAME' +`--output-target=BFDNAME' + Object format of the output file. `nlmconv' infers the output + format based on the input format, e.g. for a `i386' input file the + output format is `nlm32-i386'. *Note Target Selection::, for more + information. + +`-T HEADERFILE' +`--header-file=HEADERFILE' + Reads HEADERFILE for NLM header information. For instructions on + writing the NLM command file language used in header files, see + see the `linkers' section, of the `NLM Development and Tools + Overview', which is part of the NLM Software Developer's Kit, + available from Novell, Inc. + +`-d' +`--debug' + Displays (on standard error) the linker command line used by + `nlmconv'. + +`-l LINKER' +`--linker=LINKER' + Use LINKER for any linking. LINKER can be an absolute or a + relative pathname. + +`-h' +`--help' + Prints a usage summary. + +`-V' +`--version' + Prints the version number for `nlmconv'. + + +File: binutils.info, Node: windres, Next: dlltool, Prev: nlmconv, Up: Top + +windres +******* + + `windres' may be used to manipulate Windows resources. + + _Warning:_ `windres' is not always built as part of the binary + utilities, since it is only useful for Windows targets. + + windres [options] [input-file] [output-file] + + `windres' reads resources from an input file and copies them into an +output file. Either file may be in one of three formats: + +`rc' + A text format read by the Resource Compiler. + +`res' + A binary format generated by the Resource Compiler. + +`coff' + A COFF object or executable. + + The exact description of these different formats is available in +documentation from Microsoft. + + When `windres' converts from the `rc' format to the `res' format, it +is acting like the Windows Resource Compiler. When `windres' converts +from the `res' format to the `coff' format, it is acting like the +Windows `CVTRES' program. + + When `windres' generates an `rc' file, the output is similar but not +identical to the format expected for the input. When an input `rc' +file refers to an external filename, an output `rc' file will instead +include the file contents. + + If the input or output format is not specified, `windres' will guess +based on the file name, or, for the input file, the file contents. A +file with an extension of `.rc' will be treated as an `rc' file, a file +with an extension of `.res' will be treated as a `res' file, and a file +with an extension of `.o' or `.exe' will be treated as a `coff' file. + + If no output file is specified, `windres' will print the resources +in `rc' format to standard output. + + The normal use is for you to write an `rc' file, use `windres' to +convert it to a COFF object file, and then link the COFF file into your +application. This will make the resources described in the `rc' file +available to Windows. + +`-i FILENAME' +`--input FILENAME' + The name of the input file. If this option is not used, then + `windres' will use the first non-option argument as the input file + name. If there are no non-option arguments, then `windres' will + read from standard input. `windres' can not read a COFF file from + standard input. + +`-o FILENAME' +`--output FILENAME' + The name of the output file. If this option is not used, then + `windres' will use the first non-option argument, after any used + for the input file name, as the output file name. If there is no + non-option argument, then `windres' will write to standard output. + `windres' can not write a COFF file to standard output. + +`-I FORMAT' +`--input-format FORMAT' + The input format to read. FORMAT may be `res', `rc', or `coff'. + If no input format is specified, `windres' will guess, as + described above. + +`-O FORMAT' +`--output-format FORMAT' + The output format to generate. FORMAT may be `res', `rc', or + `coff'. If no output format is specified, `windres' will guess, + as described above. + +`-F TARGET' +`--target TARGET' + Specify the BFD format to use for a COFF file as input or output. + This is a BFD target name; you can use the `--help' option to see + a list of supported targets. Normally `windres' will use the + default format, which is the first one listed by the `--help' + option. *Note Target Selection::. + +`--preprocessor PROGRAM' + When `windres' reads an `rc' file, it runs it through the C + preprocessor first. This option may be used to specify the + preprocessor to use, including any leading arguments. The default + preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'. + +`--include-dir DIRECTORY' + Specify an include directory to use when reading an `rc' file. + `windres' will pass this to the preprocessor as an `-I' option. + `windres' will also search this directory when looking for files + named in the `rc' file. + +`-D TARGET' +`--define SYM[=VAL]' + Specify a `-D' option to pass to the preprocessor when reading an + `rc' file. + +`-v' + Enable verbose mode. This tells you what the preprocessor is if + you didn't specify one. + +`--language VAL' + Specify the default language to use when reading an `rc' file. + VAL should be a hexadecimal language code. The low eight bits are + the language, and the high eight bits are the sublanguage. + +`--use-temp-file' + Use a temporary file to instead of using popen to read the output + of the preprocessor. Use this option if the popen implementation + is buggy on the host (eg., certain non-English language versions + of Windows 95 and Windows 98 are known to have buggy popen where + the output will instead go the console). + +`--no-use-temp-file' + Use popen, not a temporary file, to read the output of the + preprocessor. This is the default behaviour. + +`--help' + Prints a usage summary. + +`--version' + Prints the version number for `windres'. + +`--yydebug' + If `windres' is compiled with `YYDEBUG' defined as `1', this will + turn on parser debugging. + + +File: binutils.info, Node: dlltool, Next: Selecting The Target System, Prev: windres, Up: Top + +Create files needed to build and use DLLs +***************************************** + + `dlltool' may be used to create the files needed to build and use +dynamic link libraries (DLLs). + + _Warning:_ `dlltool' is not always built as part of the binary + utilities, since it is only useful for those targets which support + DLLs. + + dlltool [-d|--input-def DEF-FILE-NAME] + [-b|--base-file BASE-FILE-NAME] + [-e|--output-exp EXPORTS-FILE-NAME] + [-z|--output-def DEF-FILE-NAME] + [-l|--output-lib LIBRARY-FILE-NAME] + [--export-all-symbols] [--no-export-all-symbols] + [--exclude-symbols LIST] + [--no-default-excludes] + [-S|--as PATH-TO-ASSEMBLER] [-f|--as-flags OPTIONS] + [-D|--dllname NAME] [-m|--machine MACHINE] + [-a|--add-indirect] [-U|--add-underscore] [-k|--kill-at] + [-A|--add-stdcall-alias] + [-x|--no-idata4] [-c|--no-idata5] [-i|--interwork] + [-n|--nodelete] [-v|--verbose] [-h|--help] [-V|--version] + [object-file ...] + + `dlltool' reads its inputs, which can come from the `-d' and `-b' +options as well as object files specified on the command line. It then +processes these inputs and if the `-e' option has been specified it +creates a exports file. If the `-l' option has been specified it +creates a library file and if the `-z' option has been specified it +creates a def file. Any or all of the -e, -l and -z options can be +present in one invocation of dlltool. + + When creating a DLL, along with the source for the DLL, it is +necessary to have three other files. `dlltool' can help with the +creation of these files. + + The first file is a `.def' file which specifies which functions are +exported from the DLL, which functions the DLL imports, and so on. This +is a text file and can be created by hand, or `dlltool' can be used to +create it using the `-z' option. In this case `dlltool' will scan the +object files specified on its command line looking for those functions +which have been specially marked as being exported and put entries for +them in the .def file it creates. + + In order to mark a function as being exported from a DLL, it needs to +have an `-export:<name_of_function>' entry in the `.drectve' section of +the object file. This can be done in C by using the asm() operator: + + asm (".section .drectve"); + asm (".ascii \"-export:my_func\""); + + int my_func (void) { ... } + + The second file needed for DLL creation is an exports file. This +file is linked with the object files that make up the body of the DLL +and it handles the interface between the DLL and the outside world. +This is a binary file and it can be created by giving the `-e' option to +`dlltool' when it is creating or reading in a .def file. + + The third file needed for DLL creation is the library file that +programs will link with in order to access the functions in the DLL. +This file can be created by giving the `-l' option to dlltool when it +is creating or reading in a .def file. + + `dlltool' builds the library file by hand, but it builds the exports +file by creating temporary files containing assembler statements and +then assembling these. The `-S' command line option can be used to +specify the path to the assembler that dlltool will use, and the `-f' +option can be used to pass specific flags to that assembler. The `-n' +can be used to prevent dlltool from deleting these temporary assembler +files when it is done, and if `-n' is specified twice then this will +prevent dlltool from deleting the temporary object files it used to +build the library. + + Here is an example of creating a DLL from a source file `dll.c' and +also creating a program (from an object file called `program.o') that +uses that DLL: + + gcc -c dll.c + dlltool -e exports.o -l dll.lib dll.o + gcc dll.o exports.o -o dll.dll + gcc program.o dll.lib -o program + + The command line options have the following meanings: + +`-d FILENAME' +`--input-def FILENAME' + Specifies the name of a .def file to be read in and processed. + +`-b FILENAME' +`--base-file FILENAME' + Specifies the name of a base file to be read in and processed. The + contents of this file will be added to the relocation section in + the exports file generated by dlltool. + +`-e FILENAME' +`--output-exp FILENAME' + Specifies the name of the export file to be created by dlltool. + +`-z FILENAME' +`--output-def FILENAME' + Specifies the name of the .def file to be created by dlltool. + +`-l FILENAME' +`--output-lib FILENAME' + Specifies the name of the library file to be created by dlltool. + +`--export-all-symbols' + Treat all global and weak defined symbols found in the input object + files as symbols to be exported. There is a small list of symbols + which are not exported by default; see the `--no-default-excludes' + option. You may add to the list of symbols to not export by using + the `--exclude-symbols' option. + +`--no-export-all-symbols' + Only export symbols explicitly listed in an input .def file or in + `.drectve' sections in the input object files. This is the default + behaviour. The `.drectve' sections are created by `dllexport' + attributes in the source code. + +`--exclude-symbols LIST' + Do not export the symbols in LIST. This is a list of symbol names + separated by comma or colon characters. The symbol names should + not contain a leading underscore. This is only meaningful when + `--export-all-symbols' is used. + +`--no-default-excludes' + When `--export-all-symbols' is used, it will by default avoid + exporting certain special symbols. The current list of symbols to + avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'. + You may use the `--no-default-excludes' option to go ahead and + export these special symbols. This is only meaningful when + `--export-all-symbols' is used. + +`-S PATH' +`--as PATH' + Specifies the path, including the filename, of the assembler to be + used to create the exports file. + +`-f SWITCHES' +`--as-flags SWITCHES' + Specifies any specific command line switches to be passed to the + assembler when building the exports file. This option will work + even if the `-S' option is not used. This option only takes one + argument, and if it occurs more than once on the command line, + then later occurrences will override earlier occurrences. So if + it is necessary to pass multiple switches to the assembler they + should be enclosed in double quotes. + +`-D NAME' +`--dll-name NAME' + Specifies the name to be stored in the .def file as the name of + the DLL when the `-e' option is used. If this option is not + present, then the filename given to the `-e' option will be used + as the name of the DLL. + +`-m MACHINE' +`-machine MACHINE' + Specifies the type of machine for which the library file should be + built. `dlltool' has a built in default type, depending upon how + it was created, but this option can be used to override that. + This is normally only useful when creating DLLs for an ARM + processor, when the contents of the DLL are actually encode using + THUMB instructions. + +`-a' +`--add-indirect' + Specifies that when `dlltool' is creating the exports file it + should add a section which allows the exported functions to be + referenced without using the import library. Whatever the hell + that means! + +`-U' +`--add-underscore' + Specifies that when `dlltool' is creating the exports file it + should prepend an underscore to the names of the exported + functions. + +`-k' +`--kill-at' + Specifies that when `dlltool' is creating the exports file it + should not append the string `@ <number>'. These numbers are + called ordinal numbers and they represent another way of accessing + the function in a DLL, other than by name. + +`-A' +`--add-stdcall-alias' + Specifies that when `dlltool' is creating the exports file it + should add aliases for stdcall symbols without `@ <number>' in + addition to the symbols with `@ <number>'. + +`-x' +`--no-idata4' + Specifies that when `dlltool' is creating the exports and library + files it should omit the .idata4 section. This is for + compatibility with certain operating systems. + +`-c' +`--no-idata5' + Specifies that when `dlltool' is creating the exports and library + files it should omit the .idata5 section. This is for + compatibility with certain operating systems. + +`-i' +`--interwork' + Specifies that `dlltool' should mark the objects in the library + file and exports file that it produces as supporting interworking + between ARM and THUMB code. + +`-n' +`--nodelete' + Makes `dlltool' preserve the temporary assembler files it used to + create the exports file. If this option is repeated then dlltool + will also preserve the temporary object files it uses to create + the library file. + +`-v' +`--verbose' + Make dlltool describe what it is doing. + +`-h' +`--help' + Displays a list of command line options and then exits. + +`-V' +`--version' + Displays dlltool's version number and then exits. + + +File: binutils.info, Node: readelf, Next: size, Prev: ranlib, Up: Top + +readelf +******* + + readelf [ -a | --all ] + [ -h | --file-header] + [ -l | --program-headers | --segments] + [ -S | --section-headers | --sections] + [ -e | --headers] + [ -s | --syms | --symbols] + [ -n | --notes] + [ -r | --relocs] + [ -d | --dynamic] + [ -V | --version-info] + [ -D | --use-dynamic] + [ -x <number> | --hex-dump=<number>] + [ -w[liaprf] | --debug-dump[=info,=line,=abbrev,=pubnames,=ranges,=frames]] + [ --histogram] + [ -v | --version] + [ -H | --help] + ELFFILE... + + `readelf' displays information about one or more ELF format object +files. The options control what particular information to display. + + ELFFILE... are the object files to be examined. At the moment, +`readelf' does not support examining archives, nor does it support +examing 64 bit ELF files. + + The long and short forms of options, shown here as alternatives, are +equivalent. At least one option besides `-v' or `-H' must be given. + +`-a' +`--all' + Equivalent to specifiying `--file-header', `--program-headers', + `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and + `--version-info'. + +`-h' +`--file-header' + Displays the information contained in the ELF header at the start + of the file. + +`-l' +`--program-headers' +`--segments' + Displays the information contained in the file's segment headers, + if it has any. + +`-S' +`--sections' +`--section-headers' + Displays the information contained in the file's section headers, + if it has any. + +`-s' +`--symbols' +`--syms' + Displays the entries in symbol table section of the file, if it + has one. + +`-e' +`--headers' + Display all the headers in the file. Equivalent to `-h -l -S'. + +`-n' +`--notes' + Displays the contents of the NOTE segment, if it exists. + +`-r' +`--relocs' + Displays the contents of the file's relocation section, if it ha + one. + +`-d' +`--dynamic' + Displays the contents of the file's dynamic section, if it has one. + +`-V' +`--version-info' + Displays the contents of the version sections in the file, it they + exist. + +`-D' +`--use-dynamic' + When displaying symbols, this option makes `readelf' use the + symbol table in the file's dynamic section, rather than the one in + the symbols section. + +`-x <number>' +`--hex-dump=<number>' + Displays the contents of the indicated section as a hexadecimal + dump. + +`-w[liaprf]' +`--debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]' + Displays the contents of the debug sections in the file, if any are + present. If one of the optional letters or words follows the + switch then only data found in those specific sections will be + dumped. + +`--histogram' + Display a histogram of bucket list lengths when displaying the + contents of the symbol tables. + +`-v' +`--version' + Display the version number of readelf. + +`-H' +`--help' + Display the command line options understood by `readelf'. + + +File: binutils.info, Node: Selecting The Target System, Next: Reporting Bugs, Prev: dlltool, Up: Top + +Selecting the target system +*************************** + + You can specify three aspects of the target system to the GNU binary +file utilities, each in several ways: + + * the target + + * the architecture + + * the linker emulation (which applies to the linker only) + + In the following summaries, the lists of ways to specify values are +in order of decreasing precedence. The ways listed first override those +listed later. + + The commands to list valid values only list the values for which the +programs you are running were configured. If they were configured with +`--enable-targets=all', the commands list most of the available values, +but a few are left out; not all targets can be configured in at once +because some of them can only be configured "native" (on hosts with the +same type as the target system). + +* Menu: + +* Target Selection:: +* Architecture Selection:: +* Linker Emulation Selection:: + + +File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting The Target System + +Target Selection +================ + + A "target" is an object file format. A given target may be +supported for multiple architectures (*note Architecture Selection::). +A target selection may also have variations for different operating +systems or architectures. + + The command to list valid target values is `objdump -i' (the first +column of output contains the relevant information). + + Some sample values are: `a.out-hp300bsd', `ecoff-littlemips', +`a.out-sunos-big'. + + You can also specify a target using a configuration triplet. This is +the same sort of name that is passed to `configure' to specify a +target. When you use a configuration triplet as an argument, it must be +fully canonicalized. You can see the canonical version of a triplet by +running the shell script `config.sub' which is included with the +sources. + + Some sample configuration triplets are: `m68k-hp-bsd', +`mips-dec-ultrix', `sparc-sun-sunos'. + +`objdump' Target +---------------- + + Ways to specify: + + 1. command line option: `-b' or `--target' + + 2. environment variable `GNUTARGET' + + 3. deduced from the input file + +`objcopy' and `strip' Input Target +---------------------------------- + + Ways to specify: + + 1. command line options: `-I' or `--input-target', or `-F' or + `--target' + + 2. environment variable `GNUTARGET' + + 3. deduced from the input file + +`objcopy' and `strip' Output Target +----------------------------------- + + Ways to specify: + + 1. command line options: `-O' or `--output-target', or `-F' or + `--target' + + 2. the input target (see "`objcopy' and `strip' Input Target" above) + + 3. environment variable `GNUTARGET' + + 4. deduced from the input file + +`nm', `size', and `strings' Target +---------------------------------- + + Ways to specify: + + 1. command line option: `--target' + + 2. environment variable `GNUTARGET' + + 3. deduced from the input file + +Linker Input Target +------------------- + + Ways to specify: + + 1. command line option: `-b' or `--format' (*note Options: + (ld.info)Options.) + + 2. script command `TARGET' (*note Option Commands: (ld.info)Option + Commands.) + + 3. environment variable `GNUTARGET' (*note Environment: + (ld.info)Environment.) + + 4. the default target of the selected linker emulation (*note Linker + Emulation Selection::) + +Linker Output Target +-------------------- + + Ways to specify: + + 1. command line option: `-oformat' (*note Options: (ld.info)Options.) + + 2. script command `OUTPUT_FORMAT' (*note Option Commands: + (ld.info)Option Commands.) + + 3. the linker input target (see "Linker Input Target" above) + + +File: binutils.info, Node: Architecture Selection, Next: Linker Emulation Selection, Prev: Target Selection, Up: Selecting The Target System + +Architecture selection +====================== + + An "architecture" is a type of CPU on which an object file is to +run. Its name may contain a colon, separating the name of the +processor family from the name of the particular CPU. + + The command to list valid architecture values is `objdump -i' (the +second column contains the relevant information). + + Sample values: `m68k:68020', `mips:3000', `sparc'. + +`objdump' Architecture +---------------------- + + Ways to specify: + + 1. command line option: `-m' or `--architecture' + + 2. deduced from the input file + +`objcopy', `nm', `size', `strings' Architecture +----------------------------------------------- + + Ways to specify: + + 1. deduced from the input file + +Linker Input Architecture +------------------------- + + Ways to specify: + + 1. deduced from the input file + +Linker Output Architecture +-------------------------- + + Ways to specify: + + 1. script command `OUTPUT_ARCH' (*note Option Commands: + (ld.info)Option Commands.) + + 2. the default architecture from the linker output target (*note + Target Selection::) + + +File: binutils.info, Node: Linker Emulation Selection, Prev: Architecture Selection, Up: Selecting The Target System + +Linker emulation selection +========================== + + A linker "emulation" is a "personality" of the linker, which gives +the linker default values for the other aspects of the target system. +In particular, it consists of + + * the linker script + + * the target + + * several "hook" functions that are run at certain stages of the + linking process to do special things that some targets require + + The command to list valid linker emulation values is `ld -V'. + + Sample values: `hp300bsd', `mipslit', `sun4'. + + Ways to specify: + + 1. command line option: `-m' (*note Options: (ld.info)Options.) + + 2. environment variable `LDEMULATION' + + 3. compiled-in `DEFAULT_EMULATION' from `Makefile', which comes from + `EMUL' in `config/TARGET.mt' + + +File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting The Target System, Up: Top + +Reporting Bugs +************** + + Your bug reports play an essential role in making the binary +utilities reliable. + + Reporting a bug may help you by bringing a solution to your problem, +or it may not. But in any case the principal function of a bug report +is to help the entire community by making the next version of the binary +utilities work better. Bug reports are your contribution to their +maintenance. + + In order for a bug report to serve its purpose, you must include the +information that enables us to fix the bug. + +* Menu: + +* Bug Criteria:: Have you found a bug? +* Bug Reporting:: How to report bugs + + +File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs + +Have you found a bug? +===================== + + If you are not sure whether you have found a bug, here are some +guidelines: + + * If a binary utility gets a fatal signal, for any input whatever, + that is a bug. Reliable utilities never crash. + + * If a binary utility produces an error message for valid input, + that is a bug. + + * If you are an experienced user of binary utilities, your + suggestions for improvement are welcome in any case. + + +File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs + +How to report bugs +================== + + A number of companies and individuals offer support for GNU +products. If you obtained the binary utilities from a support +organization, we recommend you contact that organization first. + + You can find contact information for many support companies and +individuals in the file `etc/SERVICE' in the GNU Emacs distribution. + + In any event, we also recommend that you send bug reports for the +binary utilities to `bug-binutils@gnu.org'. + + The fundamental principle of reporting bugs usefully is this: +*report all the facts*. If you are not sure whether to state a fact or +leave it out, state it! + + Often people omit facts because they think they know what causes the +problem and assume that some details do not matter. Thus, you might +assume that the name of a file you use in an example does not matter. +Well, probably it does not, but one cannot be sure. Perhaps the bug is +a stray memory reference which happens to fetch from the location where +that pathname is stored in memory; perhaps, if the pathname were +different, the contents of that location would fool the utility into +doing the right thing despite the bug. Play it safe and give a +specific, complete example. That is the easiest thing for you to do, +and the most helpful. + + Keep in mind that the purpose of a bug report is to enable us to fix +the bug if it is new to us. Therefore, always write your bug reports +on the assumption that the bug has not been reported previously. + + Sometimes people give a few sketchy facts and ask, "Does this ring a +bell?" Those bug reports are useless, and we urge everyone to _refuse +to respond to them_ except to chide the sender to report bugs properly. + + To enable us to fix the bug, you should include all these things: + + * The version of the utility. Each utility announces it if you + start it with the `--version' argument. + + Without this, we will not know whether there is any point in + looking for the bug in the current version of the binary utilities. + + * Any patches you may have applied to the source, including any + patches made to the `BFD' library. + + * The type of machine you are using, and the operating system name + and version number. + + * What compiler (and its version) was used to compile the + utilities--e.g. "`gcc-2.7'". + + * The command arguments you gave the utility to observe the bug. To + guarantee you will not omit something important, list them all. A + copy of the Makefile (or the output from make) is sufficient. + + If we were to try to guess the arguments, we would probably guess + wrong and then we might not encounter the bug. + + * A complete input file, or set of input files, that will reproduce + the bug. If the utility is reading an object file or files, then + it is generally most helpful to send the actual object files, + uuencoded if necessary to get them through the mail system. Note + that `bug-binutils@gnu.org' is a mailing list, so you should avoid + sending very large files to it. Making the files available for + anonymous FTP is OK. + + If the source files were produced exclusively using GNU programs + (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to + send the source files rather than the object files. In this case, + be sure to say exactly what version of `gcc', or whatever, was + used to produce the object files. Also say how `gcc', or + whatever, was configured. + + * A description of what behavior you observe that you believe is + incorrect. For example, "It gets a fatal signal." + + Of course, if the bug is that the utility gets a fatal signal, + then we will certainly notice it. But if the bug is incorrect + output, we might not notice unless it is glaringly wrong. You + might as well not give us a chance to make a mistake. + + Even if the problem you experience is a fatal signal, you should + still say so explicitly. Suppose something strange is going on, + such as your copy of the utility is out of synch, or you have + encountered a bug in the C library on your system. (This has + happened!) Your copy might crash and ours would not. If you told + us to expect a crash, then when ours fails to crash, we would know + that the bug was not happening for us. If you had not told us to + expect a crash, then we would not be able to draw any conclusion + from our observations. + + * If you wish to suggest changes to the source, send us context + diffs, as generated by `diff' with the `-u', `-c', or `-p' option. + Always send diffs from the old file to the new file. If you wish + to discuss something in the `ld' source, refer to it by context, + not by line number. + + The line numbers in our development sources will not match those + in your sources. Your line numbers would convey no useful + information to us. + + Here are some things that are not necessary: + + * A description of the envelope of the bug. + + Often people who encounter a bug spend a lot of time investigating + which changes to the input file will make the bug go away and which + changes will not affect it. + + This is often time consuming and not very useful, because the way + we will find the bug is by running a single example under the + debugger with breakpoints, not by pure deduction from a series of + examples. We recommend that you save your time for something else. + + Of course, if you can find a simpler example to report _instead_ + of the original one, that is a convenience for us. Errors in the + output will be easier to spot, running under the debugger will take + less time, and so on. + + However, simplification is not vital; if you do not want to do + this, report the bug anyway and send us the entire test case you + used. + + * A patch for the bug. + + A patch for the bug does help us if it is a good one. But do not + omit the necessary information, such as the test case, on the + assumption that a patch is all we need. We might see problems + with your patch and decide to fix the problem another way, or we + might not understand it at all. + + Sometimes with programs as complicated as the binary utilities it + is very hard to construct an example that will make the program + follow a certain path through the code. If you do not send us the + example, we will not be able to construct one, so we will not be + able to verify that the bug is fixed. + + And if we cannot understand what bug you are trying to fix, or why + your patch should be an improvement, we will not install it. A + test case will help us to understand. + + * A guess about what the bug is or what it depends on. + + Such guesses are usually wrong. Even we cannot guess right about + such things without first using the debugger to find the facts. + diff --git a/binutils/binutils.info-3 b/binutils/binutils.info-3 new file mode 100644 index 0000000..f64b47e --- /dev/null +++ b/binutils/binutils.info-3 @@ -0,0 +1,527 @@ +This is binutils.info, produced by makeinfo version 4.0 from +binutils.texi. + +START-INFO-DIR-ENTRY +* Binutils: (binutils). The GNU binary utilities. +* ar: (binutils)ar. Create, modify, and extract from archives +* nm: (binutils)nm. List symbols from object files +* objcopy: (binutils)objcopy. Copy and translate object files +* objdump: (binutils)objdump. Display information from object files +* ranlib: (binutils)ranlib. Generate index to archive contents +* readelf: (binutils)readelf. Display the contents of ELF format files. +* size: (binutils)size. List section sizes and total size +* strings: (binutils)strings. List printable strings from files +* strip: (binutils)strip. Discard symbols +* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols +* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt +* addr2line: (binutils)addr2line. Convert addresses to file and line +* nlmconv: (binutils)nlmconv. Converts object code into an NLM +* windres: (binutils)windres. Manipulate Windows resources +* dlltool: (binutils)dlltool. Create files needed to build and use DLLs +END-INFO-DIR-ENTRY + + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". + + +File: binutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Reporting Bugs, Up: Top + +GNU Free Documentation License +****************************** + + GNU Free Documentation License + + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies of +this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone the +effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get credit +for their work, while not being considered responsible for +modifications made by others. + + This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft license +designed for free software. + + We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; it +can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + + A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding them. + + The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + + The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + + A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the general +public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input to +text formatters. A copy made in an otherwise Transparent file format +whose markup has been designed to thwart or discourage subsequent +modification by readers is not Transparent. A copy that is not +"Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML or +XML using a publicly available DTD, and standard-conforming simple HTML +designed for human modification. Opaque formats include PostScript, +PDF, proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the machine-generated +HTML produced by some word processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + + You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies of the Document numbering more than +100, and the Document's license notice requires Cover Texts, you must +enclose the copies in covers that carry, clearly and legibly, all these +Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts +on the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present the +full title with all words of the title equally prominent and visible. +You may add other material on the covers in addition. Copying with +changes limited to the covers, as long as they preserve the title of +the Document and satisfy these conditions, can be treated as verbatim +copying in other respects. + + If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + + If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + + It is requested, but not required, that you contact the authors of +the Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release the +Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy of +it. In addition, you must do these things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. B. List on +the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has less than five). C. +State on the Title page the name of the publisher of the Modified +Version, as the publisher. D. Preserve all the copyright notices of +the Document. E. Add an appropriate copyright notice for your +modifications adjacent to the other copyright notices. F. Include, +immediately after the copyright notices, a license notice giving the +public permission to use the Modified Version under the terms of +this License, in the form shown in the Addendum below. G. Preserve in +that license notice the full lists of Invariant Sections and +required Cover Texts given in the Document's license notice. H. +Include an unaltered copy of this License. I. Preserve the section +entitled "History", and its title, and add to it an item stating at +least the title, year, new authors, and publisher of the Modified +Version as given on the Title Page. If there is no section entitled +"History" in the Document, create one stating the title, year, +authors, and publisher of the Document as given on its Title Page, +then add an item describing the Modified Version as stated in the +previous sentence. J. Preserve the network location, if any, given in +the Document for public access to a Transparent copy of the +Document, and likewise the network locations given in the Document +for previous versions it was based on. These may be placed in the +"History" section. You may omit a network location for a work that +was published at least four years before the Document itself, or if +the original publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", +preserve the section's title, and preserve in the section all the +substance and tone of each of the contributor acknowledgements +and/or dedications given therein. L. Preserve all the Invariant +Sections of the Document, unaltered in their text and in their +titles. Section numbers or the equivalent are not considered part +of the section titles. M. Delete any section entitled "Endorsements". +Such a section may not be included in the Modified Version. N. Do +not retitle any existing section as "Endorsements" or to conflict in +title with any Invariant Section. + + If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + + You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties-for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + + You may add a passage of up to five words as a Front-Cover Text, and +a passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or through +arrangements made by) any one entity. If the Document already includes +a cover text for the same cover, previously added by you or by +arrangement made by the same entity you are acting on behalf of, you +may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + + The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of Invariant +Sections in the license notice of the combined work. + + In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy that +is included in the collection, provided that you follow the rules of +this License for verbatim copying of each of the documents in all other +respects. + + You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version of +the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they are +not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. Otherwise +they must appear on covers around the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the original +English version of this License. In case of a disagreement between the +translation and the original English version of this License, the +original English version will prevail. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document +except as expressly provided for under this License. Any other attempt +to copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of +the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + + Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + ADDENDUM: How to use this License for your documents + + To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + + If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no Front-Cover +Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being +LIST"; likewise for Back-Cover Texts. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: binutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top + +Index +***** + +* Menu: + +* .stab: objdump. +* addr2line: addr2line. +* address to file name and line number: addr2line. +* all header information, object file: objdump. +* ar: ar. +* ar compatibility: ar. +* architecture: objdump. +* architectures available: objdump. +* archive contents: ranlib. +* archive headers: objdump. +* archives: ar. +* base files: dlltool. +* bug criteria: Bug Criteria. +* bug reports: Bug Reporting. +* bugs: Reporting Bugs. +* bugs, reporting: Bug Reporting. +* c++filt: c++filt. +* changing object addresses: objcopy. +* changing section address: objcopy. +* changing section LMA: objcopy. +* changing section VMA: objcopy. +* changing start address: objcopy. +* collections of files: ar. +* compatibility, ar: ar. +* contents of archive: ar cmdline. +* crash: Bug Criteria. +* creating archives: ar cmdline. +* cxxfilt: c++filt. +* dates in archive: ar cmdline. +* debug symbols: objdump. +* debugging symbols: nm. +* deleting from archive: ar cmdline. +* demangling C++ symbols: c++filt. +* demangling in nm: nm. +* demangling in objdump <1>: addr2line. +* demangling in objdump: objdump. +* disassembling object code: objdump. +* disassembly architecture: objdump. +* disassembly endianness: objdump. +* disassembly, with source: objdump. +* discarding symbols: strip. +* DLL: dlltool. +* dlltool: dlltool. +* dynamic relocation entries, in object file: objdump. +* dynamic symbol table entries, printing: objdump. +* dynamic symbols: nm. +* ELF core notes: readelf. +* ELF dynamic section information: readelf. +* ELF file header information: readelf. +* ELF file information: readelf. +* ELF object file format: objdump. +* ELF program header information: readelf. +* ELF reloc information: readelf. +* ELF section information: readelf. +* ELF segment information: readelf. +* ELF symbol table information: readelf. +* ELF version sections informations: readelf. +* endianness: objdump. +* error on valid input: Bug Criteria. +* external symbols: nm. +* extract from archive: ar cmdline. +* fatal signal: Bug Criteria. +* file name: nm. +* GNU Free Documentation License: GNU Free Documentation License. +* header information, all: objdump. +* input .def file: dlltool. +* input file name: nm. +* libraries: ar. +* listings strings: strings. +* machine instructions: objdump. +* moving in archive: ar cmdline. +* MRI compatibility, ar: ar scripts. +* name duplication in archive: ar cmdline. +* name length: ar. +* nm: nm. +* nm compatibility: nm. +* nm format: nm. +* not writing archive index: ar cmdline. +* objdump: objdump. +* object code format <1>: addr2line. +* object code format <2>: strings. +* object code format <3>: size. +* object code format <4>: objdump. +* object code format: nm. +* object file header: objdump. +* object file information: objdump. +* object file sections: objdump. +* object formats available: objdump. +* operations on archive: ar cmdline. +* printing from archive: ar cmdline. +* printing strings: strings. +* quick append to archive: ar cmdline. +* radix for section sizes: size. +* ranlib: ranlib. +* readelf: readelf. +* relative placement in archive: ar cmdline. +* relocation entries, in object file: objdump. +* removing symbols: strip. +* repeated names in archive: ar cmdline. +* replacement in archive: ar cmdline. +* reporting bugs: Reporting Bugs. +* scripts, ar: ar scripts. +* section addresses in objdump: objdump. +* section headers: objdump. +* section information: objdump. +* section sizes: size. +* sections, full contents: objdump. +* size: size. +* size display format: size. +* size number format: size. +* sorting symbols: nm. +* source code context: objdump. +* source disassembly: objdump. +* source file name: nm. +* source filenames for object files: objdump. +* stab: objdump. +* start-address: objdump. +* stop-address: objdump. +* strings: strings. +* strings, printing: strings. +* strip: strip. +* symbol index <1>: ranlib. +* symbol index: ar. +* symbol index, listing: nm. +* symbol line numbers: nm. +* symbol table entries, printing: objdump. +* symbols: nm. +* symbols, discarding: strip. +* undefined symbols: nm. +* Unix compatibility, ar: ar cmdline. +* updating an archive: ar cmdline. +* version: Top. +* VMA in objdump: objdump. +* wide output, printing: objdump. +* writing archive index: ar cmdline. + + diff --git a/binutils/config.texi b/binutils/config.texi new file mode 100644 index 0000000..5150b16 --- /dev/null +++ b/binutils/config.texi @@ -0,0 +1 @@ +@set VERSION 2.10.91 diff --git a/binutils/deflex.c b/binutils/deflex.c new file mode 100644 index 0000000..fd9553c --- /dev/null +++ b/binutils/deflex.c @@ -0,0 +1,1844 @@ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_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 YY_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 yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#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 ) + * yyless( 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 yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_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 yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_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 yy_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 yy_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 yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_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 YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 39 +#define YY_END_OF_BUFFER 40 +static yyconst short int yy_accept[189] = + { 0, + 0, 0, 40, 39, 33, 34, 32, 39, 27, 39, + 30, 38, 36, 26, 31, 35, 37, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 0, 28, 27, 0, 29, 30, 26, 31, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 12, 6, 27, 7, 27, 27, 27, 27, 27, + 27, 27, 27, 1, 27, 27, 15, 27, 27, 27, + + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 16, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 14, 27, 27, 18, 20, 27, + 27, 27, 27, 27, 27, 17, 9, 27, 10, 27, + 27, 2, 27, 27, 27, 27, 27, 27, 11, 13, + 27, 5, 27, 27, 21, 27, 8, 27, 27, 27, + 27, 27, 27, 19, 4, 27, 27, 27, 23, 27, + 25, 27, 3, 27, 27, 22, 24, 0 + } ; + +static yyconst int yy_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, 4, 1, 5, 1, 6, 1, 1, 7, 1, + 1, 8, 1, 9, 6, 10, 11, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 6, 13, 1, + 14, 1, 6, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 6, 25, 26, 27, 28, 29, 30, + 6, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 1, 1, 1, 1, 6, 1, 21, 21, 21, 21, + + 21, 21, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 21, + 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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 yyconst int yy_meta[40] = + { 0, + 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, + 3, 4, 1, 1, 3, 4, 4, 4, 4, 4, + 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3 + } ; + +static yyconst short int yy_base[195] = + { 0, + 0, 0, 209, 210, 210, 210, 210, 203, 0, 200, + 0, 210, 210, 0, 0, 210, 210, 190, 176, 24, + 167, 183, 14, 178, 167, 27, 180, 25, 179, 178, + 166, 191, 210, 0, 188, 210, 0, 0, 0, 162, + 27, 160, 160, 27, 175, 160, 165, 171, 161, 159, + 157, 168, 165, 166, 153, 164, 148, 147, 153, 156, + 155, 142, 157, 154, 153, 141, 139, 139, 134, 135, + 132, 144, 34, 144, 129, 130, 138, 141, 131, 125, + 123, 0, 0, 122, 0, 123, 119, 121, 119, 119, + 29, 133, 124, 0, 120, 123, 0, 121, 124, 117, + + 117, 30, 117, 120, 123, 114, 104, 103, 111, 101, + 107, 104, 100, 100, 109, 112, 98, 107, 105, 92, + 97, 94, 92, 0, 92, 89, 98, 85, 77, 83, + 85, 81, 74, 85, 0, 79, 81, 0, 0, 84, + 78, 74, 77, 71, 70, 0, 0, 82, 0, 84, + 67, 0, 79, 78, 65, 57, 78, 61, 0, 0, + 69, 0, 76, 75, 0, 71, 0, 69, 72, 71, + 57, 59, 54, 0, 0, 52, 37, 36, 0, 45, + 0, 44, 0, 41, 40, 0, 0, 210, 66, 68, + 72, 76, 55, 80 + + } ; + +static yyconst short int yy_def[195] = + { 0, + 188, 1, 188, 188, 188, 188, 188, 189, 190, 191, + 192, 188, 188, 193, 194, 188, 188, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 189, 188, 190, 191, 188, 192, 193, 194, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 0, 188, 188, + 188, 188, 188, 188 + + } ; + +static yyconst short int yy_nxt[250] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 4, 14, 15, 16, 17, 9, 18, 19, 20, 21, + 9, 9, 22, 23, 9, 24, 25, 26, 9, 9, + 27, 28, 29, 9, 30, 31, 9, 9, 9, 42, + 46, 47, 50, 43, 53, 61, 65, 54, 55, 95, + 111, 121, 112, 122, 62, 51, 66, 56, 38, 187, + 186, 185, 184, 183, 182, 96, 32, 32, 32, 32, + 34, 34, 35, 35, 35, 35, 37, 181, 37, 37, + 39, 180, 39, 39, 179, 178, 177, 176, 175, 174, + 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, + + 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, + 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, + 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, + 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, + 123, 120, 119, 118, 117, 116, 115, 114, 113, 110, + 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, + 99, 98, 97, 94, 93, 92, 91, 90, 89, 88, + 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, + 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, + 67, 64, 63, 60, 36, 33, 59, 58, 57, 52, + + 49, 48, 45, 44, 41, 40, 36, 33, 188, 3, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188 + } ; + +static yyconst short int yy_chk[250] = + { 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, 1, 1, 1, 1, 1, 20, + 23, 23, 26, 20, 28, 41, 44, 28, 28, 73, + 91, 102, 91, 102, 41, 26, 44, 28, 193, 185, + 184, 182, 180, 178, 177, 73, 189, 189, 189, 189, + 190, 190, 191, 191, 191, 191, 192, 176, 192, 192, + 194, 173, 194, 194, 172, 171, 170, 169, 168, 166, + 164, 163, 161, 158, 157, 156, 155, 154, 153, 151, + + 150, 148, 145, 144, 143, 142, 141, 140, 137, 136, + 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, + 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, + 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, + 103, 101, 100, 99, 98, 96, 95, 93, 92, 90, + 89, 88, 87, 86, 84, 81, 80, 79, 78, 77, + 76, 75, 74, 72, 71, 70, 69, 68, 67, 66, + 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, + 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, + 45, 43, 42, 40, 35, 32, 31, 30, 29, 27, + + 25, 24, 22, 21, 19, 18, 10, 8, 3, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_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 yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "deflex.l" +#define INITIAL 0 +#line 2 "deflex.l" + +/* Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc. + +This file is part of GNU Binutils. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* Contributed by Steve Chamberlain + sac@cygnus.com + +*/ +#define DONTDECLARE_MALLOC +#include "libiberty.h" +#include "defparse.h" +#include "dlltool.h" + +int linenumber; + +#line 511 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#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 YY_READ_BUF_SIZE +#define YY_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( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 34 "deflex.l" + +#line 664 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 189 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 210 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 35 "deflex.l" +{ return NAME;} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 36 "deflex.l" +{ return LIBRARY;} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 37 "deflex.l" +{ return DESCRIPTION;} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 38 "deflex.l" +{ return STACKSIZE;} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 39 "deflex.l" +{ return HEAPSIZE;} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 40 "deflex.l" +{ return CODE;} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 41 "deflex.l" +{ return DATA;} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 42 "deflex.l" +{ return SECTIONS;} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 43 "deflex.l" +{ return EXPORTS;} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 44 "deflex.l" +{ return IMPORTS;} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 45 "deflex.l" +{ return VERSIONK;} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 46 "deflex.l" +{ return BASE;} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 47 "deflex.l" +{ return CONSTANT; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 48 "deflex.l" +{ return NONAME; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 49 "deflex.l" +{ return READ;} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 50 "deflex.l" +{ return WRITE;} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 51 "deflex.l" +{ return EXECUTE;} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 52 "deflex.l" +{ return SHARED;} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 53 "deflex.l" +{ return NONSHARED;} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 54 "deflex.l" +{ return SINGLE;} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 55 "deflex.l" +{ return MULTIPLE;} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 56 "deflex.l" +{ return INITINSTANCE;} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 57 "deflex.l" +{ return INITGLOBAL;} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 58 "deflex.l" +{ return TERMINSTANCE;} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 59 "deflex.l" +{ return TERMGLOBAL;} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 61 "deflex.l" +{ yylval.number = strtol (yytext,0,0); + return NUMBER; } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 64 "deflex.l" +{ + yylval.id = xstrdup (yytext); + return ID; + } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 69 "deflex.l" +{ + yylval.id = xstrdup (yytext+1); + yylval.id[yyleng-2] = 0; + return ID; + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 75 "deflex.l" +{ + yylval.id = xstrdup (yytext+1); + yylval.id[yyleng-2] = 0; + return ID; + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 80 "deflex.l" +{ } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 81 "deflex.l" +{ } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 82 "deflex.l" +{ } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 83 "deflex.l" +{ } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 84 "deflex.l" +{ linenumber ++ ;} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 85 "deflex.l" +{ return '=';} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 86 "deflex.l" +{ return '.';} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 87 "deflex.l" +{ return '@';} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 88 "deflex.l" +{ return ',';} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 89 "deflex.l" +ECHO; + YY_BREAK +#line 954 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_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. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_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). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_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 yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_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) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 189 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 189 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 188); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_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 YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 89 "deflex.l" + +#ifndef yywrap +/* Needed for lex, though not flex. */ +int yywrap() { return 1; } +#endif diff --git a/binutils/defparse.c b/binutils/defparse.c new file mode 100644 index 0000000..f36480f --- /dev/null +++ b/binutils/defparse.c @@ -0,0 +1,1202 @@ + +/* A Bison parser, made from defparse.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define NAME 257 +#define LIBRARY 258 +#define DESCRIPTION 259 +#define STACKSIZE 260 +#define HEAPSIZE 261 +#define CODE 262 +#define DATA 263 +#define SECTIONS 264 +#define EXPORTS 265 +#define IMPORTS 266 +#define VERSIONK 267 +#define BASE 268 +#define CONSTANT 269 +#define READ 270 +#define WRITE 271 +#define EXECUTE 272 +#define SHARED 273 +#define NONSHARED 274 +#define NONAME 275 +#define SINGLE 276 +#define MULTIPLE 277 +#define INITINSTANCE 278 +#define INITGLOBAL 279 +#define TERMINSTANCE 280 +#define TERMGLOBAL 281 +#define ID 282 +#define NUMBER 283 + +#line 1 "defparse.y" + /* defparse.y - parser for .def files */ + +/* Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc. + +This file is part of GNU Binutils. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "bucomm.h" +#include "dlltool.h" + +#line 26 "defparse.y" +typedef union { + char *id; + int number; +} YYSTYPE; +#include <stdio.h> + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 94 +#define YYFLAG -32768 +#define YYNTBASE 34 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 283 ? yytranslate[x] : 55) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 32, 2, 30, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 31, 2, 2, 33, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 3, 5, 9, 14, 17, 20, 24, 28, 31, + 34, 37, 40, 43, 48, 49, 52, 59, 62, 64, + 72, 80, 86, 92, 98, 104, 108, 112, 115, 117, + 120, 124, 126, 128, 129, 132, 133, 135, 137, 139, + 141, 143, 145, 147, 149, 150, 152, 153, 155, 156, + 158, 162, 163, 166, 167, 170, 171, 175, 176, 177, + 181, 183, 185, 187 +}; + +static const short yyrhs[] = { 34, + 35, 0, 35, 0, 3, 49, 52, 0, 4, 49, + 52, 53, 0, 11, 36, 0, 5, 28, 0, 6, + 29, 44, 0, 7, 29, 44, 0, 8, 42, 0, + 9, 42, 0, 10, 40, 0, 12, 38, 0, 13, + 29, 0, 13, 29, 30, 29, 0, 0, 36, 37, + 0, 28, 51, 50, 47, 46, 48, 0, 38, 39, + 0, 39, 0, 28, 31, 28, 30, 28, 30, 28, + 0, 28, 31, 28, 30, 28, 30, 29, 0, 28, + 31, 28, 30, 28, 0, 28, 31, 28, 30, 29, + 0, 28, 30, 28, 30, 28, 0, 28, 30, 28, + 30, 29, 0, 28, 30, 28, 0, 28, 30, 29, + 0, 40, 41, 0, 41, 0, 28, 42, 0, 42, + 43, 45, 0, 45, 0, 32, 0, 0, 32, 29, + 0, 0, 16, 0, 17, 0, 18, 0, 19, 0, + 20, 0, 22, 0, 23, 0, 15, 0, 0, 21, + 0, 0, 9, 0, 0, 28, 0, 28, 30, 28, + 0, 0, 33, 29, 0, 0, 31, 28, 0, 0, + 14, 31, 29, 0, 0, 0, 53, 43, 54, 0, + 24, 0, 25, 0, 26, 0, 27, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 43, 44, 47, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 63, 65, 68, 72, 74, 77, + 79, 80, 81, 82, 83, 84, 85, 88, 90, 93, + 97, 99, 102, 104, 106, 107, 110, 112, 113, 114, + 115, 116, 117, 120, 122, 125, 127, 130, 132, 135, + 136, 142, 145, 147, 150, 152, 155, 156, 159, 161, + 164, 166, 167, 168 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","NAME","LIBRARY", +"DESCRIPTION","STACKSIZE","HEAPSIZE","CODE","DATA","SECTIONS","EXPORTS","IMPORTS", +"VERSIONK","BASE","CONSTANT","READ","WRITE","EXECUTE","SHARED","NONSHARED","NONAME", +"SINGLE","MULTIPLE","INITINSTANCE","INITGLOBAL","TERMINSTANCE","TERMGLOBAL", +"ID","NUMBER","'.'","'='","','","'@'","start","command","explist","expline", +"implist","impline","seclist","secline","attr_list","opt_comma","opt_number", +"attr","opt_CONSTANT","opt_NONAME","opt_DATA","opt_name","opt_ordinal","opt_equal_name", +"opt_base","option_list","option", NULL +}; +#endif + +static const short yyr1[] = { 0, + 34, 34, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 36, 36, 37, 38, 38, 39, + 39, 39, 39, 39, 39, 39, 39, 40, 40, 41, + 42, 42, 43, 43, 44, 44, 45, 45, 45, 45, + 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, + 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, + 54, 54, 54, 54 +}; + +static const short yyr2[] = { 0, + 2, 1, 3, 4, 2, 2, 3, 3, 2, 2, + 2, 2, 2, 4, 0, 2, 6, 2, 1, 7, + 7, 5, 5, 5, 5, 3, 3, 2, 1, 2, + 3, 1, 1, 0, 2, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, + 3, 0, 2, 0, 2, 0, 3, 0, 0, 3, + 1, 1, 1, 1 +}; + +static const short yydefact[] = { 0, + 52, 52, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 2, 50, 58, 58, 6, 36, 36, 37, + 38, 39, 40, 41, 42, 43, 9, 32, 10, 0, + 11, 29, 5, 0, 12, 19, 13, 1, 0, 0, + 3, 59, 0, 7, 8, 33, 0, 30, 28, 56, + 16, 0, 0, 18, 0, 51, 0, 4, 35, 31, + 0, 54, 26, 27, 0, 14, 57, 0, 55, 0, + 47, 0, 0, 61, 62, 63, 64, 60, 53, 46, + 45, 24, 25, 22, 23, 44, 49, 0, 48, 17, + 20, 21, 0, 0 +}; + +static const short yydefgoto[] = { 12, + 13, 33, 51, 35, 36, 31, 32, 27, 47, 44, + 28, 87, 81, 90, 15, 71, 62, 41, 58, 78 +}; + +static const short yypact[] = { 32, + -22, -22, -19, -13, 22, 30, 30, -6,-32768, 26, + 38, 21,-32768, 29, 46, 46,-32768, 36, 36,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, -15,-32768, -15, 30, + -6,-32768, 41, -16, 26,-32768, 40,-32768, 43, 42, +-32768,-32768, 45,-32768,-32768,-32768, 30, -15,-32768, 44, +-32768, -9, 48,-32768, 49,-32768, 50, -14,-32768,-32768, + 52, 39, 47,-32768, 51,-32768,-32768, 31,-32768, 53, + 62, 33, 35,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 69,-32768,-32768, 55,-32768,-32768, 77, 37,-32768,-32768, +-32768,-32768, 87,-32768 +}; + +static const short yypgoto[] = {-32768, + 76,-32768,-32768,-32768, 54,-32768, 59, -7, 34, 72, + 56,-32768,-32768,-32768, 91,-32768,-32768, 78,-32768,-32768 +}; + + +#define YYLAST 103 + + +static const short yytable[] = { 29, + -34, -34, -34, -34, -34, 14, -34, -34, 17, -34, + -34, -34, -34, 52, 53, 18, 46, 46, 63, 64, + 93, 30, 48, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 20, 21, 22, 23, 24, + 19, 25, 26, 34, 74, 75, 76, 77, 39, 40, + 82, 83, 84, 85, 91, 92, 37, 43, 50, 55, + 56, 70, 57, 59, 61, 65, 72, 66, 67, 69, + 73, 79, 80, 86, 88, 89, 94, 38, 54, 49, + 45, 68, 16, 42, 0, 0, 0, 0, 0, 0, + 0, 0, 60 +}; + +static const short yycheck[] = { 7, + 16, 17, 18, 19, 20, 28, 22, 23, 28, 24, + 25, 26, 27, 30, 31, 29, 32, 32, 28, 29, + 0, 28, 30, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, + 29, 22, 23, 28, 24, 25, 26, 27, 30, 14, + 28, 29, 28, 29, 28, 29, 29, 32, 28, 30, + 28, 33, 31, 29, 31, 28, 30, 29, 29, 28, + 30, 29, 21, 15, 30, 9, 0, 12, 35, 31, + 19, 58, 2, 16, -1, -1, -1, -1, -1, -1, + -1, -1, 47 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/misc/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include <alloca.h> +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include <malloc.h> +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include <malloc.h> */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/misc/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 3: +#line 48 "defparse.y" +{ def_name (yyvsp[-1].id, yyvsp[0].number); ; + break;} +case 4: +#line 49 "defparse.y" +{ def_library (yyvsp[-2].id, yyvsp[-1].number); ; + break;} +case 6: +#line 51 "defparse.y" +{ def_description (yyvsp[0].id);; + break;} +case 7: +#line 52 "defparse.y" +{ def_stacksize (yyvsp[-1].number, yyvsp[0].number);; + break;} +case 8: +#line 53 "defparse.y" +{ def_heapsize (yyvsp[-1].number, yyvsp[0].number);; + break;} +case 9: +#line 54 "defparse.y" +{ def_code (yyvsp[0].number);; + break;} +case 10: +#line 55 "defparse.y" +{ def_data (yyvsp[0].number);; + break;} +case 13: +#line 58 "defparse.y" +{ def_version (yyvsp[0].number,0);; + break;} +case 14: +#line 59 "defparse.y" +{ def_version (yyvsp[-2].number,yyvsp[0].number);; + break;} +case 17: +#line 70 "defparse.y" +{ def_exports (yyvsp[-5].id, yyvsp[-4].id, yyvsp[-3].number, yyvsp[-2].number, yyvsp[-1].number, yyvsp[0].number);; + break;} +case 20: +#line 78 "defparse.y" +{ def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); ; + break;} +case 21: +#line 79 "defparse.y" +{ def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); ; + break;} +case 22: +#line 80 "defparse.y" +{ def_import (yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].id, 0); ; + break;} +case 23: +#line 81 "defparse.y" +{ def_import (yyvsp[-4].id,yyvsp[-2].id, 0, 0,yyvsp[0].number); ; + break;} +case 24: +#line 82 "defparse.y" +{ def_import ( 0,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); ; + break;} +case 25: +#line 83 "defparse.y" +{ def_import ( 0,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); ; + break;} +case 26: +#line 84 "defparse.y" +{ def_import ( 0,yyvsp[-2].id, 0,yyvsp[0].id, 0); ; + break;} +case 27: +#line 85 "defparse.y" +{ def_import ( 0,yyvsp[-2].id, 0, 0,yyvsp[0].number); ; + break;} +case 30: +#line 94 "defparse.y" +{ def_section (yyvsp[-1].id,yyvsp[0].number);; + break;} +case 35: +#line 106 "defparse.y" +{ yyval.number=yyvsp[0].number;; + break;} +case 36: +#line 107 "defparse.y" +{ yyval.number=-1;; + break;} +case 37: +#line 111 "defparse.y" +{ yyval.number = 1; ; + break;} +case 38: +#line 112 "defparse.y" +{ yyval.number = 2; ; + break;} +case 39: +#line 113 "defparse.y" +{ yyval.number = 4; ; + break;} +case 40: +#line 114 "defparse.y" +{ yyval.number = 8; ; + break;} +case 41: +#line 115 "defparse.y" +{ yyval.number = 0; ; + break;} +case 42: +#line 116 "defparse.y" +{ yyval.number = 0; ; + break;} +case 43: +#line 117 "defparse.y" +{ yyval.number = 0; ; + break;} +case 44: +#line 121 "defparse.y" +{yyval.number=1;; + break;} +case 45: +#line 122 "defparse.y" +{yyval.number=0;; + break;} +case 46: +#line 126 "defparse.y" +{yyval.number=1;; + break;} +case 47: +#line 127 "defparse.y" +{yyval.number=0;; + break;} +case 48: +#line 131 "defparse.y" +{ yyval.number = 1; ; + break;} +case 49: +#line 132 "defparse.y" +{ yyval.number = 0; ; + break;} +case 50: +#line 135 "defparse.y" +{ yyval.id =yyvsp[0].id; ; + break;} +case 51: +#line 137 "defparse.y" +{ + char *name = xmalloc (strlen (yyvsp[-2].id) + 1 + strlen (yyvsp[0].id) + 1); + sprintf (name, "%s.%s", yyvsp[-2].id, yyvsp[0].id); + yyval.id = name; + ; + break;} +case 52: +#line 142 "defparse.y" +{ yyval.id=""; ; + break;} +case 53: +#line 146 "defparse.y" +{ yyval.number=yyvsp[0].number;; + break;} +case 54: +#line 147 "defparse.y" +{ yyval.number=-1;; + break;} +case 55: +#line 151 "defparse.y" +{ yyval.id = yyvsp[0].id; ; + break;} +case 56: +#line 152 "defparse.y" +{ yyval.id = 0; ; + break;} +case 57: +#line 155 "defparse.y" +{ yyval.number= yyvsp[0].number;; + break;} +case 58: +#line 156 "defparse.y" +{ yyval.number=-1;; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/misc/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 170 "defparse.y" diff --git a/binutils/defparse.h b/binutils/defparse.h new file mode 100644 index 0000000..d1167c6 --- /dev/null +++ b/binutils/defparse.h @@ -0,0 +1,34 @@ +typedef union { + char *id; + int number; +} YYSTYPE; +#define NAME 257 +#define LIBRARY 258 +#define DESCRIPTION 259 +#define STACKSIZE 260 +#define HEAPSIZE 261 +#define CODE 262 +#define DATA 263 +#define SECTIONS 264 +#define EXPORTS 265 +#define IMPORTS 266 +#define VERSIONK 267 +#define BASE 268 +#define CONSTANT 269 +#define READ 270 +#define WRITE 271 +#define EXECUTE 272 +#define SHARED 273 +#define NONSHARED 274 +#define NONAME 275 +#define SINGLE 276 +#define MULTIPLE 277 +#define INITINSTANCE 278 +#define INITGLOBAL 279 +#define TERMINSTANCE 280 +#define TERMGLOBAL 281 +#define ID 282 +#define NUMBER 283 + + +extern YYSTYPE yylval; diff --git a/binutils/nlmheader.c b/binutils/nlmheader.c new file mode 100644 index 0000000..830e6b7 --- /dev/null +++ b/binutils/nlmheader.c @@ -0,0 +1,1991 @@ + +/* A Bison parser, made from nlmheader.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define CHECK 257 +#define CODESTART 258 +#define COPYRIGHT 259 +#define CUSTOM 260 +#define DATE 261 +#define DEBUG 262 +#define DESCRIPTION 263 +#define EXIT 264 +#define EXPORT 265 +#define FLAG_ON 266 +#define FLAG_OFF 267 +#define FULLMAP 268 +#define HELP 269 +#define IMPORT 270 +#define INPUT 271 +#define MAP 272 +#define MESSAGES 273 +#define MODULE 274 +#define MULTIPLE 275 +#define OS_DOMAIN 276 +#define OUTPUT 277 +#define PSEUDOPREEMPTION 278 +#define REENTRANT 279 +#define SCREENNAME 280 +#define SHARELIB 281 +#define STACK 282 +#define START 283 +#define SYNCHRONIZE 284 +#define THREADNAME 285 +#define TYPE 286 +#define VERBOSE 287 +#define VERSIONK 288 +#define XDCDATA 289 +#define STRING 290 +#define QUOTED_STRING 291 + +#line 1 "nlmheader.y" +/* nlmheader.y - parse NLM header specification keywords. + Copyright (C) 1993, 94, 95, 97, 1998 Free Software Foundation, Inc. + +This file is part of GNU Binutils. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Ian Lance Taylor <ian@cygnus.com>. + + This bison file parses the commands recognized by the NetWare NLM + linker, except for lists of object files. It stores the + information in global variables. + + This implementation is based on the description in the NetWare Tool + Maker Specification manual, edition 1.0. */ + +#include <ansidecl.h> +#include <stdio.h> +#include <ctype.h> +#include "bfd.h" +#include "bucomm.h" +#include "nlm/common.h" +#include "nlm/internal.h" +#include "nlmconv.h" + +/* Information is stored in the structures pointed to by these + variables. */ + +Nlm_Internal_Fixed_Header *fixed_hdr; +Nlm_Internal_Variable_Header *var_hdr; +Nlm_Internal_Version_Header *version_hdr; +Nlm_Internal_Copyright_Header *copyright_hdr; +Nlm_Internal_Extended_Header *extended_hdr; + +/* Procedure named by CHECK. */ +char *check_procedure; +/* File named by CUSTOM. */ +char *custom_file; +/* Whether to generate debugging information (DEBUG). */ +boolean debug_info; +/* Procedure named by EXIT. */ +char *exit_procedure; +/* Exported symbols (EXPORT). */ +struct string_list *export_symbols; +/* List of files from INPUT. */ +struct string_list *input_files; +/* Map file name (MAP, FULLMAP). */ +char *map_file; +/* Whether a full map has been requested (FULLMAP). */ +boolean full_map; +/* File named by HELP. */ +char *help_file; +/* Imported symbols (IMPORT). */ +struct string_list *import_symbols; +/* File named by MESSAGES. */ +char *message_file; +/* Autoload module list (MODULE). */ +struct string_list *modules; +/* File named by OUTPUT. */ +char *output_file; +/* File named by SHARELIB. */ +char *sharelib_file; +/* Start procedure name (START). */ +char *start_procedure; +/* VERBOSE. */ +boolean verbose; +/* RPC description file (XDCDATA). */ +char *rpc_file; + +/* The number of serious errors that have occurred. */ +int parse_errors; + +/* The current symbol prefix when reading a list of import or export + symbols. */ +static char *symbol_prefix; + +/* Parser error message handler. */ +#define yyerror(msg) nlmheader_error (msg); + +/* Local functions. */ +static int yylex PARAMS ((void)); +static void nlmlex_file_push PARAMS ((const char *)); +static boolean nlmlex_file_open PARAMS ((const char *)); +static int nlmlex_buf_init PARAMS ((void)); +static char nlmlex_buf_add PARAMS ((int)); +static long nlmlex_get_number PARAMS ((const char *)); +static void nlmheader_identify PARAMS ((void)); +static void nlmheader_warn PARAMS ((const char *, int)); +static void nlmheader_error PARAMS ((const char *)); +static struct string_list * string_list_cons PARAMS ((char *, + struct string_list *)); +static struct string_list * string_list_append PARAMS ((struct string_list *, + struct string_list *)); +static struct string_list * string_list_append1 PARAMS ((struct string_list *, + char *)); +static char *xstrdup PARAMS ((const char *)); + + +#line 112 "nlmheader.y" +typedef union +{ + char *string; + struct string_list *list; +} YYSTYPE; +#include <stdio.h> + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 82 +#define YYFLAG -32768 +#define YYNTBASE 40 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 291 ? yytranslate[x] : 50) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 38, + 39, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 3, 6, 9, 12, 15, 18, 23, 25, + 28, 31, 32, 36, 39, 42, 44, 47, 50, 51, + 55, 58, 60, 63, 66, 69, 71, 73, 76, 78, + 80, 83, 86, 89, 92, 94, 97, 100, 102, 107, + 111, 114, 115, 117, 119, 121, 124, 127, 131, 133, + 134 +}; + +static const short yyrhs[] = { 41, + 0, 0, 42, 41, 0, 3, 36, 0, 4, 36, + 0, 5, 37, 0, 6, 36, 0, 7, 36, 36, + 36, 0, 8, 0, 9, 37, 0, 10, 36, 0, + 0, 11, 43, 45, 0, 12, 36, 0, 13, 36, + 0, 14, 0, 14, 36, 0, 15, 36, 0, 0, + 16, 44, 45, 0, 17, 49, 0, 18, 0, 18, + 36, 0, 19, 36, 0, 20, 49, 0, 21, 0, + 22, 0, 23, 36, 0, 24, 0, 25, 0, 26, + 37, 0, 27, 36, 0, 28, 36, 0, 29, 36, + 0, 30, 0, 31, 37, 0, 32, 36, 0, 33, + 0, 34, 36, 36, 36, 0, 34, 36, 36, 0, + 35, 36, 0, 0, 46, 0, 48, 0, 47, 0, + 46, 48, 0, 46, 47, 0, 38, 36, 39, 0, + 36, 0, 0, 36, 49, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 143, 149, 151, 156, 161, 166, 183, 187, 205, 209, + 225, 229, 234, 237, 242, 247, 252, 257, 261, 266, + 269, 273, 277, 281, 285, 289, 293, 297, 304, 308, + 312, 328, 332, 337, 341, 345, 361, 366, 370, 394, + 410, 418, 423, 433, 438, 442, 446, 454, 465, 481, + 486 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","CHECK", +"CODESTART","COPYRIGHT","CUSTOM","DATE","DEBUG","DESCRIPTION","EXIT","EXPORT", +"FLAG_ON","FLAG_OFF","FULLMAP","HELP","IMPORT","INPUT","MAP","MESSAGES","MODULE", +"MULTIPLE","OS_DOMAIN","OUTPUT","PSEUDOPREEMPTION","REENTRANT","SCREENNAME", +"SHARELIB","STACK","START","SYNCHRONIZE","THREADNAME","TYPE","VERBOSE","VERSIONK", +"XDCDATA","STRING","QUOTED_STRING","'('","')'","file","commands","command","@1", +"@2","symbol_list_opt","symbol_list","symbol_prefix","symbol","string_list", NULL +}; +#endif + +static const short yyr1[] = { 0, + 40, 41, 41, 42, 42, 42, 42, 42, 42, 42, + 42, 43, 42, 42, 42, 42, 42, 42, 44, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 45, 45, 46, 46, 46, 46, 47, 48, 49, + 49 +}; + +static const short yyr2[] = { 0, + 1, 0, 2, 2, 2, 2, 2, 4, 1, 2, + 2, 0, 3, 2, 2, 1, 2, 2, 0, 3, + 2, 1, 2, 2, 2, 1, 1, 2, 1, 1, + 2, 2, 2, 2, 1, 2, 2, 1, 4, 3, + 2, 0, 1, 1, 1, 2, 2, 3, 1, 0, + 2 +}; + +static const short yydefact[] = { 2, + 0, 0, 0, 0, 0, 9, 0, 0, 12, 0, + 0, 16, 0, 19, 50, 22, 0, 50, 26, 27, + 0, 29, 30, 0, 0, 0, 0, 35, 0, 0, + 38, 0, 0, 1, 2, 4, 5, 6, 7, 0, + 10, 11, 42, 14, 15, 17, 18, 42, 50, 21, + 23, 24, 25, 28, 31, 32, 33, 34, 36, 37, + 0, 41, 3, 0, 49, 0, 13, 43, 45, 44, + 20, 51, 40, 8, 0, 47, 46, 39, 48, 0, + 0, 0 +}; + +static const short yydefgoto[] = { 80, + 34, 35, 43, 48, 67, 68, 69, 70, 50 +}; + +static const short yypact[] = { -3, + -1, 1, 2, 4, 5,-32768, 6, 8,-32768, 9, + 10, 11, 12,-32768, 13, 14, 16, 13,-32768,-32768, + 17,-32768,-32768, 18, 20, 21, 22,-32768, 23, 25, +-32768, 26, 27,-32768, -3,-32768,-32768,-32768,-32768, 29, +-32768,-32768, -2,-32768,-32768,-32768,-32768, -2, 13,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 30,-32768,-32768, 31,-32768, 32,-32768, -2,-32768,-32768, +-32768,-32768, 33,-32768, 3,-32768,-32768,-32768,-32768, 38, + 51,-32768 +}; + +static const short yypgoto[] = {-32768, + 19,-32768,-32768,-32768, 24,-32768, -9, 7, 15 +}; + + +#define YYLAST 75 + + +static const short yytable[] = { 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 53, 65, 36, 66, 37, 81, 38, 39, + 40, 79, 41, 42, 44, 45, 46, 47, 49, 51, + 82, 52, 54, 63, 55, 56, 57, 58, 76, 59, + 60, 61, 62, 72, 64, 73, 74, 75, 78, 0, + 0, 71, 0, 0, 77 +}; + +static const short yycheck[] = { 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 18, 36, 36, 38, 36, 0, 37, 36, + 36, 39, 37, 36, 36, 36, 36, 36, 36, 36, + 0, 36, 36, 35, 37, 36, 36, 36, 68, 37, + 36, 36, 36, 49, 36, 36, 36, 36, 36, -1, + -1, 48, -1, -1, 68 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/misc/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include <alloca.h> +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include <malloc.h> +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include <malloc.h> */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/misc/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 4: +#line 158 "nlmheader.y" +{ + check_procedure = yyvsp[0].string; + ; + break;} +case 5: +#line 162 "nlmheader.y" +{ + nlmheader_warn (_("CODESTART is not implemented; sorry"), -1); + free (yyvsp[0].string); + ; + break;} +case 6: +#line 167 "nlmheader.y" +{ + int len; + + strncpy (copyright_hdr->stamp, "CoPyRiGhT=", 10); + len = strlen (yyvsp[0].string); + if (len >= NLM_MAX_COPYRIGHT_MESSAGE_LENGTH) + { + nlmheader_warn (_("copyright string is too long"), + NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1); + len = NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1; + } + copyright_hdr->copyrightMessageLength = len; + strncpy (copyright_hdr->copyrightMessage, yyvsp[0].string, len); + copyright_hdr->copyrightMessage[len] = '\0'; + free (yyvsp[0].string); + ; + break;} +case 7: +#line 184 "nlmheader.y" +{ + custom_file = yyvsp[0].string; + ; + break;} +case 8: +#line 188 "nlmheader.y" +{ + /* We don't set the version stamp here, because we use the + version stamp to detect whether the required VERSION + keyword was given. */ + version_hdr->month = nlmlex_get_number (yyvsp[-2].string); + version_hdr->day = nlmlex_get_number (yyvsp[-1].string); + version_hdr->year = nlmlex_get_number (yyvsp[0].string); + free (yyvsp[-2].string); + free (yyvsp[-1].string); + free (yyvsp[0].string); + if (version_hdr->month < 1 || version_hdr->month > 12) + nlmheader_warn (_("illegal month"), -1); + if (version_hdr->day < 1 || version_hdr->day > 31) + nlmheader_warn (_("illegal day"), -1); + if (version_hdr->year < 1900 || version_hdr->year > 3000) + nlmheader_warn (_("illegal year"), -1); + ; + break;} +case 9: +#line 206 "nlmheader.y" +{ + debug_info = true; + ; + break;} +case 10: +#line 210 "nlmheader.y" +{ + int len; + + len = strlen (yyvsp[0].string); + if (len > NLM_MAX_DESCRIPTION_LENGTH) + { + nlmheader_warn (_("description string is too long"), + NLM_MAX_DESCRIPTION_LENGTH); + len = NLM_MAX_DESCRIPTION_LENGTH; + } + var_hdr->descriptionLength = len; + strncpy (var_hdr->descriptionText, yyvsp[0].string, len); + var_hdr->descriptionText[len] = '\0'; + free (yyvsp[0].string); + ; + break;} +case 11: +#line 226 "nlmheader.y" +{ + exit_procedure = yyvsp[0].string; + ; + break;} +case 12: +#line 230 "nlmheader.y" +{ + symbol_prefix = NULL; + ; + break;} +case 13: +#line 234 "nlmheader.y" +{ + export_symbols = string_list_append (export_symbols, yyvsp[0].list); + ; + break;} +case 14: +#line 238 "nlmheader.y" +{ + fixed_hdr->flags |= nlmlex_get_number (yyvsp[0].string); + free (yyvsp[0].string); + ; + break;} +case 15: +#line 243 "nlmheader.y" +{ + fixed_hdr->flags &=~ nlmlex_get_number (yyvsp[0].string); + free (yyvsp[0].string); + ; + break;} +case 16: +#line 248 "nlmheader.y" +{ + map_file = ""; + full_map = true; + ; + break;} +case 17: +#line 253 "nlmheader.y" +{ + map_file = yyvsp[0].string; + full_map = true; + ; + break;} +case 18: +#line 258 "nlmheader.y" +{ + help_file = yyvsp[0].string; + ; + break;} +case 19: +#line 262 "nlmheader.y" +{ + symbol_prefix = NULL; + ; + break;} +case 20: +#line 266 "nlmheader.y" +{ + import_symbols = string_list_append (import_symbols, yyvsp[0].list); + ; + break;} +case 21: +#line 270 "nlmheader.y" +{ + input_files = string_list_append (input_files, yyvsp[0].list); + ; + break;} +case 22: +#line 274 "nlmheader.y" +{ + map_file = ""; + ; + break;} +case 23: +#line 278 "nlmheader.y" +{ + map_file = yyvsp[0].string; + ; + break;} +case 24: +#line 282 "nlmheader.y" +{ + message_file = yyvsp[0].string; + ; + break;} +case 25: +#line 286 "nlmheader.y" +{ + modules = string_list_append (modules, yyvsp[0].list); + ; + break;} +case 26: +#line 290 "nlmheader.y" +{ + fixed_hdr->flags |= 0x2; + ; + break;} +case 27: +#line 294 "nlmheader.y" +{ + fixed_hdr->flags |= 0x10; + ; + break;} +case 28: +#line 298 "nlmheader.y" +{ + if (output_file == NULL) + output_file = yyvsp[0].string; + else + nlmheader_warn (_("ignoring duplicate OUTPUT statement"), -1); + ; + break;} +case 29: +#line 305 "nlmheader.y" +{ + fixed_hdr->flags |= 0x8; + ; + break;} +case 30: +#line 309 "nlmheader.y" +{ + fixed_hdr->flags |= 0x1; + ; + break;} +case 31: +#line 313 "nlmheader.y" +{ + int len; + + len = strlen (yyvsp[0].string); + if (len >= NLM_MAX_SCREEN_NAME_LENGTH) + { + nlmheader_warn (_("screen name is too long"), + NLM_MAX_SCREEN_NAME_LENGTH); + len = NLM_MAX_SCREEN_NAME_LENGTH; + } + var_hdr->screenNameLength = len; + strncpy (var_hdr->screenName, yyvsp[0].string, len); + var_hdr->screenName[NLM_MAX_SCREEN_NAME_LENGTH] = '\0'; + free (yyvsp[0].string); + ; + break;} +case 32: +#line 329 "nlmheader.y" +{ + sharelib_file = yyvsp[0].string; + ; + break;} +case 33: +#line 333 "nlmheader.y" +{ + var_hdr->stackSize = nlmlex_get_number (yyvsp[0].string); + free (yyvsp[0].string); + ; + break;} +case 34: +#line 338 "nlmheader.y" +{ + start_procedure = yyvsp[0].string; + ; + break;} +case 35: +#line 342 "nlmheader.y" +{ + fixed_hdr->flags |= 0x4; + ; + break;} +case 36: +#line 346 "nlmheader.y" +{ + int len; + + len = strlen (yyvsp[0].string); + if (len >= NLM_MAX_THREAD_NAME_LENGTH) + { + nlmheader_warn (_("thread name is too long"), + NLM_MAX_THREAD_NAME_LENGTH); + len = NLM_MAX_THREAD_NAME_LENGTH; + } + var_hdr->threadNameLength = len; + strncpy (var_hdr->threadName, yyvsp[0].string, len); + var_hdr->threadName[len] = '\0'; + free (yyvsp[0].string); + ; + break;} +case 37: +#line 362 "nlmheader.y" +{ + fixed_hdr->moduleType = nlmlex_get_number (yyvsp[0].string); + free (yyvsp[0].string); + ; + break;} +case 38: +#line 367 "nlmheader.y" +{ + verbose = true; + ; + break;} +case 39: +#line 371 "nlmheader.y" +{ + long val; + + strncpy (version_hdr->stamp, "VeRsIoN#", 8); + version_hdr->majorVersion = nlmlex_get_number (yyvsp[-2].string); + val = nlmlex_get_number (yyvsp[-1].string); + if (val < 0 || val > 99) + nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), + -1); + else + version_hdr->minorVersion = val; + val = nlmlex_get_number (yyvsp[0].string); + if (val < 0) + nlmheader_warn (_("illegal revision number (must be between 0 and 26)"), + -1); + else if (val > 26) + version_hdr->revision = 0; + else + version_hdr->revision = val; + free (yyvsp[-2].string); + free (yyvsp[-1].string); + free (yyvsp[0].string); + ; + break;} +case 40: +#line 395 "nlmheader.y" +{ + long val; + + strncpy (version_hdr->stamp, "VeRsIoN#", 8); + version_hdr->majorVersion = nlmlex_get_number (yyvsp[-1].string); + val = nlmlex_get_number (yyvsp[0].string); + if (val < 0 || val > 99) + nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"), + -1); + else + version_hdr->minorVersion = val; + version_hdr->revision = 0; + free (yyvsp[-1].string); + free (yyvsp[0].string); + ; + break;} +case 41: +#line 411 "nlmheader.y" +{ + rpc_file = yyvsp[0].string; + ; + break;} +case 42: +#line 420 "nlmheader.y" +{ + yyval.list = NULL; + ; + break;} +case 43: +#line 424 "nlmheader.y" +{ + yyval.list = yyvsp[0].list; + ; + break;} +case 44: +#line 435 "nlmheader.y" +{ + yyval.list = string_list_cons (yyvsp[0].string, NULL); + ; + break;} +case 45: +#line 439 "nlmheader.y" +{ + yyval.list = NULL; + ; + break;} +case 46: +#line 443 "nlmheader.y" +{ + yyval.list = string_list_append1 (yyvsp[-1].list, yyvsp[0].string); + ; + break;} +case 47: +#line 447 "nlmheader.y" +{ + yyval.list = yyvsp[-1].list; + ; + break;} +case 48: +#line 456 "nlmheader.y" +{ + if (symbol_prefix != NULL) + free (symbol_prefix); + symbol_prefix = yyvsp[-1].string; + ; + break;} +case 49: +#line 467 "nlmheader.y" +{ + if (symbol_prefix == NULL) + yyval.string = yyvsp[0].string; + else + { + yyval.string = xmalloc (strlen (symbol_prefix) + strlen (yyvsp[0].string) + 2); + sprintf (yyval.string, "%s@%s", symbol_prefix, yyvsp[0].string); + free (yyvsp[0].string); + } + ; + break;} +case 50: +#line 483 "nlmheader.y" +{ + yyval.list = NULL; + ; + break;} +case 51: +#line 487 "nlmheader.y" +{ + yyval.list = string_list_cons (yyvsp[-1].string, yyvsp[0].list); + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/misc/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 492 "nlmheader.y" + + +/* If strerror is just a macro, we want to use the one from libiberty + since it will handle undefined values. */ +#undef strerror +extern char *strerror (); + +/* The lexer is simple, too simple for flex. Keywords are only + recognized at the start of lines. Everything else must be an + argument. A comma is treated as whitespace. */ + +/* The states the lexer can be in. */ + +enum lex_state +{ + /* At the beginning of a line. */ + BEGINNING_OF_LINE, + /* In the middle of a line. */ + IN_LINE +}; + +/* We need to keep a stack of files to handle file inclusion. */ + +struct input +{ + /* The file to read from. */ + FILE *file; + /* The name of the file. */ + char *name; + /* The current line number. */ + int lineno; + /* The current state. */ + enum lex_state state; + /* The next file on the stack. */ + struct input *next; +}; + +/* The current input file. */ + +static struct input current; + +/* The character which introduces comments. */ +#define COMMENT_CHAR '#' + +/* Start the lexer going on the main input file. */ + +boolean +nlmlex_file (name) + const char *name; +{ + current.next = NULL; + return nlmlex_file_open (name); +} + +/* Start the lexer going on a subsidiary input file. */ + +static void +nlmlex_file_push (name) + const char *name; +{ + struct input *push; + + push = (struct input *) xmalloc (sizeof (struct input)); + *push = current; + if (nlmlex_file_open (name)) + current.next = push; + else + { + current = *push; + free (push); + } +} + +/* Start lexing from a file. */ + +static boolean +nlmlex_file_open (name) + const char *name; +{ + current.file = fopen (name, "r"); + if (current.file == NULL) + { + fprintf (stderr, "%s:%s: %s\n", program_name, name, strerror (errno)); + ++parse_errors; + return false; + } + current.name = xstrdup (name); + current.lineno = 1; + current.state = BEGINNING_OF_LINE; + return true; +} + +/* Table used to turn keywords into tokens. */ + +struct keyword_tokens_struct +{ + const char *keyword; + int token; +}; + +struct keyword_tokens_struct keyword_tokens[] = +{ + { "CHECK", CHECK }, + { "CODESTART", CODESTART }, + { "COPYRIGHT", COPYRIGHT }, + { "CUSTOM", CUSTOM }, + { "DATE", DATE }, + { "DEBUG", DEBUG }, + { "DESCRIPTION", DESCRIPTION }, + { "EXIT", EXIT }, + { "EXPORT", EXPORT }, + { "FLAG_ON", FLAG_ON }, + { "FLAG_OFF", FLAG_OFF }, + { "FULLMAP", FULLMAP }, + { "HELP", HELP }, + { "IMPORT", IMPORT }, + { "INPUT", INPUT }, + { "MAP", MAP }, + { "MESSAGES", MESSAGES }, + { "MODULE", MODULE }, + { "MULTIPLE", MULTIPLE }, + { "OS_DOMAIN", OS_DOMAIN }, + { "OUTPUT", OUTPUT }, + { "PSEUDOPREEMPTION", PSEUDOPREEMPTION }, + { "REENTRANT", REENTRANT }, + { "SCREENNAME", SCREENNAME }, + { "SHARELIB", SHARELIB }, + { "STACK", STACK }, + { "STACKSIZE", STACK }, + { "START", START }, + { "SYNCHRONIZE", SYNCHRONIZE }, + { "THREADNAME", THREADNAME }, + { "TYPE", TYPE }, + { "VERBOSE", VERBOSE }, + { "VERSION", VERSIONK }, + { "XDCDATA", XDCDATA } +}; + +#define KEYWORD_COUNT (sizeof (keyword_tokens) / sizeof (keyword_tokens[0])) + +/* The lexer accumulates strings in these variables. */ +static char *lex_buf; +static int lex_size; +static int lex_pos; + +/* Start accumulating strings into the buffer. */ +#define BUF_INIT() \ + ((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ())) + +static int +nlmlex_buf_init () +{ + lex_size = 10; + lex_buf = xmalloc (lex_size + 1); + lex_pos = 0; + return 0; +} + +/* Finish a string in the buffer. */ +#define BUF_FINISH() ((void) (lex_buf[lex_pos] = '\0')) + +/* Accumulate a character into the buffer. */ +#define BUF_ADD(c) \ + ((void) (lex_pos < lex_size \ + ? lex_buf[lex_pos++] = (c) \ + : nlmlex_buf_add (c))) + +static char +nlmlex_buf_add (c) + int c; +{ + if (lex_pos >= lex_size) + { + lex_size *= 2; + lex_buf = xrealloc (lex_buf, lex_size + 1); + } + + return lex_buf[lex_pos++] = c; +} + +/* The lexer proper. This is called by the bison generated parsing + code. */ + +static int +yylex () +{ + int c; + +tail_recurse: + + c = getc (current.file); + + /* Commas are treated as whitespace characters. */ + while (isspace ((unsigned char) c) || c == ',') + { + current.state = IN_LINE; + if (c == '\n') + { + ++current.lineno; + current.state = BEGINNING_OF_LINE; + } + c = getc (current.file); + } + + /* At the end of the file we either pop to the previous file or + finish up. */ + if (c == EOF) + { + fclose (current.file); + free (current.name); + if (current.next == NULL) + return 0; + else + { + struct input *next; + + next = current.next; + current = *next; + free (next); + goto tail_recurse; + } + } + + /* A comment character always means to drop everything until the + next newline. */ + if (c == COMMENT_CHAR) + { + do + { + c = getc (current.file); + } + while (c != '\n'); + ++current.lineno; + current.state = BEGINNING_OF_LINE; + goto tail_recurse; + } + + /* An '@' introduces an include file. */ + if (c == '@') + { + do + { + c = getc (current.file); + if (c == '\n') + ++current.lineno; + } + while (isspace ((unsigned char) c)); + BUF_INIT (); + while (! isspace ((unsigned char) c) && c != EOF) + { + BUF_ADD (c); + c = getc (current.file); + } + BUF_FINISH (); + + ungetc (c, current.file); + + nlmlex_file_push (lex_buf); + goto tail_recurse; + } + + /* A non-space character at the start of a line must be the start of + a keyword. */ + if (current.state == BEGINNING_OF_LINE) + { + BUF_INIT (); + while (isalnum ((unsigned char) c) || c == '_') + { + if (islower ((unsigned char) c)) + BUF_ADD (toupper ((unsigned char) c)); + else + BUF_ADD (c); + c = getc (current.file); + } + BUF_FINISH (); + + if (c != EOF && ! isspace ((unsigned char) c) && c != ',') + { + nlmheader_identify (); + fprintf (stderr, _("%s:%d: illegal character in keyword: %c\n"), + current.name, current.lineno, c); + } + else + { + unsigned int i; + + for (i = 0; i < KEYWORD_COUNT; i++) + { + if (lex_buf[0] == keyword_tokens[i].keyword[0] + && strcmp (lex_buf, keyword_tokens[i].keyword) == 0) + { + /* Pushing back the final whitespace avoids worrying + about \n here. */ + ungetc (c, current.file); + current.state = IN_LINE; + return keyword_tokens[i].token; + } + } + + nlmheader_identify (); + fprintf (stderr, _("%s:%d: unrecognized keyword: %s\n"), + current.name, current.lineno, lex_buf); + } + + ++parse_errors; + /* Treat the rest of this line as a comment. */ + ungetc (COMMENT_CHAR, current.file); + goto tail_recurse; + } + + /* Parentheses just represent themselves. */ + if (c == '(' || c == ')') + return c; + + /* Handle quoted strings. */ + if (c == '"' || c == '\'') + { + int quote; + int start_lineno; + + quote = c; + start_lineno = current.lineno; + + c = getc (current.file); + BUF_INIT (); + while (c != quote && c != EOF) + { + BUF_ADD (c); + if (c == '\n') + ++current.lineno; + c = getc (current.file); + } + BUF_FINISH (); + + if (c == EOF) + { + nlmheader_identify (); + fprintf (stderr, _("%s:%d: end of file in quoted string\n"), + current.name, start_lineno); + ++parse_errors; + } + + /* FIXME: Possible memory leak. */ + yylval.string = xstrdup (lex_buf); + return QUOTED_STRING; + } + + /* Gather a generic argument. */ + BUF_INIT (); + while (! isspace (c) + && c != ',' + && c != COMMENT_CHAR + && c != '(' + && c != ')') + { + BUF_ADD (c); + c = getc (current.file); + } + BUF_FINISH (); + + ungetc (c, current.file); + + /* FIXME: Possible memory leak. */ + yylval.string = xstrdup (lex_buf); + return STRING; +} + +/* Get a number from a string. */ + +static long +nlmlex_get_number (s) + const char *s; +{ + long ret; + char *send; + + ret = strtol (s, &send, 10); + if (*send != '\0') + nlmheader_warn (_("bad number"), -1); + return ret; +} + +/* Prefix the nlmconv warnings with a note as to where they come from. + We don't use program_name on every warning, because then some + versions of the emacs next-error function can't recognize the line + number. */ + +static void +nlmheader_identify () +{ + static int done; + + if (! done) + { + fprintf (stderr, _("%s: problems in NLM command language input:\n"), + program_name); + done = 1; + } +} + +/* Issue a warning. */ + +static void +nlmheader_warn (s, imax) + const char *s; + int imax; +{ + nlmheader_identify (); + fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s); + if (imax != -1) + fprintf (stderr, " (max %d)", imax); + fprintf (stderr, "\n"); +} + +/* Report an error. */ + +static void +nlmheader_error (s) + const char *s; +{ + nlmheader_warn (s, -1); + ++parse_errors; +} + +/* Add a string to a string list. */ + +static struct string_list * +string_list_cons (s, l) + char *s; + struct string_list *l; +{ + struct string_list *ret; + + ret = (struct string_list *) xmalloc (sizeof (struct string_list)); + ret->next = l; + ret->string = s; + return ret; +} + +/* Append a string list to another string list. */ + +static struct string_list * +string_list_append (l1, l2) + struct string_list *l1; + struct string_list *l2; +{ + register struct string_list **pp; + + for (pp = &l1; *pp != NULL; pp = &(*pp)->next) + ; + *pp = l2; + return l1; +} + +/* Append a string to a string list. */ + +static struct string_list * +string_list_append1 (l, s) + struct string_list *l; + char *s; +{ + struct string_list *n; + register struct string_list **pp; + + n = (struct string_list *) xmalloc (sizeof (struct string_list)); + n->next = NULL; + n->string = s; + for (pp = &l; *pp != NULL; pp = &(*pp)->next) + ; + *pp = n; + return l; +} + +/* Duplicate a string in memory. */ + +static char * +xstrdup (s) + const char *s; +{ + unsigned long len; + char *ret; + + len = strlen (s); + ret = xmalloc (len + 1); + strcpy (ret, s); + return ret; +} diff --git a/binutils/nlmheader.h b/binutils/nlmheader.h new file mode 100644 index 0000000..8c4f2c9 --- /dev/null +++ b/binutils/nlmheader.h @@ -0,0 +1,43 @@ +typedef union +{ + char *string; + struct string_list *list; +} YYSTYPE; +#define CHECK 257 +#define CODESTART 258 +#define COPYRIGHT 259 +#define CUSTOM 260 +#define DATE 261 +#define DEBUG 262 +#define DESCRIPTION 263 +#define EXIT 264 +#define EXPORT 265 +#define FLAG_ON 266 +#define FLAG_OFF 267 +#define FULLMAP 268 +#define HELP 269 +#define IMPORT 270 +#define INPUT 271 +#define MAP 272 +#define MESSAGES 273 +#define MODULE 274 +#define MULTIPLE 275 +#define OS_DOMAIN 276 +#define OUTPUT 277 +#define PSEUDOPREEMPTION 278 +#define REENTRANT 279 +#define SCREENNAME 280 +#define SHARELIB 281 +#define STACK 282 +#define START 283 +#define SYNCHRONIZE 284 +#define THREADNAME 285 +#define TYPE 286 +#define VERBOSE 287 +#define VERSIONK 288 +#define XDCDATA 289 +#define STRING 290 +#define QUOTED_STRING 291 + + +extern YYSTYPE yylval; diff --git a/binutils/rclex.c b/binutils/rclex.c new file mode 100644 index 0000000..6508e1d --- /dev/null +++ b/binutils/rclex.c @@ -0,0 +1,2589 @@ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_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 YY_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 yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#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 ) + * yyless( 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 yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_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 yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_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 yy_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 yy_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 yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_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 YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 86 +#define YY_END_OF_BUFFER 87 +static yyconst short int yy_accept[470] = + { 0, + 0, 0, 87, 85, 84, 83, 85, 78, 80, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 2, 4, 84, + 0, 81, 78, 80, 79, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 81, 0, 82, 11, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + + 82, 82, 82, 82, 82, 3, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 76, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 41, 82, 82, + 82, 53, 42, 82, 82, 82, 82, 82, 82, 82, + 46, 82, 82, 82, 82, 82, 82, 71, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + + 82, 82, 82, 7, 82, 82, 82, 38, 1, 82, + 82, 82, 82, 82, 18, 82, 82, 25, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 70, + 82, 82, 39, 40, 82, 82, 82, 82, 82, 30, + 82, 82, 82, 82, 82, 82, 50, 82, 82, 82, + 82, 82, 34, 82, 82, 9, 82, 82, 19, 82, + 68, 82, 82, 82, 82, 82, 82, 12, 0, 82, + 82, 82, 82, 82, 82, 82, 13, 82, 14, 82, + 82, 82, 82, 65, 82, 82, 82, 52, 82, 72, + 82, 82, 82, 82, 82, 82, 47, 82, 82, 82, + + 82, 82, 82, 82, 82, 82, 58, 82, 82, 36, + 82, 82, 82, 82, 82, 82, 82, 82, 0, 82, + 0, 77, 17, 82, 82, 51, 82, 10, 82, 82, + 82, 82, 16, 82, 82, 82, 82, 82, 82, 82, + 29, 82, 82, 82, 82, 82, 82, 82, 73, 82, + 31, 82, 82, 82, 82, 82, 82, 45, 6, 82, + 82, 82, 82, 77, 82, 23, 24, 82, 15, 82, + 27, 82, 82, 66, 82, 28, 54, 43, 82, 82, + 82, 48, 82, 69, 8, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + + 64, 82, 82, 82, 82, 56, 82, 82, 82, 82, + 35, 49, 82, 82, 82, 82, 20, 82, 82, 82, + 82, 82, 82, 82, 82, 74, 82, 82, 82, 32, + 82, 82, 37, 82, 82, 82, 82, 82, 82, 75, + 82, 67, 61, 82, 82, 82, 33, 59, 60, 5, + 21, 82, 82, 82, 82, 55, 57, 82, 82, 82, + 26, 63, 82, 82, 82, 62, 22, 44, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, + 1, 1, 1, 7, 1, 1, 1, 8, 8, 8, + 9, 8, 8, 8, 8, 8, 8, 1, 1, 1, + 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 19, 26, 27, 28, 29, 30, 19, 31, 32, 19, + 1, 1, 1, 1, 1, 1, 33, 33, 33, 33, + + 33, 33, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 33, + 19, 19, 34, 1, 35, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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 yyconst int yy_meta[36] = + { 0, + 1, 2, 3, 2, 1, 4, 2, 5, 5, 5, + 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, + 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 5, 1, 1 + } ; + +static yyconst short int yy_base[476] = + { 0, + 0, 0, 515, 516, 34, 516, 509, 0, 492, 25, + 26, 45, 25, 28, 24, 486, 497, 49, 0, 40, + 43, 486, 51, 66, 67, 482, 35, 516, 516, 81, + 503, 84, 0, 486, 516, 0, 494, 477, 492, 475, + 74, 474, 477, 475, 46, 489, 69, 484, 471, 481, + 55, 477, 481, 466, 67, 469, 83, 83, 467, 477, + 464, 478, 464, 459, 475, 470, 74, 453, 81, 457, + 86, 76, 468, 467, 465, 452, 452, 458, 95, 461, + 453, 447, 446, 106, 466, 456, 0, 451, 444, 449, + 448, 443, 452, 435, 436, 449, 433, 448, 430, 426, + + 429, 430, 433, 441, 424, 0, 423, 436, 435, 420, + 415, 417, 427, 419, 420, 424, 412, 428, 423, 410, + 424, 405, 406, 407, 419, 409, 0, 402, 409, 416, + 414, 410, 408, 415, 393, 399, 412, 406, 392, 401, + 397, 391, 387, 388, 386, 392, 394, 103, 383, 387, + 399, 388, 389, 396, 385, 377, 379, 376, 373, 376, + 370, 374, 387, 368, 363, 98, 381, 0, 379, 367, + 363, 0, 0, 362, 363, 360, 358, 375, 361, 356, + 105, 373, 372, 351, 355, 355, 349, 0, 366, 352, + 347, 346, 352, 346, 343, 356, 346, 354, 356, 352, + + 347, 344, 349, 0, 335, 344, 350, 0, 0, 334, + 115, 334, 345, 119, 0, 345, 331, 0, 328, 326, + 336, 325, 336, 328, 327, 320, 317, 313, 330, 0, + 330, 331, 0, 0, 327, 322, 329, 314, 314, 0, + 114, 305, 307, 318, 322, 318, 0, 321, 318, 107, + 318, 318, 0, 306, 316, 0, 316, 308, 0, 294, + 0, 298, 307, 294, 291, 304, 304, 0, 132, 137, + 293, 287, 290, 300, 288, 290, 0, 293, 295, 295, + 276, 292, 295, 0, 293, 278, 276, 0, 277, 0, + 270, 283, 267, 285, 270, 281, 0, 280, 279, 271, + + 265, 277, 261, 257, 259, 257, 0, 274, 256, 0, + 255, 254, 258, 248, 269, 268, 265, 258, 270, 143, + 269, 149, 0, 259, 241, 0, 240, 0, 259, 238, + 258, 239, 0, 250, 237, 250, 236, 231, 247, 246, + 0, 249, 247, 247, 234, 227, 240, 225, 0, 222, + 0, 223, 222, 239, 224, 237, 218, 227, 0, 216, + 215, 222, 217, 235, 213, 0, 0, 209, 0, 226, + 0, 209, 203, 0, 216, 0, 0, 0, 212, 206, + 211, 0, 220, 0, 0, 215, 204, 199, 200, 199, + 213, 199, 199, 197, 206, 208, 207, 199, 188, 194, + + 192, 188, 188, 190, 196, 0, 198, 182, 184, 182, + 0, 0, 184, 181, 188, 176, 0, 177, 171, 172, + 170, 183, 186, 181, 171, 0, 183, 171, 164, 0, + 167, 175, 0, 164, 160, 155, 157, 156, 159, 0, + 155, 0, 0, 160, 165, 156, 0, 0, 0, 0, + 0, 141, 150, 141, 139, 0, 0, 128, 122, 126, + 0, 0, 109, 91, 79, 0, 0, 0, 516, 156, + 161, 65, 166, 171, 176 + } ; + +static yyconst short int yy_def[476] = + { 0, + 469, 1, 469, 469, 469, 469, 470, 471, 472, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 469, 469, 469, + 470, 469, 471, 472, 469, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 469, 470, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 469, 474, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 475, 474, + 475, 474, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 475, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 0, 469, + 469, 469, 469, 469, 469 + } ; + +static yyconst short int yy_nxt[552] = + { 0, + 4, 5, 6, 5, 7, 8, 4, 9, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, + 20, 21, 22, 19, 23, 24, 25, 19, 26, 27, + 19, 19, 19, 28, 29, 30, 37, 30, 50, 41, + 52, 55, 51, 42, 81, 38, 43, 56, 82, 63, + 53, 39, 83, 40, 44, 95, 67, 64, 54, 96, + 59, 45, 60, 65, 103, 46, 68, 66, 47, 34, + 61, 62, 48, 49, 70, 73, 71, 74, 76, 72, + 77, 104, 30, 78, 30, 84, 90, 108, 85, 91, + 98, 99, 111, 75, 79, 113, 123, 109, 126, 129, + + 124, 131, 132, 114, 139, 468, 112, 84, 127, 130, + 85, 205, 225, 467, 206, 241, 269, 269, 242, 270, + 140, 226, 243, 295, 227, 228, 141, 229, 207, 273, + 304, 466, 274, 269, 269, 305, 319, 465, 321, 296, + 321, 322, 36, 321, 321, 464, 321, 322, 36, 321, + 321, 463, 321, 322, 36, 321, 31, 31, 462, 31, + 31, 33, 33, 461, 33, 33, 36, 460, 459, 36, + 36, 320, 320, 458, 320, 320, 321, 321, 457, 456, + 321, 455, 454, 453, 452, 451, 450, 449, 448, 447, + 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, + + 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, + 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, + 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, + 406, 405, 404, 403, 402, 401, 400, 399, 398, 364, + 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, + 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, + 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, + 367, 366, 365, 364, 364, 363, 362, 361, 360, 359, + 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, + 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, + + 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, + 328, 327, 326, 325, 324, 323, 318, 317, 316, 315, + 314, 313, 312, 311, 310, 309, 308, 307, 306, 303, + 302, 301, 300, 299, 298, 297, 294, 293, 292, 291, + 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, + 280, 279, 278, 277, 276, 275, 272, 271, 268, 267, + 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, + 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, + 246, 245, 244, 240, 239, 238, 237, 236, 235, 234, + 233, 232, 231, 230, 224, 223, 222, 221, 220, 219, + + 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, + 208, 204, 203, 202, 201, 200, 199, 198, 197, 196, + 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, + 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, + 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, + 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, + 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, + 32, 145, 144, 143, 142, 138, 137, 136, 135, 134, + 133, 128, 125, 122, 121, 120, 119, 118, 117, 116, + 115, 110, 107, 106, 105, 102, 101, 100, 97, 94, + + 93, 92, 89, 88, 87, 86, 35, 32, 80, 69, + 58, 57, 35, 32, 469, 3, 469, 469, 469, 469, + 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, + 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, + 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, + 469 + } ; + +static yyconst short int yy_chk[552] = + { 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, 1, 5, 10, 5, 13, 11, + 14, 15, 13, 11, 27, 10, 11, 15, 27, 20, + 14, 10, 27, 10, 12, 45, 21, 20, 14, 45, + 18, 12, 18, 20, 51, 12, 21, 20, 12, 472, + 18, 18, 12, 12, 23, 24, 23, 24, 25, 23, + 25, 51, 30, 25, 30, 32, 41, 55, 32, 41, + 47, 47, 57, 24, 25, 58, 67, 55, 69, 71, + + 67, 72, 72, 58, 79, 465, 57, 84, 69, 71, + 84, 148, 166, 464, 148, 181, 211, 211, 181, 211, + 79, 166, 181, 241, 166, 166, 79, 166, 148, 214, + 250, 463, 214, 269, 269, 250, 269, 460, 270, 241, + 270, 270, 270, 270, 320, 459, 320, 320, 320, 320, + 322, 458, 322, 322, 322, 322, 470, 470, 455, 470, + 470, 471, 471, 454, 471, 471, 473, 453, 452, 473, + 473, 474, 474, 446, 474, 474, 475, 475, 445, 444, + 475, 441, 439, 438, 437, 436, 435, 434, 432, 431, + 429, 428, 427, 425, 424, 423, 422, 421, 420, 419, + + 418, 416, 415, 414, 413, 410, 409, 408, 407, 405, + 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, + 394, 393, 392, 391, 390, 389, 388, 387, 386, 383, + 381, 380, 379, 375, 373, 372, 370, 368, 365, 364, + 363, 362, 361, 360, 358, 357, 356, 355, 354, 353, + 352, 350, 348, 347, 346, 345, 344, 343, 342, 340, + 339, 338, 337, 336, 335, 334, 332, 331, 330, 329, + 327, 325, 324, 321, 319, 318, 317, 316, 315, 314, + 313, 312, 311, 309, 308, 306, 305, 304, 303, 302, + 301, 300, 299, 298, 296, 295, 294, 293, 292, 291, + + 289, 287, 286, 285, 283, 282, 281, 280, 279, 278, + 276, 275, 274, 273, 272, 271, 267, 266, 265, 264, + 263, 262, 260, 258, 257, 255, 254, 252, 251, 249, + 248, 246, 245, 244, 243, 242, 239, 238, 237, 236, + 235, 232, 231, 229, 228, 227, 226, 225, 224, 223, + 222, 221, 220, 219, 217, 216, 213, 212, 210, 207, + 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, + 195, 194, 193, 192, 191, 190, 189, 187, 186, 185, + 184, 183, 182, 180, 179, 178, 177, 176, 175, 174, + 171, 170, 169, 167, 165, 164, 163, 162, 161, 160, + + 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, + 149, 147, 146, 145, 144, 143, 142, 141, 140, 139, + 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, + 128, 126, 125, 124, 123, 122, 121, 120, 119, 118, + 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, + 107, 105, 104, 103, 102, 101, 100, 99, 98, 97, + 96, 95, 94, 93, 92, 91, 90, 89, 88, 86, + 85, 83, 82, 81, 80, 78, 77, 76, 75, 74, + 73, 70, 68, 66, 65, 64, 63, 62, 61, 60, + 59, 56, 54, 53, 52, 50, 49, 48, 46, 44, + + 43, 42, 40, 39, 38, 37, 34, 31, 26, 22, + 17, 16, 9, 7, 3, 469, 469, 469, 469, 469, + 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, + 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, + 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, + 469 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_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 yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "rclex.l" +#define INITIAL 0 +#line 2 "rclex.l" +/* Copyright 1997, 1998 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Cygnus Support. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* This is a lex input file which generates a lexer used by the + Windows rc file parser. It basically just recognized a bunch of + keywords. */ + +#include "bfd.h" +#include "bucomm.h" +#include "libiberty.h" +#include "windres.h" +#include "rcparse.h" + +#include <ctype.h> +#include <assert.h> + +/* Whether we are in rcdata mode, in which we returns the lengths of + strings. */ + +static int rcdata_mode; + +/* Whether we are supressing lines from cpp (including windows.h or + headers from your C sources may bring in externs and typedefs). + When active, we return IGNORED_TOKEN, which lets us ignore these + outside of resource constructs. Thus, it isn't required to protect + all the non-preprocessor lines in your header files with #ifdef + RC_INVOKED. It also means your RC file can't include other RC + files if they're named "*.h". Sorry. Name them *.rch or whatever. */ + +static int suppress_cpp_data; + +#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x) + +/* The first filename we detect in the cpp output. We use this to + tell included files from the original file. */ + +static char *initial_fn; + +/* List of allocated strings. */ + +struct alloc_string +{ + struct alloc_string *next; + char *s; +}; + +static struct alloc_string *strings; + +/* Local functions. */ + +static void cpp_line PARAMS ((const char *)); +static char *handle_quotes PARAMS ((const char *, unsigned long *)); +static char *get_string PARAMS ((int)); + +#line 710 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#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 YY_READ_BUF_SIZE +#define YY_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( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 75 "rclex.l" + + +#line 864 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 470 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 516 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 77 "rclex.l" +{ MAYBE_RETURN (BEG); } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 78 "rclex.l" +{ MAYBE_RETURN (BEG); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 79 "rclex.l" +{ MAYBE_RETURN (END); } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 80 "rclex.l" +{ MAYBE_RETURN (END); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 81 "rclex.l" +{ MAYBE_RETURN (ACCELERATORS); } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 82 "rclex.l" +{ MAYBE_RETURN (VIRTKEY); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 83 "rclex.l" +{ MAYBE_RETURN (ASCII); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 84 "rclex.l" +{ MAYBE_RETURN (NOINVERT); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 85 "rclex.l" +{ MAYBE_RETURN (SHIFT); } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 86 "rclex.l" +{ MAYBE_RETURN (CONTROL); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 87 "rclex.l" +{ MAYBE_RETURN (ALT); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 88 "rclex.l" +{ MAYBE_RETURN (BITMAP); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 89 "rclex.l" +{ MAYBE_RETURN (CURSOR); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 90 "rclex.l" +{ MAYBE_RETURN (DIALOG); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 91 "rclex.l" +{ MAYBE_RETURN (DIALOGEX); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 92 "rclex.l" +{ MAYBE_RETURN (EXSTYLE); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 93 "rclex.l" +{ MAYBE_RETURN (CAPTION); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 94 "rclex.l" +{ MAYBE_RETURN (CLASS); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 95 "rclex.l" +{ MAYBE_RETURN (STYLE); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 96 "rclex.l" +{ MAYBE_RETURN (AUTO3STATE); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 97 "rclex.l" +{ MAYBE_RETURN (AUTOCHECKBOX); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 98 "rclex.l" +{ MAYBE_RETURN (AUTORADIOBUTTON); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 99 "rclex.l" +{ MAYBE_RETURN (CHECKBOX); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 100 "rclex.l" +{ MAYBE_RETURN (COMBOBOX); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 101 "rclex.l" +{ MAYBE_RETURN (CTEXT); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 102 "rclex.l" +{ MAYBE_RETURN (DEFPUSHBUTTON); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 103 "rclex.l" +{ MAYBE_RETURN (EDITTEXT); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 104 "rclex.l" +{ MAYBE_RETURN (GROUPBOX); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 105 "rclex.l" +{ MAYBE_RETURN (LISTBOX); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 106 "rclex.l" +{ MAYBE_RETURN (LTEXT); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 107 "rclex.l" +{ MAYBE_RETURN (PUSHBOX); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 108 "rclex.l" +{ MAYBE_RETURN (PUSHBUTTON); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 109 "rclex.l" +{ MAYBE_RETURN (RADIOBUTTON); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 110 "rclex.l" +{ MAYBE_RETURN (RTEXT); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 111 "rclex.l" +{ MAYBE_RETURN (SCROLLBAR); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 112 "rclex.l" +{ MAYBE_RETURN (STATE3); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 113 "rclex.l" +{ MAYBE_RETURN (USERBUTTON); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 114 "rclex.l" +{ MAYBE_RETURN (BEDIT); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 115 "rclex.l" +{ MAYBE_RETURN (HEDIT); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 116 "rclex.l" +{ MAYBE_RETURN (IEDIT); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 117 "rclex.l" +{ MAYBE_RETURN (FONT); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 118 "rclex.l" +{ MAYBE_RETURN (ICON); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 119 "rclex.l" +{ MAYBE_RETURN (LANGUAGE); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 120 "rclex.l" +{ MAYBE_RETURN (CHARACTERISTICS); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 121 "rclex.l" +{ MAYBE_RETURN (VERSIONK); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 122 "rclex.l" +{ MAYBE_RETURN (MENU); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 123 "rclex.l" +{ MAYBE_RETURN (MENUEX); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 124 "rclex.l" +{ MAYBE_RETURN (MENUITEM); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 125 "rclex.l" +{ MAYBE_RETURN (SEPARATOR); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 126 "rclex.l" +{ MAYBE_RETURN (POPUP); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 127 "rclex.l" +{ MAYBE_RETURN (CHECKED); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 128 "rclex.l" +{ MAYBE_RETURN (GRAYED); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 129 "rclex.l" +{ MAYBE_RETURN (HELP); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 130 "rclex.l" +{ MAYBE_RETURN (INACTIVE); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 131 "rclex.l" +{ MAYBE_RETURN (MENUBARBREAK); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 132 "rclex.l" +{ MAYBE_RETURN (MENUBREAK); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 133 "rclex.l" +{ MAYBE_RETURN (MESSAGETABLE); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 134 "rclex.l" +{ MAYBE_RETURN (RCDATA); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 135 "rclex.l" +{ MAYBE_RETURN (STRINGTABLE); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 136 "rclex.l" +{ MAYBE_RETURN (VERSIONINFO); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 137 "rclex.l" +{ MAYBE_RETURN (FILEVERSION); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 138 "rclex.l" +{ MAYBE_RETURN (PRODUCTVERSION); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 139 "rclex.l" +{ MAYBE_RETURN (FILEFLAGSMASK); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 140 "rclex.l" +{ MAYBE_RETURN (FILEFLAGS); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 141 "rclex.l" +{ MAYBE_RETURN (FILEOS); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 142 "rclex.l" +{ MAYBE_RETURN (FILETYPE); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 143 "rclex.l" +{ MAYBE_RETURN (FILESUBTYPE); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 144 "rclex.l" +{ MAYBE_RETURN (VALUE); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 145 "rclex.l" +{ MAYBE_RETURN (MOVEABLE); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 146 "rclex.l" +{ MAYBE_RETURN (FIXED); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 147 "rclex.l" +{ MAYBE_RETURN (PURE); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 148 "rclex.l" +{ MAYBE_RETURN (IMPURE); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 149 "rclex.l" +{ MAYBE_RETURN (PRELOAD); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 150 "rclex.l" +{ MAYBE_RETURN (LOADONCALL); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 151 "rclex.l" +{ MAYBE_RETURN (DISCARDABLE); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 152 "rclex.l" +{ MAYBE_RETURN (NOT); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 154 "rclex.l" +{ + char *s, *send; + + /* This is a hack to let us parse version + information easily. */ + + s = strchr (yytext, '"'); + ++s; + send = strchr (s, '"'); + if (strncmp (s, "StringFileInfo", + sizeof "StringFileInfo" - 1) == 0 + && s + sizeof "StringFileInfo" - 1 == send) + MAYBE_RETURN (BLOCKSTRINGFILEINFO); + else if (strncmp (s, "VarFileInfo", + sizeof "VarFileInfo" - 1) == 0 + && s + sizeof "VarFileInfo" - 1 == send) + MAYBE_RETURN (BLOCKVARFILEINFO); + else + { + char *r; + + r = get_string (send - s + 1); + strncpy (r, s, send - s); + r[send - s] = '\0'; + yylval.s = r; + MAYBE_RETURN (BLOCK); + } + } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 183 "rclex.l" +{ + cpp_line (yytext); + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 187 "rclex.l" +{ + yylval.i.val = strtoul (yytext, 0, 0); + yylval.i.dword = 1; + MAYBE_RETURN (NUMBER); + } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 193 "rclex.l" +{ + yylval.i.val = strtoul (yytext, 0, 0); + yylval.i.dword = 0; + MAYBE_RETURN (NUMBER); + } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 199 "rclex.l" +{ + char *s; + unsigned long length; + + s = handle_quotes (yytext, &length); + if (! rcdata_mode) + { + yylval.s = s; + MAYBE_RETURN (QUOTEDSTRING); + } + else + { + yylval.ss.length = length; + yylval.ss.s = s; + MAYBE_RETURN (SIZEDSTRING); + } + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 217 "rclex.l" +{ + char *s; + + /* I rejected comma in a string in order to + handle VIRTKEY, CONTROL in an accelerator + resource. This means that an unquoted + file name can not contain a comma. I + don't know what rc permits. */ + + s = get_string (strlen (yytext) + 1); + strcpy (s, yytext); + yylval.s = s; + MAYBE_RETURN (STRING); + } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 232 "rclex.l" +{ ++rc_lineno; } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 233 "rclex.l" +{ /* ignore whitespace */ } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 234 "rclex.l" +{ MAYBE_RETURN (*yytext); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 236 "rclex.l" +ECHO; + YY_BREAK +#line 1443 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_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. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_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). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_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 yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_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) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 470 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 470 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 469); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_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 YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 236 "rclex.l" + +#ifndef yywrap +/* This is needed for some versions of lex. */ +int yywrap () +{ + return 1; +} +#endif + +/* Handle a C preprocessor line. */ + +static void +cpp_line (s) + const char *s; +{ + int line; + char *send, *fn; + + ++s; + while (isspace ((unsigned char) *s)) + ++s; + + line = strtol (s, &send, 0); + if (*send != '\0' && ! isspace ((unsigned char) *send)) + return; + + /* Subtract 1 because we are about to count the newline. */ + rc_lineno = line - 1; + + s = send; + while (isspace ((unsigned char) *s)) + ++s; + + if (*s != '"') + return; + + ++s; + send = strchr (s, '"'); + if (send == NULL) + return; + + fn = (char *) xmalloc (send - s + 1); + strncpy (fn, s, send - s); + fn[send - s] = '\0'; + + free (rc_filename); + rc_filename = fn; + + if (!initial_fn) + { + initial_fn = xmalloc (strlen (fn) + 1); + strcpy(initial_fn, fn); + } + + /* Allow the initial file, regardless of name. Suppress all other + files if they end in ".h" (this allows included "*.rc") */ + if (strcmp (initial_fn, fn) == 0 + || strcmp (fn + strlen (fn) - 2, ".h") != 0) + suppress_cpp_data = 0; + else + suppress_cpp_data = 1; +} + +/* Handle a quoted string. The quotes are stripped. A pair of quotes + in a string are turned into a single quote. Adjacent strings are + merged separated by whitespace are merged, as in C. */ + +static char * +handle_quotes (input, len) + const char *input; + unsigned long *len; +{ + char *ret, *s; + const char *t; + int ch; + + ret = get_string (strlen (input) + 1); + + s = ret; + t = input; + if (*t == '"') + ++t; + while (*t != '\0') + { + if (*t == '\\') + { + ++t; + switch (*t) + { + case '\0': + rcparse_warning ("backslash at end of string"); + break; + + case '\"': + rcparse_warning ("use \"\" to put \" in a string"); + break; + + case 'a': + *s++ = ESCAPE_A; + ++t; + break; + + case 'b': + *s++ = ESCAPE_B; + ++t; + break; + + case 'f': + *s++ = ESCAPE_F; + ++t; + break; + + case 'n': + *s++ = ESCAPE_N; + ++t; + break; + + case 'r': + *s++ = ESCAPE_R; + ++t; + break; + + case 't': + *s++ = ESCAPE_T; + ++t; + break; + + case 'v': + *s++ = ESCAPE_V; + ++t; + break; + + case '\\': + *s++ = *t++; + break; + + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + ch = *t - '0'; + ++t; + if (*t >= '0' && *t <= '7') + { + ch = (ch << 3) | (*t - '0'); + ++t; + if (*t >= '0' && *t <= '7') + { + ch = (ch << 3) | (*t - '0'); + ++t; + } + } + *s++ = ch; + break; + + case 'x': + ++t; + ch = 0; + while (1) + { + if (*t >= '0' && *t <= '9') + ch = (ch << 4) | (*t - '0'); + else if (*t >= 'a' && *t <= 'f') + ch = (ch << 4) | (*t - 'a'); + else if (*t >= 'A' && *t <= 'F') + ch = (ch << 4) | (*t - 'A'); + else + break; + ++t; + } + *s++ = ch; + break; + + default: + rcparse_warning ("unrecognized escape sequence"); + *s++ = '\\'; + *s++ = *t++; + break; + } + } + else if (*t != '"') + *s++ = *t++; + else if (t[1] == '\0') + break; + else if (t[1] == '"') + { + *s++ = '"'; + t += 2; + } + else + { + ++t; + assert (isspace ((unsigned char) *t)); + while (isspace ((unsigned char) *t)) + ++t; + if (*t == '\0') + break; + assert (*t == '"'); + ++t; + } + } + + *s = '\0'; + + *len = s - ret; + + return ret; +} + +/* Allocate a string of a given length. */ + +static char * +get_string (len) + int len; +{ + struct alloc_string *as; + + as = (struct alloc_string *) xmalloc (sizeof *as); + as->s = xmalloc (len); + + as->next = strings; + strings = as->next; + + return as->s; +} + +/* Discard all the strings we have allocated. The parser calls this + when it no longer needs them. */ + +void +rcparse_discard_strings () +{ + struct alloc_string *as; + + as = strings; + while (as != NULL) + { + struct alloc_string *n; + + free (as->s); + n = as->next; + free (as); + as = n; + } + + strings = NULL; +} + +/* Enter rcdata mode. */ + +void +rcparse_rcdata () +{ + rcdata_mode = 1; +} + +/* Go back to normal mode from rcdata mode. */ + +void +rcparse_normal () +{ + rcdata_mode = 0; +} diff --git a/binutils/rcparse.c b/binutils/rcparse.c new file mode 100644 index 0000000..63578af --- /dev/null +++ b/binutils/rcparse.c @@ -0,0 +1,3152 @@ + +/* A Bison parser, made from rcparse.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define BEG 257 +#define END 258 +#define ACCELERATORS 259 +#define VIRTKEY 260 +#define ASCII 261 +#define NOINVERT 262 +#define SHIFT 263 +#define CONTROL 264 +#define ALT 265 +#define BITMAP 266 +#define CURSOR 267 +#define DIALOG 268 +#define DIALOGEX 269 +#define EXSTYLE 270 +#define CAPTION 271 +#define CLASS 272 +#define STYLE 273 +#define AUTO3STATE 274 +#define AUTOCHECKBOX 275 +#define AUTORADIOBUTTON 276 +#define CHECKBOX 277 +#define COMBOBOX 278 +#define CTEXT 279 +#define DEFPUSHBUTTON 280 +#define EDITTEXT 281 +#define GROUPBOX 282 +#define LISTBOX 283 +#define LTEXT 284 +#define PUSHBOX 285 +#define PUSHBUTTON 286 +#define RADIOBUTTON 287 +#define RTEXT 288 +#define SCROLLBAR 289 +#define STATE3 290 +#define USERBUTTON 291 +#define BEDIT 292 +#define HEDIT 293 +#define IEDIT 294 +#define FONT 295 +#define ICON 296 +#define LANGUAGE 297 +#define CHARACTERISTICS 298 +#define VERSIONK 299 +#define MENU 300 +#define MENUEX 301 +#define MENUITEM 302 +#define SEPARATOR 303 +#define POPUP 304 +#define CHECKED 305 +#define GRAYED 306 +#define HELP 307 +#define INACTIVE 308 +#define MENUBARBREAK 309 +#define MENUBREAK 310 +#define MESSAGETABLE 311 +#define RCDATA 312 +#define STRINGTABLE 313 +#define VERSIONINFO 314 +#define FILEVERSION 315 +#define PRODUCTVERSION 316 +#define FILEFLAGSMASK 317 +#define FILEFLAGS 318 +#define FILEOS 319 +#define FILETYPE 320 +#define FILESUBTYPE 321 +#define BLOCKSTRINGFILEINFO 322 +#define BLOCKVARFILEINFO 323 +#define VALUE 324 +#define BLOCK 325 +#define MOVEABLE 326 +#define FIXED 327 +#define PURE 328 +#define IMPURE 329 +#define PRELOAD 330 +#define LOADONCALL 331 +#define DISCARDABLE 332 +#define NOT 333 +#define QUOTEDSTRING 334 +#define STRING 335 +#define NUMBER 336 +#define SIZEDSTRING 337 +#define IGNORED_TOKEN 338 +#define NEG 339 + +#line 1 "rcparse.y" + /* rcparse.y -- parser for Windows rc files + Copyright 1997, 1998 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Cygnus Support. + + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* This is a parser for Windows rc files. It is based on the parser + by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */ + +#include "bfd.h" +#include "bucomm.h" +#include "libiberty.h" +#include "windres.h" + +#include <ctype.h> + +/* The current language. */ + +static unsigned short language; + +/* The resource information during a sub statement. */ + +static struct res_res_info sub_res_info; + +/* Dialog information. This is built by the nonterminals styles and + controls. */ + +static struct dialog dialog; + +/* This is used when building a style. It is modified by the + nonterminal styleexpr. */ + +static unsigned long style; + +/* These are used when building a control. They are set before using + control_params. */ + +static unsigned long base_style; +static unsigned long default_style; +static unsigned long class; + + +#line 59 "rcparse.y" +typedef union +{ + struct accelerator acc; + struct accelerator *pacc; + struct dialog_control *dialog_control; + struct menuitem *menuitem; + struct + { + struct rcdata_item *first; + struct rcdata_item *last; + } rcdata; + struct rcdata_item *rcdata_item; + struct stringtable_data *stringtable; + struct fixed_versioninfo *fixver; + struct ver_info *verinfo; + struct ver_stringinfo *verstring; + struct ver_varinfo *vervar; + struct res_id id; + struct res_res_info res_info; + struct + { + unsigned short on; + unsigned short off; + } memflags; + struct + { + unsigned long val; + /* Nonzero if this number was explicitly specified as long. */ + int dword; + } i; + unsigned long il; + unsigned short is; + const char *s; + struct + { + unsigned long length; + const char *s; + } ss; +} YYSTYPE; +#include <stdio.h> + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 483 +#define YYFLAG -32768 +#define YYNTBASE 99 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 339 ? yytranslate[x] : 191) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 92, 87, 2, 97, + 98, 90, 88, 95, 89, 2, 91, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 96, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 86, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 85, 2, 93, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 94 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 1, 5, 9, 13, 17, 21, 25, 29, 33, + 37, 41, 45, 49, 53, 57, 61, 62, 69, 70, + 73, 76, 81, 83, 85, 87, 91, 94, 96, 98, + 100, 102, 104, 106, 111, 116, 117, 131, 132, 146, + 147, 162, 163, 167, 168, 172, 176, 177, 182, 186, + 192, 200, 204, 208, 213, 217, 218, 221, 222, 226, + 227, 231, 232, 236, 237, 241, 242, 246, 247, 251, + 263, 276, 289, 303, 304, 308, 309, 313, 314, 318, + 319, 323, 324, 328, 335, 344, 355, 367, 368, 372, + 373, 377, 378, 382, 383, 387, 388, 392, 393, 397, + 398, 402, 403, 407, 408, 412, 413, 430, 438, 448, + 459, 460, 462, 465, 466, 470, 471, 475, 476, 480, + 481, 485, 490, 495, 499, 506, 507, 510, 515, 518, + 525, 526, 530, 533, 535, 537, 539, 541, 543, 545, + 552, 553, 556, 559, 563, 569, 572, 578, 585, 593, + 603, 608, 615, 616, 619, 620, 622, 624, 626, 630, + 634, 635, 642, 643, 647, 652, 659, 664, 671, 672, + 679, 686, 690, 694, 698, 702, 706, 707, 716, 724, + 725, 731, 732, 736, 738, 740, 742, 745, 748, 751, + 753, 754, 757, 761, 766, 770, 771, 774, 775, 778, + 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, + 801, 805, 810, 812, 816, 817, 819, 822, 824, 826, + 830, 833, 836, 840, 844, 848, 852, 856, 860, 864, + 868, 871, 873, 875, 879, 882, 886, 890, 894, 898, + 902, 906, 910 +}; + +static const short yyrhs[] = { -1, + 99, 100, 101, 0, 99, 100, 107, 0, 99, 100, + 108, 0, 99, 100, 109, 0, 99, 100, 148, 0, + 99, 100, 149, 0, 99, 100, 150, 0, 99, 100, + 151, 0, 99, 100, 156, 0, 99, 100, 159, 0, + 99, 100, 160, 0, 99, 100, 165, 0, 99, 100, + 168, 0, 99, 100, 169, 0, 99, 100, 84, 0, + 0, 174, 5, 177, 3, 102, 4, 0, 0, 102, + 103, 0, 104, 188, 0, 104, 188, 95, 105, 0, + 80, 0, 189, 0, 106, 0, 105, 95, 106, 0, + 105, 106, 0, 6, 0, 7, 0, 8, 0, 9, + 0, 10, 0, 11, 0, 174, 12, 179, 181, 0, + 174, 13, 178, 181, 0, 0, 174, 14, 179, 113, + 189, 185, 185, 185, 110, 114, 3, 116, 4, 0, + 0, 174, 15, 179, 113, 189, 185, 185, 185, 111, + 114, 3, 116, 4, 0, 0, 174, 15, 179, 113, + 189, 185, 185, 185, 185, 112, 114, 3, 116, 4, + 0, 0, 16, 96, 186, 0, 0, 114, 17, 80, + 0, 114, 18, 174, 0, 0, 114, 19, 115, 182, + 0, 114, 16, 186, 0, 114, 41, 186, 95, 80, + 0, 114, 41, 186, 95, 80, 185, 185, 0, 114, + 46, 174, 0, 114, 44, 186, 0, 114, 43, 186, + 185, 0, 114, 45, 186, 0, 0, 116, 117, 0, + 0, 20, 118, 139, 0, 0, 21, 119, 139, 0, + 0, 22, 120, 139, 0, 0, 38, 121, 139, 0, + 0, 23, 122, 139, 0, 0, 24, 123, 139, 0, + 10, 140, 186, 185, 142, 185, 185, 185, 185, 184, + 141, 0, 10, 140, 186, 185, 142, 185, 185, 185, + 185, 185, 185, 141, 0, 10, 140, 186, 95, 80, + 142, 185, 185, 185, 185, 184, 141, 0, 10, 140, + 186, 95, 80, 142, 185, 185, 185, 185, 185, 185, + 141, 0, 0, 25, 124, 139, 0, 0, 26, 125, + 139, 0, 0, 27, 126, 139, 0, 0, 28, 127, + 139, 0, 0, 39, 128, 139, 0, 42, 176, 186, + 185, 185, 141, 0, 42, 176, 186, 185, 185, 185, + 185, 141, 0, 42, 176, 186, 185, 185, 185, 185, + 144, 184, 141, 0, 42, 176, 186, 185, 185, 185, + 185, 144, 185, 185, 141, 0, 0, 40, 129, 139, + 0, 0, 29, 130, 139, 0, 0, 30, 131, 139, + 0, 0, 31, 132, 139, 0, 0, 32, 133, 139, + 0, 0, 33, 134, 139, 0, 0, 34, 135, 139, + 0, 0, 35, 136, 139, 0, 0, 36, 137, 139, + 0, 0, 37, 80, 95, 186, 95, 186, 95, 186, + 95, 186, 95, 186, 95, 138, 182, 184, 0, 140, + 186, 185, 185, 185, 185, 141, 0, 140, 186, 185, + 185, 185, 185, 146, 184, 141, 0, 140, 186, 185, + 185, 185, 185, 146, 185, 185, 141, 0, 0, 80, + 0, 80, 95, 0, 0, 3, 161, 4, 0, 0, + 95, 143, 182, 0, 0, 95, 145, 182, 0, 0, + 95, 147, 182, 0, 174, 41, 178, 181, 0, 174, + 42, 178, 181, 0, 43, 186, 185, 0, 174, 46, + 177, 3, 152, 4, 0, 0, 152, 153, 0, 48, + 80, 185, 154, 0, 48, 49, 0, 50, 80, 154, + 3, 152, 4, 0, 0, 154, 95, 155, 0, 154, + 155, 0, 51, 0, 52, 0, 53, 0, 54, 0, + 55, 0, 56, 0, 174, 47, 177, 3, 157, 4, + 0, 0, 157, 158, 0, 48, 80, 0, 48, 80, + 185, 0, 48, 80, 185, 185, 184, 0, 48, 49, + 0, 50, 80, 3, 157, 4, 0, 50, 80, 185, + 3, 157, 4, 0, 50, 80, 185, 185, 3, 157, + 4, 0, 50, 80, 185, 185, 185, 184, 3, 157, + 4, 0, 174, 57, 179, 181, 0, 174, 58, 177, + 3, 161, 4, 0, 0, 162, 163, 0, 0, 164, + 0, 83, 0, 187, 0, 164, 95, 83, 0, 164, + 95, 187, 0, 0, 59, 177, 3, 166, 167, 4, + 0, 0, 167, 186, 80, 0, 167, 186, 95, 80, + 0, 174, 174, 177, 3, 161, 4, 0, 174, 174, + 177, 181, 0, 174, 60, 170, 3, 171, 4, 0, + 0, 170, 61, 186, 185, 185, 185, 0, 170, 62, + 186, 185, 185, 185, 0, 170, 63, 186, 0, 170, + 64, 186, 0, 170, 65, 186, 0, 170, 66, 186, + 0, 170, 67, 186, 0, 0, 171, 68, 3, 71, + 3, 172, 4, 4, 0, 171, 69, 3, 70, 80, + 173, 4, 0, 0, 172, 70, 80, 95, 80, 0, + 0, 173, 185, 185, 0, 189, 0, 81, 0, 80, + 0, 80, 95, 0, 81, 95, 0, 189, 95, 0, + 175, 0, 0, 177, 180, 0, 177, 44, 186, 0, + 177, 43, 186, 185, 0, 177, 45, 186, 0, 0, + 178, 180, 0, 0, 179, 180, 0, 72, 0, 73, + 0, 74, 0, 75, 0, 76, 0, 77, 0, 78, + 0, 80, 0, 81, 0, 183, 0, 79, 183, 0, + 182, 85, 183, 0, 182, 85, 79, 183, 0, 82, + 0, 97, 186, 98, 0, 0, 185, 0, 95, 186, + 0, 187, 0, 82, 0, 97, 187, 98, 0, 93, + 187, 0, 89, 187, 0, 187, 90, 187, 0, 187, + 91, 187, 0, 187, 92, 187, 0, 187, 88, 187, + 0, 187, 89, 187, 0, 187, 87, 187, 0, 187, + 86, 187, 0, 187, 85, 187, 0, 95, 189, 0, + 190, 0, 82, 0, 97, 187, 98, 0, 93, 187, + 0, 190, 90, 187, 0, 190, 91, 187, 0, 190, + 92, 187, 0, 190, 88, 187, 0, 190, 89, 187, + 0, 190, 87, 187, 0, 190, 86, 187, 0, 190, + 85, 187, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 155, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 174, 183, 190, 195, + 215, 221, 232, 254, 263, 268, 273, 279, 284, 289, + 293, 297, 301, 309, 318, 327, 345, 349, 368, 372, + 392, 398, 403, 409, 411, 415, 419, 422, 425, 429, + 435, 448, 452, 456, 460, 466, 468, 478, 486, 489, + 496, 499, 506, 509, 516, 522, 529, 532, 539, 542, + 553, 562, 575, 586, 593, 596, 603, 606, 613, 616, + 623, 626, 633, 639, 644, 650, 656, 662, 669, 675, + 682, 685, 692, 695, 702, 705, 712, 715, 722, 725, + 732, 735, 742, 745, 752, 755, 758, 772, 785, 796, + 807, 812, 816, 822, 827, 835, 839, 841, 845, 847, + 851, 855, 864, 874, 883, 890, 895, 911, 916, 920, + 926, 931, 935, 941, 946, 950, 954, 958, 962, 970, + 977, 982, 998, 1003, 1007, 1011, 1015, 1019, 1023, 1027, + 1036, 1045, 1055, 1060, 1066, 1072, 1078, 1087, 1095, 1104, + 1117, 1120, 1123, 1125, 1129, 1138, 1143, 1151, 1158, 1165, + 1171, 1177, 1182, 1187, 1192, 1197, 1210, 1215, 1219, 1225, + 1230, 1236, 1241, 1249, 1255, 1271, 1276, 1280, 1287, 1293, + 1310, 1318, 1324, 1329, 1334, 1343, 1350, 1360, 1367, 1378, + 1384, 1389, 1394, 1399, 1404, 1409, 1418, 1423, 1439, 1444, + 1448, 1452, 1458, 1463, 1471, 1476, 1484, 1493, 1502, 1507, + 1511, 1516, 1521, 1526, 1531, 1536, 1541, 1546, 1551, 1556, + 1566, 1575, 1586, 1591, 1595, 1600, 1605, 1610, 1615, 1620, + 1625, 1630, 1635 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","BEG","END", +"ACCELERATORS","VIRTKEY","ASCII","NOINVERT","SHIFT","CONTROL","ALT","BITMAP", +"CURSOR","DIALOG","DIALOGEX","EXSTYLE","CAPTION","CLASS","STYLE","AUTO3STATE", +"AUTOCHECKBOX","AUTORADIOBUTTON","CHECKBOX","COMBOBOX","CTEXT","DEFPUSHBUTTON", +"EDITTEXT","GROUPBOX","LISTBOX","LTEXT","PUSHBOX","PUSHBUTTON","RADIOBUTTON", +"RTEXT","SCROLLBAR","STATE3","USERBUTTON","BEDIT","HEDIT","IEDIT","FONT","ICON", +"LANGUAGE","CHARACTERISTICS","VERSIONK","MENU","MENUEX","MENUITEM","SEPARATOR", +"POPUP","CHECKED","GRAYED","HELP","INACTIVE","MENUBARBREAK","MENUBREAK","MESSAGETABLE", +"RCDATA","STRINGTABLE","VERSIONINFO","FILEVERSION","PRODUCTVERSION","FILEFLAGSMASK", +"FILEFLAGS","FILEOS","FILETYPE","FILESUBTYPE","BLOCKSTRINGFILEINFO","BLOCKVARFILEINFO", +"VALUE","BLOCK","MOVEABLE","FIXED","PURE","IMPURE","PRELOAD","LOADONCALL","DISCARDABLE", +"NOT","QUOTEDSTRING","STRING","NUMBER","SIZEDSTRING","IGNORED_TOKEN","'|'","'^'", +"'&'","'+'","'-'","'*'","'/'","'%'","'~'","NEG","','","'='","'('","')'","input", +"newcmd","accelerator","acc_entries","acc_entry","acc_event","acc_options","acc_option", +"bitmap","cursor","dialog","@1","@2","@3","exstyle","styles","@4","controls", +"control","@5","@6","@7","@8","@9","@10","@11","@12","@13","@14","@15","@16", +"@17","@18","@19","@20","@21","@22","@23","@24","@25","control_params","optstringc", +"opt_control_data","control_styleexpr","@26","icon_styleexpr","@27","control_params_styleexpr", +"@28","font","icon","language","menu","menuitems","menuitem","menuitem_flags", +"menuitem_flag","menuex","menuexitems","menuexitem","messagetable","rcdata", +"optrcdata_data","@29","optrcdata_data_int","rcdata_data","stringtable","@30", +"string_data","user","versioninfo","fixedverinfo","verblocks","vervals","vertrans", +"id","resname","resref","suboptions","memflags_move_discard","memflags_move", +"memflag","file_name","styleexpr","parennumber","optcnumexpr","cnumexpr","numexpr", +"sizednumexpr","cposnumexpr","posnumexpr","sizedposnumexpr", NULL +}; +#endif + +static const short yyr1[] = { 0, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 100, 101, 102, 102, + 103, 103, 104, 104, 105, 105, 105, 106, 106, 106, + 106, 106, 106, 107, 108, 110, 109, 111, 109, 112, + 109, 113, 113, 114, 114, 114, 115, 114, 114, 114, + 114, 114, 114, 114, 114, 116, 116, 118, 117, 119, + 117, 120, 117, 121, 117, 122, 117, 123, 117, 117, + 117, 117, 117, 124, 117, 125, 117, 126, 117, 127, + 117, 128, 117, 117, 117, 117, 117, 129, 117, 130, + 117, 131, 117, 132, 117, 133, 117, 134, 117, 135, + 117, 136, 117, 137, 117, 138, 117, 139, 139, 139, + 140, 140, 140, 141, 141, 143, 142, 145, 144, 147, + 146, 148, 149, 150, 151, 152, 152, 153, 153, 153, + 154, 154, 154, 155, 155, 155, 155, 155, 155, 156, + 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, + 159, 160, 162, 161, 163, 163, 164, 164, 164, 164, + 166, 165, 167, 167, 167, 168, 168, 169, 170, 170, + 170, 170, 170, 170, 170, 170, 171, 171, 171, 172, + 172, 173, 173, 174, 174, 175, 175, 175, 176, 176, + 177, 177, 177, 177, 177, 178, 178, 179, 179, 180, + 180, 180, 180, 180, 180, 180, 181, 181, 182, 182, + 182, 182, 183, 183, 184, 184, 185, 186, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 188, 189, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190 +}; + +static const short yyr2[] = { 0, + 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 0, 6, 0, 2, + 2, 4, 1, 1, 1, 3, 2, 1, 1, 1, + 1, 1, 1, 4, 4, 0, 13, 0, 13, 0, + 14, 0, 3, 0, 3, 3, 0, 4, 3, 5, + 7, 3, 3, 4, 3, 0, 2, 0, 3, 0, + 3, 0, 3, 0, 3, 0, 3, 0, 3, 11, + 12, 12, 13, 0, 3, 0, 3, 0, 3, 0, + 3, 0, 3, 6, 8, 10, 11, 0, 3, 0, + 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, + 3, 0, 3, 0, 3, 0, 16, 7, 9, 10, + 0, 1, 2, 0, 3, 0, 3, 0, 3, 0, + 3, 4, 4, 3, 6, 0, 2, 4, 2, 6, + 0, 3, 2, 1, 1, 1, 1, 1, 1, 6, + 0, 2, 2, 3, 5, 2, 5, 6, 7, 9, + 4, 6, 0, 2, 0, 1, 1, 1, 3, 3, + 0, 6, 0, 3, 4, 6, 4, 6, 0, 6, + 6, 3, 3, 3, 3, 3, 0, 8, 7, 0, + 5, 0, 3, 1, 1, 1, 2, 2, 2, 1, + 0, 2, 3, 4, 3, 0, 2, 0, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 3, 4, 1, 3, 0, 1, 2, 1, 1, 3, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 1, 1, 3, 2, 3, 3, 3, 3, 3, + 3, 3, 3 +}; + +static const short yydefact[] = { 1, + 17, 0, 0, 191, 185, 233, 16, 0, 0, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 0, 184, 232, 219, 0, 0, 0, + 0, 218, 0, 235, 0, 191, 198, 196, 198, 198, + 196, 196, 191, 191, 198, 191, 169, 191, 0, 0, + 0, 0, 0, 0, 0, 0, 222, 221, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 161, + 0, 0, 0, 200, 201, 202, 203, 204, 205, 206, + 192, 234, 0, 0, 0, 42, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 243, 242, 241, 239, 240, + 236, 237, 238, 220, 217, 230, 229, 228, 226, 227, + 223, 224, 225, 163, 0, 193, 195, 19, 207, 208, + 199, 34, 197, 35, 0, 0, 0, 122, 123, 126, + 141, 151, 153, 177, 0, 0, 0, 0, 0, 0, + 0, 153, 167, 0, 194, 0, 0, 0, 0, 0, + 0, 0, 155, 0, 0, 0, 172, 173, 174, 175, + 176, 0, 162, 0, 18, 23, 20, 0, 24, 43, + 0, 0, 125, 0, 0, 127, 140, 0, 0, 142, + 152, 157, 154, 156, 158, 168, 0, 0, 0, 0, + 166, 164, 0, 0, 21, 0, 0, 129, 0, 131, + 146, 143, 0, 0, 0, 0, 0, 0, 165, 231, + 0, 36, 38, 131, 0, 144, 141, 0, 159, 160, + 0, 0, 170, 171, 28, 29, 30, 31, 32, 33, + 22, 25, 44, 44, 40, 128, 126, 134, 135, 136, + 137, 138, 139, 0, 133, 215, 0, 141, 0, 180, + 182, 0, 27, 0, 0, 44, 0, 132, 145, 216, + 147, 0, 141, 215, 0, 0, 26, 56, 0, 0, + 0, 47, 0, 0, 0, 0, 0, 56, 0, 130, + 148, 0, 0, 0, 0, 179, 0, 0, 49, 45, + 46, 0, 0, 0, 53, 55, 52, 0, 56, 149, + 141, 178, 0, 183, 37, 111, 58, 60, 62, 66, + 68, 74, 76, 78, 80, 90, 92, 94, 96, 98, + 100, 102, 104, 0, 64, 82, 88, 0, 57, 0, + 213, 0, 48, 209, 0, 54, 39, 0, 0, 0, + 112, 0, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 0, + 111, 111, 111, 186, 0, 190, 0, 0, 210, 0, + 0, 50, 41, 150, 181, 113, 0, 59, 0, 61, + 63, 67, 69, 75, 77, 79, 81, 91, 93, 95, + 97, 99, 101, 103, 105, 0, 65, 83, 89, 187, + 188, 0, 189, 214, 0, 211, 0, 0, 0, 0, + 0, 0, 212, 51, 0, 116, 0, 0, 0, 114, + 0, 0, 0, 0, 0, 153, 84, 0, 0, 117, + 0, 0, 0, 0, 114, 0, 0, 114, 0, 115, + 118, 85, 215, 0, 215, 120, 108, 215, 0, 0, + 114, 216, 215, 114, 216, 0, 114, 216, 0, 119, + 86, 114, 114, 216, 70, 114, 121, 109, 114, 0, + 87, 72, 114, 71, 110, 0, 73, 106, 0, 215, + 107, 0, 0 +}; + +static const short yydefgoto[] = { 1, + 2, 10, 146, 167, 168, 231, 232, 11, 12, 13, + 233, 234, 256, 126, 254, 292, 288, 329, 343, 344, + 345, 361, 346, 347, 348, 349, 350, 351, 362, 363, + 352, 353, 354, 355, 356, 357, 358, 359, 479, 378, + 379, 427, 417, 422, 443, 450, 448, 456, 14, 15, + 16, 17, 150, 176, 215, 245, 18, 151, 180, 19, + 20, 152, 153, 183, 184, 21, 114, 144, 22, 23, + 94, 154, 265, 266, 24, 366, 367, 33, 85, 84, + 81, 122, 333, 334, 259, 260, 105, 32, 195, 25, + 26 +}; + +static const short yypact[] = {-32768, + 31, 240, 241,-32768,-32768,-32768,-32768, 241, 241,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 68,-32768, 578,-32768, 241, 241, 241, + -73, 586, 169,-32768, 388,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 241, 241, + 241, 241, 241, 241, 241, 241,-32768,-32768, 513, 241, +-32768, 241, 241, 241, 241, 241, 241, 241, 241,-32768, + 241, 241, 241,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 215, 581, 581, 268, 268, 581, 581, 232, + 275, 581, 283, 250, 156, 593, 599, 616, 98, 98, +-32768,-32768,-32768,-32768,-32768, 593, 599, 616, 98, 98, +-32768,-32768,-32768,-32768, -73,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, -61, 290, 290,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 241, 241, 241, 241, 241, 241, + 241,-32768,-32768, 4,-32768, 5, 241, -73, -73, 9, + 92, 32, 309, 10, -73, -73,-32768,-32768,-32768,-32768, +-32768, 54,-32768, -57,-32768,-32768,-32768, -20,-32768,-32768, + -73, -73,-32768, 39, -9,-32768,-32768, 40, 11,-32768, +-32768,-32768,-32768, 36, 586,-32768, 145, 151, -73, -73, +-32768,-32768, 78, 290, 79, -73, -73,-32768, -73,-32768, +-32768, -73, 16, 365, 106, 108, -73, -73,-32768,-32768, + 686,-32768, -73,-32768, 52, -73,-32768, 17,-32768, 586, + 178, 128,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 34,-32768,-32768,-32768,-32768, 314,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 647,-32768, -73, 95,-32768, 18,-32768, +-32768, 686,-32768, 150, 378,-32768, 112,-32768,-32768,-32768, +-32768, 123,-32768, -73, 6, 29,-32768,-32768, 241, 129, + 281,-32768, 241, 241, 241, 241, 281,-32768, 452,-32768, +-32768, 135, 200, 213, 143,-32768, -73, 479,-32768,-32768, +-32768, 182, 91, -73,-32768,-32768,-32768, 516,-32768,-32768, +-32768,-32768, 130,-32768,-32768, 147,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 158,-32768,-32768,-32768, 170,-32768, 73, +-32768, 241, 154,-32768, 160,-32768,-32768, 553, 172, 168, + 161, 241, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 173, + 147, 147, 147, 174, 186,-32768, 241, 187,-32768, 196, + 183, -73,-32768,-32768,-32768,-32768, 201,-32768, 241,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 241,-32768,-32768,-32768,-32768, +-32768, -73,-32768,-32768, 73,-32768, -73, 293, 202, -73, + 203, -73,-32768,-32768, 202,-32768, -73, -73, 241, 22, + -73, 182, -73, -73, 205,-32768,-32768, -73, -73, 154, + -73, -73, 241, 297, 26, -73, -73, 27, 208,-32768, +-32768,-32768, -73, -73, -73,-32768,-32768, -73, 241, 182, + 251, -73, -73, 251, -73, 182, 251, -73, 230, 154, +-32768, 251, 251, -73,-32768, 251, 154,-32768, 251, 241, +-32768,-32768, 251,-32768,-32768, 236,-32768,-32768, 182, -11, +-32768, 332,-32768 +}; + +static const short yypgoto[] = {-32768, +-32768,-32768,-32768,-32768,-32768,-32768, -220,-32768,-32768,-32768, +-32768,-32768,-32768, 248, -222,-32768, -262,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 289, + 30, 159, -44,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 117,-32768, 163, 140,-32768, -171,-32768,-32768, +-32768, -141,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, -22,-32768,-32768, 486, -24, 55, + 480, 316, -304, -315, -261, 8, -3, -2,-32768, -122, +-32768 +}; + + +#define YYLAST 708 + + +static const short yytable[] = { 31, + 162, 48, 283, 148, 149, 34, 35, 163, 165, 284, + 253, 255, 173, 186, 369, 298, 88, 89, 217, 248, + 263, 60, 192, 169, 426, 57, 58, 59, 426, 426, + 482, 267, 286, 279, 147, 181, 338, 193, 61, 225, + 226, 227, 228, 229, 230, 247, 96, 97, 98, 99, + 100, 101, 102, 103, 237, 406, 174, 191, 175, 106, + 107, 108, 109, 110, 111, 112, 113, 115, 116, 117, + 200, 210, 36, 371, 194, 285, 262, 187, 188, 37, + 38, 39, 40, 60, 166, 27, 6, 198, 201, 413, + 203, 282, 28, 86, 87, 177, 29, 8, 261, 92, + 30, 9, 238, 239, 240, 241, 242, 243, 41, 42, + 60, 60, 60, 43, 44, 280, 60, 430, 199, 202, + 441, 446, 145, 60, 45, 46, 281, 47, 252, 339, + 204, 155, 156, 157, 158, 159, 160, 161, 300, 178, + 164, 179, 178, 170, 179, 460, 244, 205, 5, 6, + 185, 467, 268, 206, 331, 171, 172, 209, 142, 174, + 8, 175, 189, 190, 9, 269, 270, 271, 272, 332, + 178, 70, 179, 211, 480, 374, 221, 222, 196, 197, + 250, 451, 178, 454, 179, 335, 457, 67, 68, 69, + 273, 463, 274, 275, 276, 277, 207, 208, 71, 72, + 73, 220, 301, 212, 213, 368, 214, 251, 290, 216, + 218, 71, 72, 73, 223, 224, 302, 118, 481, 178, + 235, 179, 303, 246, 340, 249, 341, 74, 75, 76, + 77, 78, 79, 80, 130, 119, 120, 360, 371, 372, + 74, 75, 76, 77, 78, 79, 80, 375, 291, 364, + 365, 6, 134, 426, 297, 376, 264, 71, 72, 73, + 330, 405, 8, 331, 331, 289, 9, 396, 400, 293, + 294, 295, 296, 287, 71, 72, 73, 131, 332, 332, + 401, 403, 3, 125, 434, 133, 74, 75, 76, 77, + 78, 79, 80, 404, 304, 408, 416, 419, 4, 433, + 440, 336, 449, 74, 75, 76, 77, 78, 79, 80, + 135, 136, 137, 138, 139, 140, 141, 71, 72, 73, + 5, 6, 27, 7, 470, 71, 72, 73, 370, 28, + 478, 483, 8, 29, 127, 342, 9, 30, 377, 74, + 75, 76, 77, 78, 79, 80, 74, 75, 76, 77, + 78, 79, 80, 257, 74, 75, 76, 77, 78, 79, + 80, 5, 6, 402, 238, 239, 240, 241, 242, 243, + 421, 6, 415, 8, 27, 410, 236, 9, 0, 407, + 278, 28, 8, 258, 409, 29, 9, 0, 0, 30, + 27, 182, 411, 269, 270, 271, 272, 28, 0, 0, + 124, 29, 0, 128, 129, 30, 0, 132, 244, 412, + 143, 0, 0, 0, 414, 425, 0, 418, 273, 420, + 274, 275, 276, 277, 423, 424, 0, 428, 429, 439, + 431, 432, 0, 0, 0, 435, 436, 0, 437, 438, + 0, 0, 0, 444, 445, 459, 27, 219, 0, 0, + 452, 453, 455, 28, 299, 458, 0, 29, 0, 462, + 464, 30, 466, 0, 0, 469, 476, 269, 270, 271, + 272, 473, 62, 63, 64, 65, 66, 67, 68, 69, + 0, 0, 305, 0, 0, 82, 0, 0, 306, 0, + 0, 0, 273, 0, 274, 275, 276, 277, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 337, + 328, 83, 0, 0, 0, 306, 0, 0, 90, 91, + 0, 93, 0, 95, 0, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 373, 328, 0, 0, + 0, 0, 306, 121, 123, 121, 121, 123, 123, 0, + 0, 121, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 442, 328, 0, 447, 62, 63, 64, + 65, 66, 67, 68, 69, 0, 0, 0, 0, 461, + 104, 0, 465, 0, 0, 468, 0, 0, 0, 0, + 471, 472, 0, 0, 474, 0, 0, 475, 0, 0, + 0, 477, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 0, 397, + 398, 399, 74, 75, 76, 77, 78, 79, 80, 0, + 119, 120, 49, 50, 51, 52, 53, 54, 55, 56, + 62, 63, 64, 65, 66, 67, 68, 69, 63, 64, + 65, 66, 67, 68, 69, 64, 65, 66, 67, 68, + 69, 225, 226, 227, 228, 229, 230, 238, 239, 240, + 241, 242, 243, 65, 66, 67, 68, 69 +}; + +static const short yycheck[] = { 3, + 142, 24, 264, 126, 127, 8, 9, 4, 4, 4, + 231, 234, 4, 4, 330, 278, 41, 42, 3, 3, + 3, 95, 80, 146, 3, 28, 29, 30, 3, 3, + 0, 252, 4, 256, 96, 4, 299, 95, 31, 6, + 7, 8, 9, 10, 11, 217, 49, 50, 51, 52, + 53, 54, 55, 56, 3, 371, 48, 4, 50, 62, + 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, + 80, 194, 5, 85, 95, 70, 248, 68, 69, 12, + 13, 14, 15, 95, 80, 82, 82, 49, 49, 405, + 80, 263, 89, 39, 40, 4, 93, 93, 4, 45, + 97, 97, 51, 52, 53, 54, 55, 56, 41, 42, + 95, 95, 95, 46, 47, 4, 95, 422, 80, 80, + 95, 95, 115, 95, 57, 58, 4, 60, 95, 301, + 95, 135, 136, 137, 138, 139, 140, 141, 4, 48, + 144, 50, 48, 147, 50, 450, 95, 3, 81, 82, + 153, 456, 3, 3, 82, 148, 149, 80, 3, 48, + 93, 50, 155, 156, 97, 16, 17, 18, 19, 97, + 48, 3, 50, 95, 479, 4, 71, 70, 171, 172, + 3, 443, 48, 445, 50, 95, 448, 90, 91, 92, + 41, 453, 43, 44, 45, 46, 189, 190, 43, 44, + 45, 204, 3, 196, 197, 328, 199, 80, 80, 202, + 203, 43, 44, 45, 207, 208, 4, 3, 480, 48, + 213, 50, 80, 216, 95, 218, 80, 72, 73, 74, + 75, 76, 77, 78, 3, 80, 81, 80, 85, 80, + 72, 73, 74, 75, 76, 77, 78, 80, 271, 80, + 81, 82, 3, 3, 277, 95, 249, 43, 44, 45, + 79, 79, 93, 82, 82, 269, 97, 95, 95, 273, + 274, 275, 276, 266, 43, 44, 45, 3, 97, 97, + 95, 95, 43, 16, 426, 3, 72, 73, 74, 75, + 76, 77, 78, 98, 287, 95, 95, 95, 59, 95, + 4, 294, 95, 72, 73, 74, 75, 76, 77, 78, + 61, 62, 63, 64, 65, 66, 67, 43, 44, 45, + 81, 82, 82, 84, 95, 43, 44, 45, 332, 89, + 95, 0, 93, 93, 87, 306, 97, 97, 342, 72, + 73, 74, 75, 76, 77, 78, 72, 73, 74, 75, + 76, 77, 78, 237, 72, 73, 74, 75, 76, 77, + 78, 81, 82, 367, 51, 52, 53, 54, 55, 56, + 415, 82, 80, 93, 82, 379, 214, 97, -1, 372, + 3, 89, 93, 244, 377, 93, 97, -1, -1, 97, + 82, 83, 396, 16, 17, 18, 19, 89, -1, -1, + 85, 93, -1, 88, 89, 97, -1, 92, 95, 402, + 95, -1, -1, -1, 407, 419, -1, 410, 41, 412, + 43, 44, 45, 46, 417, 418, -1, 420, 421, 433, + 423, 424, -1, -1, -1, 428, 429, -1, 431, 432, + -1, -1, -1, 436, 437, 449, 82, 83, -1, -1, + 443, 444, 445, 89, 3, 448, -1, 93, -1, 452, + 453, 97, 455, -1, -1, 458, 470, 16, 17, 18, + 19, 464, 85, 86, 87, 88, 89, 90, 91, 92, + -1, -1, 4, -1, -1, 98, -1, -1, 10, -1, + -1, -1, 41, -1, 43, 44, 45, 46, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 4, + 42, 36, -1, -1, -1, 10, -1, -1, 43, 44, + -1, 46, -1, 48, -1, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 4, 42, -1, -1, + -1, -1, 10, 84, 85, 86, 87, 88, 89, -1, + -1, 92, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 435, 42, -1, 438, 85, 86, 87, + 88, 89, 90, 91, 92, -1, -1, -1, -1, 451, + 98, -1, 454, -1, -1, 457, -1, -1, -1, -1, + 462, 463, -1, -1, 466, -1, -1, 469, -1, -1, + -1, 473, 344, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, + 362, 363, 72, 73, 74, 75, 76, 77, 78, -1, + 80, 81, 85, 86, 87, 88, 89, 90, 91, 92, + 85, 86, 87, 88, 89, 90, 91, 92, 86, 87, + 88, 89, 90, 91, 92, 87, 88, 89, 90, 91, + 92, 6, 7, 8, 9, 10, 11, 51, 52, 53, + 54, 55, 56, 88, 89, 90, 91, 92 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/misc/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include <alloca.h> +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include <malloc.h> +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include <malloc.h> */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/misc/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 17: +#line 176 "rcparse.y" +{ + rcparse_discard_strings (); + ; + break;} +case 18: +#line 185 "rcparse.y" +{ + define_accelerator (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].pacc); + ; + break;} +case 19: +#line 192 "rcparse.y" +{ + yyval.pacc = NULL; + ; + break;} +case 20: +#line 196 "rcparse.y" +{ + struct accelerator *a; + + a = (struct accelerator *) res_alloc (sizeof *a); + *a = yyvsp[0].acc; + if (yyvsp[-1].pacc == NULL) + yyval.pacc = a; + else + { + struct accelerator **pp; + + for (pp = &yyvsp[-1].pacc->next; *pp != NULL; pp = &(*pp)->next) + ; + *pp = a; + yyval.pacc = yyvsp[-1].pacc; + } + ; + break;} +case 21: +#line 217 "rcparse.y" +{ + yyval.acc = yyvsp[-1].acc; + yyval.acc.id = yyvsp[0].il; + ; + break;} +case 22: +#line 222 "rcparse.y" +{ + yyval.acc = yyvsp[-3].acc; + yyval.acc.id = yyvsp[-2].il; + yyval.acc.flags |= yyvsp[0].is; + if ((yyval.acc.flags & ACC_VIRTKEY) == 0 + && (yyval.acc.flags & (ACC_SHIFT | ACC_CONTROL | ACC_ALT)) != 0) + rcparse_warning (_("inappropriate modifiers for non-VIRTKEY")); + ; + break;} +case 23: +#line 234 "rcparse.y" +{ + const char *s = yyvsp[0].s; + char ch; + + yyval.acc.next = NULL; + yyval.acc.id = 0; + ch = *s; + if (ch != '^') + yyval.acc.flags = 0; + else + { + yyval.acc.flags = ACC_CONTROL | ACC_VIRTKEY; + ++s; + ch = *s; + ch = toupper ((unsigned char) ch); + } + yyval.acc.key = ch; + if (s[1] != '\0') + rcparse_warning (_("accelerator should only be one character")); + ; + break;} +case 24: +#line 255 "rcparse.y" +{ + yyval.acc.next = NULL; + yyval.acc.flags = 0; + yyval.acc.id = 0; + yyval.acc.key = yyvsp[0].il; + ; + break;} +case 25: +#line 265 "rcparse.y" +{ + yyval.is = yyvsp[0].is; + ; + break;} +case 26: +#line 269 "rcparse.y" +{ + yyval.is = yyvsp[-2].is | yyvsp[0].is; + ; + break;} +case 27: +#line 274 "rcparse.y" +{ + yyval.is = yyvsp[-1].is | yyvsp[0].is; + ; + break;} +case 28: +#line 281 "rcparse.y" +{ + yyval.is = ACC_VIRTKEY; + ; + break;} +case 29: +#line 285 "rcparse.y" +{ + /* This is just the absence of VIRTKEY. */ + yyval.is = 0; + ; + break;} +case 30: +#line 290 "rcparse.y" +{ + yyval.is = ACC_NOINVERT; + ; + break;} +case 31: +#line 294 "rcparse.y" +{ + yyval.is = ACC_SHIFT; + ; + break;} +case 32: +#line 298 "rcparse.y" +{ + yyval.is = ACC_CONTROL; + ; + break;} +case 33: +#line 302 "rcparse.y" +{ + yyval.is = ACC_ALT; + ; + break;} +case 34: +#line 311 "rcparse.y" +{ + define_bitmap (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); + ; + break;} +case 35: +#line 320 "rcparse.y" +{ + define_cursor (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); + ; + break;} +case 36: +#line 330 "rcparse.y" +{ + memset (&dialog, 0, sizeof dialog); + dialog.x = yyvsp[-3].il; + dialog.y = yyvsp[-2].il; + dialog.width = yyvsp[-1].il; + dialog.height = yyvsp[0].il; + dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; + dialog.exstyle = yyvsp[-4].il; + dialog.menu.named = 1; + dialog.class.named = 1; + dialog.font = NULL; + dialog.ex = NULL; + dialog.controls = NULL; + sub_res_info = yyvsp[-5].res_info; + ; + break;} +case 37: +#line 346 "rcparse.y" +{ + define_dialog (yyvsp[-12].id, &sub_res_info, &dialog); + ; + break;} +case 38: +#line 351 "rcparse.y" +{ + memset (&dialog, 0, sizeof dialog); + dialog.x = yyvsp[-3].il; + dialog.y = yyvsp[-2].il; + dialog.width = yyvsp[-1].il; + dialog.height = yyvsp[0].il; + dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; + dialog.exstyle = yyvsp[-4].il; + dialog.menu.named = 1; + dialog.class.named = 1; + dialog.font = NULL; + dialog.ex = ((struct dialog_ex *) + res_alloc (sizeof (struct dialog_ex))); + memset (dialog.ex, 0, sizeof (struct dialog_ex)); + dialog.controls = NULL; + sub_res_info = yyvsp[-5].res_info; + ; + break;} +case 39: +#line 369 "rcparse.y" +{ + define_dialog (yyvsp[-12].id, &sub_res_info, &dialog); + ; + break;} +case 40: +#line 374 "rcparse.y" +{ + memset (&dialog, 0, sizeof dialog); + dialog.x = yyvsp[-4].il; + dialog.y = yyvsp[-3].il; + dialog.width = yyvsp[-2].il; + dialog.height = yyvsp[-1].il; + dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU; + dialog.exstyle = yyvsp[-5].il; + dialog.menu.named = 1; + dialog.class.named = 1; + dialog.font = NULL; + dialog.ex = ((struct dialog_ex *) + res_alloc (sizeof (struct dialog_ex))); + memset (dialog.ex, 0, sizeof (struct dialog_ex)); + dialog.ex->help = yyvsp[0].il; + dialog.controls = NULL; + sub_res_info = yyvsp[-6].res_info; + ; + break;} +case 41: +#line 393 "rcparse.y" +{ + define_dialog (yyvsp[-13].id, &sub_res_info, &dialog); + ; + break;} +case 42: +#line 400 "rcparse.y" +{ + yyval.il = 0; + ; + break;} +case 43: +#line 404 "rcparse.y" +{ + yyval.il = yyvsp[0].il; + ; + break;} +case 45: +#line 412 "rcparse.y" +{ + unicode_from_ascii ((int *) NULL, &dialog.caption, yyvsp[0].s); + ; + break;} +case 46: +#line 416 "rcparse.y" +{ + dialog.class = yyvsp[0].id; + ; + break;} +case 47: +#line 420 "rcparse.y" +{ style = dialog.style; ; + break;} +case 48: +#line 422 "rcparse.y" +{ + dialog.style = style; + ; + break;} +case 49: +#line 426 "rcparse.y" +{ + dialog.exstyle = yyvsp[0].il; + ; + break;} +case 50: +#line 430 "rcparse.y" +{ + dialog.style |= DS_SETFONT; + dialog.pointsize = yyvsp[-2].il; + unicode_from_ascii ((int *) NULL, &dialog.font, yyvsp[0].s); + ; + break;} +case 51: +#line 436 "rcparse.y" +{ + dialog.style |= DS_SETFONT; + dialog.pointsize = yyvsp[-4].il; + unicode_from_ascii ((int *) NULL, &dialog.font, yyvsp[-2].s); + if (dialog.ex == NULL) + rcparse_warning (_("extended FONT requires DIALOGEX")); + else + { + dialog.ex->weight = yyvsp[-1].il; + dialog.ex->italic = yyvsp[0].il; + } + ; + break;} +case 52: +#line 449 "rcparse.y" +{ + dialog.menu = yyvsp[0].id; + ; + break;} +case 53: +#line 453 "rcparse.y" +{ + sub_res_info.characteristics = yyvsp[0].il; + ; + break;} +case 54: +#line 457 "rcparse.y" +{ + sub_res_info.language = yyvsp[-1].il | (yyvsp[0].il << 8); + ; + break;} +case 55: +#line 461 "rcparse.y" +{ + sub_res_info.version = yyvsp[0].il; + ; + break;} +case 57: +#line 469 "rcparse.y" +{ + struct dialog_control **pp; + + for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next) + ; + *pp = yyvsp[0].dialog_control; + ; + break;} +case 58: +#line 480 "rcparse.y" +{ + default_style = BS_AUTO3STATE | WS_TABSTOP; + base_style = BS_AUTO3STATE; + class = CTL_BUTTON; + ; + break;} +case 59: +#line 486 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 60: +#line 490 "rcparse.y" +{ + default_style = BS_AUTOCHECKBOX | WS_TABSTOP; + base_style = BS_AUTOCHECKBOX; + class = CTL_BUTTON; + ; + break;} +case 61: +#line 496 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 62: +#line 500 "rcparse.y" +{ + default_style = BS_AUTORADIOBUTTON | WS_TABSTOP; + base_style = BS_AUTORADIOBUTTON; + class = CTL_BUTTON; + ; + break;} +case 63: +#line 506 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 64: +#line 510 "rcparse.y" +{ + default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + class = CTL_EDIT; + ; + break;} +case 65: +#line 516 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + if (dialog.ex == NULL) + rcparse_warning (_("IEDIT requires DIALOGEX")); + res_string_to_id (&yyval.dialog_control->class, "BEDIT"); + ; + break;} +case 66: +#line 523 "rcparse.y" +{ + default_style = BS_CHECKBOX | WS_TABSTOP; + base_style = BS_CHECKBOX | WS_TABSTOP; + class = CTL_BUTTON; + ; + break;} +case 67: +#line 529 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 68: +#line 533 "rcparse.y" +{ + default_style = CBS_SIMPLE | WS_TABSTOP; + base_style = 0; + class = CTL_COMBOBOX; + ; + break;} +case 69: +#line 539 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 70: +#line 544 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-7].il, style, yyvsp[-1].il); + if (yyvsp[0].rcdata_item != NULL) + { + if (dialog.ex == NULL) + rcparse_warning (_("control data requires DIALOGEX")); + yyval.dialog_control->data = yyvsp[0].rcdata_item; + } + ; + break;} +case 71: +#line 555 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-10].s, yyvsp[-9].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-8].il, style, yyvsp[-2].il); + if (dialog.ex == NULL) + rcparse_warning (_("help ID requires DIALOGEX")); + yyval.dialog_control->help = yyvsp[-1].il; + yyval.dialog_control->data = yyvsp[0].rcdata_item; + ; + break;} +case 72: +#line 564 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-10].s, yyvsp[-9].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-2].il, 0, style, yyvsp[-1].il); + if (yyvsp[0].rcdata_item != NULL) + { + if (dialog.ex == NULL) + rcparse_warning ("control data requires DIALOGEX"); + yyval.dialog_control->data = yyvsp[0].rcdata_item; + } + yyval.dialog_control->class.named = 1; + unicode_from_ascii(&yyval.dialog_control->class.u.n.length, &yyval.dialog_control->class.u.n.name, yyvsp[-7].s); + ; + break;} +case 73: +#line 577 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-11].s, yyvsp[-10].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, 0, style, yyvsp[-2].il); + if (dialog.ex == NULL) + rcparse_warning ("help ID requires DIALOGEX"); + yyval.dialog_control->help = yyvsp[-1].il; + yyval.dialog_control->data = yyvsp[0].rcdata_item; + yyval.dialog_control->class.named = 1; + unicode_from_ascii(&yyval.dialog_control->class.u.n.length, &yyval.dialog_control->class.u.n.name, yyvsp[-8].s); + ; + break;} +case 74: +#line 587 "rcparse.y" +{ + default_style = SS_CENTER | WS_GROUP; + base_style = SS_CENTER; + class = CTL_STATIC; + ; + break;} +case 75: +#line 593 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 76: +#line 597 "rcparse.y" +{ + default_style = BS_DEFPUSHBUTTON | WS_TABSTOP; + base_style = BS_DEFPUSHBUTTON | WS_TABSTOP; + class = CTL_BUTTON; + ; + break;} +case 77: +#line 603 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 78: +#line 607 "rcparse.y" +{ + default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + class = CTL_EDIT; + ; + break;} +case 79: +#line 613 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 80: +#line 617 "rcparse.y" +{ + default_style = BS_GROUPBOX; + base_style = BS_GROUPBOX; + class = CTL_BUTTON; + ; + break;} +case 81: +#line 623 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 82: +#line 627 "rcparse.y" +{ + default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + class = CTL_EDIT; + ; + break;} +case 83: +#line 633 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + if (dialog.ex == NULL) + rcparse_warning (_("IEDIT requires DIALOGEX")); + res_string_to_id (&yyval.dialog_control->class, "HEDIT"); + ; + break;} +case 84: +#line 640 "rcparse.y" +{ + yyval.dialog_control = define_icon_control (yyvsp[-4].id, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, 0, 0, 0, yyvsp[0].rcdata_item, + dialog.ex); + ; + break;} +case 85: +#line 646 "rcparse.y" +{ + yyval.dialog_control = define_icon_control (yyvsp[-6].id, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, 0, 0, 0, yyvsp[0].rcdata_item, + dialog.ex); + ; + break;} +case 86: +#line 652 "rcparse.y" +{ + yyval.dialog_control = define_icon_control (yyvsp[-8].id, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, style, yyvsp[-1].il, 0, yyvsp[0].rcdata_item, + dialog.ex); + ; + break;} +case 87: +#line 658 "rcparse.y" +{ + yyval.dialog_control = define_icon_control (yyvsp[-9].id, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, style, yyvsp[-2].il, yyvsp[-1].il, yyvsp[0].rcdata_item, + dialog.ex); + ; + break;} +case 88: +#line 663 "rcparse.y" +{ + default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; + class = CTL_EDIT; + ; + break;} +case 89: +#line 669 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + if (dialog.ex == NULL) + rcparse_warning (_("IEDIT requires DIALOGEX")); + res_string_to_id (&yyval.dialog_control->class, "IEDIT"); + ; + break;} +case 90: +#line 676 "rcparse.y" +{ + default_style = LBS_NOTIFY | WS_BORDER; + base_style = LBS_NOTIFY | WS_BORDER; + class = CTL_LISTBOX; + ; + break;} +case 91: +#line 682 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 92: +#line 686 "rcparse.y" +{ + default_style = SS_LEFT | WS_GROUP; + base_style = SS_LEFT; + class = CTL_STATIC; + ; + break;} +case 93: +#line 692 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 94: +#line 696 "rcparse.y" +{ + default_style = BS_PUSHBOX | WS_TABSTOP; + base_style = BS_PUSHBOX; + class = CTL_BUTTON; + ; + break;} +case 95: +#line 702 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 96: +#line 706 "rcparse.y" +{ + default_style = BS_PUSHBUTTON | WS_TABSTOP; + base_style = BS_PUSHBUTTON | WS_TABSTOP; + class = CTL_BUTTON; + ; + break;} +case 97: +#line 712 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 98: +#line 716 "rcparse.y" +{ + default_style = BS_RADIOBUTTON | WS_TABSTOP; + base_style = BS_RADIOBUTTON; + class = CTL_BUTTON; + ; + break;} +case 99: +#line 722 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 100: +#line 726 "rcparse.y" +{ + default_style = SS_RIGHT | WS_GROUP; + base_style = SS_RIGHT; + class = CTL_STATIC; + ; + break;} +case 101: +#line 732 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 102: +#line 736 "rcparse.y" +{ + default_style = SBS_HORZ; + base_style = 0; + class = CTL_SCROLLBAR; + ; + break;} +case 103: +#line 742 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 104: +#line 746 "rcparse.y" +{ + default_style = BS_3STATE | WS_TABSTOP; + base_style = BS_3STATE; + class = CTL_BUTTON; + ; + break;} +case 105: +#line 752 "rcparse.y" +{ + yyval.dialog_control = yyvsp[0].dialog_control; + ; + break;} +case 106: +#line 757 "rcparse.y" +{ style = WS_CHILD | WS_VISIBLE; ; + break;} +case 107: +#line 759 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-14].s, yyvsp[-12].il, yyvsp[-10].il, yyvsp[-8].il, yyvsp[-6].il, yyvsp[-4].il, CTL_BUTTON, + style, yyvsp[0].il); + ; + break;} +case 108: +#line 775 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-6].s, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, class, + default_style | WS_CHILD | WS_VISIBLE, 0); + if (yyvsp[0].rcdata_item != NULL) + { + if (dialog.ex == NULL) + rcparse_warning (_("control data requires DIALOGEX")); + yyval.dialog_control->data = yyvsp[0].rcdata_item; + } + ; + break;} +case 109: +#line 787 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-8].s, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, class, style, yyvsp[-1].il); + if (yyvsp[0].rcdata_item != NULL) + { + if (dialog.ex == NULL) + rcparse_warning (_("control data requires DIALOGEX")); + yyval.dialog_control->data = yyvsp[0].rcdata_item; + } + ; + break;} +case 110: +#line 798 "rcparse.y" +{ + yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, class, style, yyvsp[-2].il); + if (dialog.ex == NULL) + rcparse_warning (_("help ID requires DIALOGEX")); + yyval.dialog_control->help = yyvsp[-1].il; + yyval.dialog_control->data = yyvsp[0].rcdata_item; + ; + break;} +case 111: +#line 809 "rcparse.y" +{ + yyval.s = NULL; + ; + break;} +case 112: +#line 813 "rcparse.y" +{ + yyval.s = yyvsp[0].s; + ; + break;} +case 113: +#line 817 "rcparse.y" +{ + yyval.s = yyvsp[-1].s; + ; + break;} +case 114: +#line 824 "rcparse.y" +{ + yyval.rcdata_item = NULL; + ; + break;} +case 115: +#line 828 "rcparse.y" +{ + yyval.rcdata_item = yyvsp[-1].rcdata.first; + ; + break;} +case 116: +#line 837 "rcparse.y" +{ style = WS_CHILD | WS_VISIBLE; ; + break;} +case 118: +#line 843 "rcparse.y" +{ style = SS_ICON | WS_CHILD | WS_VISIBLE; ; + break;} +case 120: +#line 849 "rcparse.y" +{ style = base_style | WS_CHILD | WS_VISIBLE; ; + break;} +case 122: +#line 857 "rcparse.y" +{ + define_font (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); + ; + break;} +case 123: +#line 866 "rcparse.y" +{ + define_icon (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); + ; + break;} +case 124: +#line 876 "rcparse.y" +{ + language = yyvsp[-1].il | (yyvsp[0].il << 8); + ; + break;} +case 125: +#line 885 "rcparse.y" +{ + define_menu (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].menuitem); + ; + break;} +case 126: +#line 892 "rcparse.y" +{ + yyval.menuitem = NULL; + ; + break;} +case 127: +#line 896 "rcparse.y" +{ + if (yyvsp[-1].menuitem == NULL) + yyval.menuitem = yyvsp[0].menuitem; + else + { + struct menuitem **pp; + + for (pp = &yyvsp[-1].menuitem->next; *pp != NULL; pp = &(*pp)->next) + ; + *pp = yyvsp[0].menuitem; + yyval.menuitem = yyvsp[-1].menuitem; + } + ; + break;} +case 128: +#line 913 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-2].s, yyvsp[-1].il, yyvsp[0].is, 0, 0, NULL); + ; + break;} +case 129: +#line 917 "rcparse.y" +{ + yyval.menuitem = define_menuitem (NULL, 0, 0, 0, 0, NULL); + ; + break;} +case 130: +#line 921 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-4].s, 0, yyvsp[-3].is, 0, 0, yyvsp[-1].menuitem); + ; + break;} +case 131: +#line 928 "rcparse.y" +{ + yyval.is = 0; + ; + break;} +case 132: +#line 932 "rcparse.y" +{ + yyval.is = yyvsp[-2].is | yyvsp[0].is; + ; + break;} +case 133: +#line 936 "rcparse.y" +{ + yyval.is = yyvsp[-1].is | yyvsp[0].is; + ; + break;} +case 134: +#line 943 "rcparse.y" +{ + yyval.is = MENUITEM_CHECKED; + ; + break;} +case 135: +#line 947 "rcparse.y" +{ + yyval.is = MENUITEM_GRAYED; + ; + break;} +case 136: +#line 951 "rcparse.y" +{ + yyval.is = MENUITEM_HELP; + ; + break;} +case 137: +#line 955 "rcparse.y" +{ + yyval.is = MENUITEM_INACTIVE; + ; + break;} +case 138: +#line 959 "rcparse.y" +{ + yyval.is = MENUITEM_MENUBARBREAK; + ; + break;} +case 139: +#line 963 "rcparse.y" +{ + yyval.is = MENUITEM_MENUBREAK; + ; + break;} +case 140: +#line 972 "rcparse.y" +{ + define_menu (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].menuitem); + ; + break;} +case 141: +#line 979 "rcparse.y" +{ + yyval.menuitem = NULL; + ; + break;} +case 142: +#line 983 "rcparse.y" +{ + if (yyvsp[-1].menuitem == NULL) + yyval.menuitem = yyvsp[0].menuitem; + else + { + struct menuitem **pp; + + for (pp = &yyvsp[-1].menuitem->next; *pp != NULL; pp = &(*pp)->next) + ; + *pp = yyvsp[0].menuitem; + yyval.menuitem = yyvsp[-1].menuitem; + } + ; + break;} +case 143: +#line 1000 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[0].s, 0, 0, 0, 0, NULL); + ; + break;} +case 144: +#line 1004 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-1].s, yyvsp[0].il, 0, 0, 0, NULL); + ; + break;} +case 145: +#line 1008 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-3].s, yyvsp[-2].il, yyvsp[-1].il, yyvsp[0].il, 0, NULL); + ; + break;} +case 146: +#line 1012 "rcparse.y" +{ + yyval.menuitem = define_menuitem (NULL, 0, 0, 0, 0, NULL); + ; + break;} +case 147: +#line 1016 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-3].s, 0, 0, 0, 0, yyvsp[-1].menuitem); + ; + break;} +case 148: +#line 1020 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-4].s, yyvsp[-3].il, 0, 0, 0, yyvsp[-1].menuitem); + ; + break;} +case 149: +#line 1024 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-5].s, yyvsp[-4].il, yyvsp[-3].il, 0, 0, yyvsp[-1].menuitem); + ; + break;} +case 150: +#line 1029 "rcparse.y" +{ + yyval.menuitem = define_menuitem (yyvsp[-7].s, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-1].menuitem); + ; + break;} +case 151: +#line 1038 "rcparse.y" +{ + define_messagetable (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); + ; + break;} +case 152: +#line 1047 "rcparse.y" +{ + define_rcdata (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].rcdata.first); + ; + break;} +case 153: +#line 1056 "rcparse.y" +{ + rcparse_rcdata (); + ; + break;} +case 154: +#line 1060 "rcparse.y" +{ + rcparse_normal (); + yyval.rcdata = yyvsp[0].rcdata; + ; + break;} +case 155: +#line 1068 "rcparse.y" +{ + yyval.rcdata.first = NULL; + yyval.rcdata.last = NULL; + ; + break;} +case 156: +#line 1073 "rcparse.y" +{ + yyval.rcdata = yyvsp[0].rcdata; + ; + break;} +case 157: +#line 1080 "rcparse.y" +{ + struct rcdata_item *ri; + + ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length); + yyval.rcdata.first = ri; + yyval.rcdata.last = ri; + ; + break;} +case 158: +#line 1088 "rcparse.y" +{ + struct rcdata_item *ri; + + ri = define_rcdata_number (yyvsp[0].i.val, yyvsp[0].i.dword); + yyval.rcdata.first = ri; + yyval.rcdata.last = ri; + ; + break;} +case 159: +#line 1096 "rcparse.y" +{ + struct rcdata_item *ri; + + ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length); + yyval.rcdata.first = yyvsp[-2].rcdata.first; + yyvsp[-2].rcdata.last->next = ri; + yyval.rcdata.last = ri; + ; + break;} +case 160: +#line 1105 "rcparse.y" +{ + struct rcdata_item *ri; + + ri = define_rcdata_number (yyvsp[0].i.val, yyvsp[0].i.dword); + yyval.rcdata.first = yyvsp[-2].rcdata.first; + yyvsp[-2].rcdata.last->next = ri; + yyval.rcdata.last = ri; + ; + break;} +case 161: +#line 1119 "rcparse.y" +{ sub_res_info = yyvsp[-1].res_info; ; + break;} +case 164: +#line 1126 "rcparse.y" +{ + define_stringtable (&sub_res_info, yyvsp[-1].il, yyvsp[0].s); + ; + break;} +case 165: +#line 1130 "rcparse.y" +{ + define_stringtable (&sub_res_info, yyvsp[-2].il, yyvsp[0].s); + ; + break;} +case 166: +#line 1140 "rcparse.y" +{ + define_user_data (yyvsp[-5].id, yyvsp[-4].id, &yyvsp[-3].res_info, yyvsp[-1].rcdata.first); + ; + break;} +case 167: +#line 1144 "rcparse.y" +{ + define_user_file (yyvsp[-3].id, yyvsp[-2].id, &yyvsp[-1].res_info, yyvsp[0].s); + ; + break;} +case 168: +#line 1153 "rcparse.y" +{ + define_versioninfo (yyvsp[-5].id, language, yyvsp[-3].fixver, yyvsp[-1].verinfo); + ; + break;} +case 169: +#line 1160 "rcparse.y" +{ + yyval.fixver = ((struct fixed_versioninfo *) + res_alloc (sizeof (struct fixed_versioninfo))); + memset (yyval.fixver, 0, sizeof (struct fixed_versioninfo)); + ; + break;} +case 170: +#line 1166 "rcparse.y" +{ + yyvsp[-5].fixver->file_version_ms = (yyvsp[-3].il << 16) | yyvsp[-2].il; + yyvsp[-5].fixver->file_version_ls = (yyvsp[-1].il << 16) | yyvsp[0].il; + yyval.fixver = yyvsp[-5].fixver; + ; + break;} +case 171: +#line 1172 "rcparse.y" +{ + yyvsp[-5].fixver->product_version_ms = (yyvsp[-3].il << 16) | yyvsp[-2].il; + yyvsp[-5].fixver->product_version_ls = (yyvsp[-1].il << 16) | yyvsp[0].il; + yyval.fixver = yyvsp[-5].fixver; + ; + break;} +case 172: +#line 1178 "rcparse.y" +{ + yyvsp[-2].fixver->file_flags_mask = yyvsp[0].il; + yyval.fixver = yyvsp[-2].fixver; + ; + break;} +case 173: +#line 1183 "rcparse.y" +{ + yyvsp[-2].fixver->file_flags = yyvsp[0].il; + yyval.fixver = yyvsp[-2].fixver; + ; + break;} +case 174: +#line 1188 "rcparse.y" +{ + yyvsp[-2].fixver->file_os = yyvsp[0].il; + yyval.fixver = yyvsp[-2].fixver; + ; + break;} +case 175: +#line 1193 "rcparse.y" +{ + yyvsp[-2].fixver->file_type = yyvsp[0].il; + yyval.fixver = yyvsp[-2].fixver; + ; + break;} +case 176: +#line 1198 "rcparse.y" +{ + yyvsp[-2].fixver->file_subtype = yyvsp[0].il; + yyval.fixver = yyvsp[-2].fixver; + ; + break;} +case 177: +#line 1212 "rcparse.y" +{ + yyval.verinfo = NULL; + ; + break;} +case 178: +#line 1216 "rcparse.y" +{ + yyval.verinfo = append_ver_stringfileinfo (yyvsp[-7].verinfo, yyvsp[-4].s, yyvsp[-2].verstring); + ; + break;} +case 179: +#line 1220 "rcparse.y" +{ + yyval.verinfo = append_ver_varfileinfo (yyvsp[-6].verinfo, yyvsp[-2].s, yyvsp[-1].vervar); + ; + break;} +case 180: +#line 1227 "rcparse.y" +{ + yyval.verstring = NULL; + ; + break;} +case 181: +#line 1231 "rcparse.y" +{ + yyval.verstring = append_verval (yyvsp[-4].verstring, yyvsp[-2].s, yyvsp[0].s); + ; + break;} +case 182: +#line 1238 "rcparse.y" +{ + yyval.vervar = NULL; + ; + break;} +case 183: +#line 1242 "rcparse.y" +{ + yyval.vervar = append_vertrans (yyvsp[-2].vervar, yyvsp[-1].il, yyvsp[0].il); + ; + break;} +case 184: +#line 1251 "rcparse.y" +{ + yyval.id.named = 0; + yyval.id.u.id = yyvsp[0].il; + ; + break;} +case 185: +#line 1256 "rcparse.y" +{ + char *copy, *s; + + /* It seems that resource ID's are forced to upper case. */ + copy = xstrdup (yyvsp[0].s); + for (s = copy; *s != '\0'; s++) + if (islower ((unsigned char) *s)) + *s = toupper ((unsigned char) *s); + res_string_to_id (&yyval.id, copy); + free (copy); + ; + break;} +case 186: +#line 1273 "rcparse.y" +{ + yyval.s = yyvsp[0].s; + ; + break;} +case 187: +#line 1277 "rcparse.y" +{ + yyval.s = yyvsp[-1].s; + ; + break;} +case 188: +#line 1281 "rcparse.y" +{ + yyval.s = yyvsp[-1].s; + ; + break;} +case 189: +#line 1289 "rcparse.y" +{ + yyval.id.named = 0; + yyval.id.u.id = yyvsp[-1].il; + ; + break;} +case 190: +#line 1294 "rcparse.y" +{ + char *copy, *s; + + /* It seems that resource ID's are forced to upper case. */ + copy = xstrdup (yyvsp[0].s); + for (s = copy; *s != '\0'; s++) + if (islower ((unsigned char) *s)) + *s = toupper ((unsigned char) *s); + res_string_to_id (&yyval.id, copy); + free (copy); + ; + break;} +case 191: +#line 1312 "rcparse.y" +{ + memset (&yyval.res_info, 0, sizeof (struct res_res_info)); + yyval.res_info.language = language; + /* FIXME: Is this the right default? */ + yyval.res_info.memflags = MEMFLAG_MOVEABLE; + ; + break;} +case 192: +#line 1319 "rcparse.y" +{ + yyval.res_info = yyvsp[-1].res_info; + yyval.res_info.memflags |= yyvsp[0].memflags.on; + yyval.res_info.memflags &=~ yyvsp[0].memflags.off; + ; + break;} +case 193: +#line 1325 "rcparse.y" +{ + yyval.res_info = yyvsp[-2].res_info; + yyval.res_info.characteristics = yyvsp[0].il; + ; + break;} +case 194: +#line 1330 "rcparse.y" +{ + yyval.res_info = yyvsp[-3].res_info; + yyval.res_info.language = yyvsp[-1].il | (yyvsp[0].il << 8); + ; + break;} +case 195: +#line 1335 "rcparse.y" +{ + yyval.res_info = yyvsp[-2].res_info; + yyval.res_info.version = yyvsp[0].il; + ; + break;} +case 196: +#line 1345 "rcparse.y" +{ + memset (&yyval.res_info, 0, sizeof (struct res_res_info)); + yyval.res_info.language = language; + yyval.res_info.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; + ; + break;} +case 197: +#line 1351 "rcparse.y" +{ + yyval.res_info = yyvsp[-1].res_info; + yyval.res_info.memflags |= yyvsp[0].memflags.on; + yyval.res_info.memflags &=~ yyvsp[0].memflags.off; + ; + break;} +case 198: +#line 1362 "rcparse.y" +{ + memset (&yyval.res_info, 0, sizeof (struct res_res_info)); + yyval.res_info.language = language; + yyval.res_info.memflags = MEMFLAG_MOVEABLE; + ; + break;} +case 199: +#line 1368 "rcparse.y" +{ + yyval.res_info = yyvsp[-1].res_info; + yyval.res_info.memflags |= yyvsp[0].memflags.on; + yyval.res_info.memflags &=~ yyvsp[0].memflags.off; + ; + break;} +case 200: +#line 1380 "rcparse.y" +{ + yyval.memflags.on = MEMFLAG_MOVEABLE; + yyval.memflags.off = 0; + ; + break;} +case 201: +#line 1385 "rcparse.y" +{ + yyval.memflags.on = 0; + yyval.memflags.off = MEMFLAG_MOVEABLE; + ; + break;} +case 202: +#line 1390 "rcparse.y" +{ + yyval.memflags.on = MEMFLAG_PURE; + yyval.memflags.off = 0; + ; + break;} +case 203: +#line 1395 "rcparse.y" +{ + yyval.memflags.on = 0; + yyval.memflags.off = MEMFLAG_PURE; + ; + break;} +case 204: +#line 1400 "rcparse.y" +{ + yyval.memflags.on = MEMFLAG_PRELOAD; + yyval.memflags.off = 0; + ; + break;} +case 205: +#line 1405 "rcparse.y" +{ + yyval.memflags.on = 0; + yyval.memflags.off = MEMFLAG_PRELOAD; + ; + break;} +case 206: +#line 1410 "rcparse.y" +{ + yyval.memflags.on = MEMFLAG_DISCARDABLE; + yyval.memflags.off = 0; + ; + break;} +case 207: +#line 1420 "rcparse.y" +{ + yyval.s = yyvsp[0].s; + ; + break;} +case 208: +#line 1424 "rcparse.y" +{ + yyval.s = yyvsp[0].s; + ; + break;} +case 209: +#line 1441 "rcparse.y" +{ + style |= yyvsp[0].il; + ; + break;} +case 210: +#line 1445 "rcparse.y" +{ + style &=~ yyvsp[0].il; + ; + break;} +case 211: +#line 1449 "rcparse.y" +{ + style |= yyvsp[0].il; + ; + break;} +case 212: +#line 1453 "rcparse.y" +{ + style &=~ yyvsp[0].il; + ; + break;} +case 213: +#line 1460 "rcparse.y" +{ + yyval.il = yyvsp[0].i.val; + ; + break;} +case 214: +#line 1464 "rcparse.y" +{ + yyval.il = yyvsp[-1].il; + ; + break;} +case 215: +#line 1473 "rcparse.y" +{ + yyval.il = 0; + ; + break;} +case 216: +#line 1477 "rcparse.y" +{ + yyval.il = yyvsp[0].il; + ; + break;} +case 217: +#line 1486 "rcparse.y" +{ + yyval.il = yyvsp[0].il; + ; + break;} +case 218: +#line 1495 "rcparse.y" +{ + yyval.il = yyvsp[0].i.val; + ; + break;} +case 219: +#line 1504 "rcparse.y" +{ + yyval.i = yyvsp[0].i; + ; + break;} +case 220: +#line 1508 "rcparse.y" +{ + yyval.i = yyvsp[-1].i; + ; + break;} +case 221: +#line 1512 "rcparse.y" +{ + yyval.i.val = ~ yyvsp[0].i.val; + yyval.i.dword = yyvsp[0].i.dword; + ; + break;} +case 222: +#line 1517 "rcparse.y" +{ + yyval.i.val = - yyvsp[0].i.val; + yyval.i.dword = yyvsp[0].i.dword; + ; + break;} +case 223: +#line 1522 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val * yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 224: +#line 1527 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val / yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 225: +#line 1532 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val % yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 226: +#line 1537 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val + yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 227: +#line 1542 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val - yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 228: +#line 1547 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val & yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 229: +#line 1552 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val ^ yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 230: +#line 1557 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val | yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 231: +#line 1568 "rcparse.y" +{ + yyval.il = yyvsp[0].il; + ; + break;} +case 232: +#line 1577 "rcparse.y" +{ + yyval.il = yyvsp[0].i.val; + ; + break;} +case 233: +#line 1588 "rcparse.y" +{ + yyval.i = yyvsp[0].i; + ; + break;} +case 234: +#line 1592 "rcparse.y" +{ + yyval.i = yyvsp[-1].i; + ; + break;} +case 235: +#line 1596 "rcparse.y" +{ + yyval.i.val = ~ yyvsp[0].i.val; + yyval.i.dword = yyvsp[0].i.dword; + ; + break;} +case 236: +#line 1601 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val * yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 237: +#line 1606 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val / yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 238: +#line 1611 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val % yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 239: +#line 1616 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val + yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 240: +#line 1621 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val - yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 241: +#line 1626 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val & yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 242: +#line 1631 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val ^ yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +case 243: +#line 1636 "rcparse.y" +{ + yyval.i.val = yyvsp[-2].i.val | yyvsp[0].i.val; + yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/misc/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 1642 "rcparse.y" + + +/* Set the language from the command line. */ + +void +rcparse_set_language (lang) + int lang; +{ + language = lang; +} diff --git a/binutils/rcparse.h b/binutils/rcparse.h new file mode 100644 index 0000000..9661d54 --- /dev/null +++ b/binutils/rcparse.h @@ -0,0 +1,125 @@ +typedef union +{ + struct accelerator acc; + struct accelerator *pacc; + struct dialog_control *dialog_control; + struct menuitem *menuitem; + struct + { + struct rcdata_item *first; + struct rcdata_item *last; + } rcdata; + struct rcdata_item *rcdata_item; + struct stringtable_data *stringtable; + struct fixed_versioninfo *fixver; + struct ver_info *verinfo; + struct ver_stringinfo *verstring; + struct ver_varinfo *vervar; + struct res_id id; + struct res_res_info res_info; + struct + { + unsigned short on; + unsigned short off; + } memflags; + struct + { + unsigned long val; + /* Nonzero if this number was explicitly specified as long. */ + int dword; + } i; + unsigned long il; + unsigned short is; + const char *s; + struct + { + unsigned long length; + const char *s; + } ss; +} YYSTYPE; +#define BEG 257 +#define END 258 +#define ACCELERATORS 259 +#define VIRTKEY 260 +#define ASCII 261 +#define NOINVERT 262 +#define SHIFT 263 +#define CONTROL 264 +#define ALT 265 +#define BITMAP 266 +#define CURSOR 267 +#define DIALOG 268 +#define DIALOGEX 269 +#define EXSTYLE 270 +#define CAPTION 271 +#define CLASS 272 +#define STYLE 273 +#define AUTO3STATE 274 +#define AUTOCHECKBOX 275 +#define AUTORADIOBUTTON 276 +#define CHECKBOX 277 +#define COMBOBOX 278 +#define CTEXT 279 +#define DEFPUSHBUTTON 280 +#define EDITTEXT 281 +#define GROUPBOX 282 +#define LISTBOX 283 +#define LTEXT 284 +#define PUSHBOX 285 +#define PUSHBUTTON 286 +#define RADIOBUTTON 287 +#define RTEXT 288 +#define SCROLLBAR 289 +#define STATE3 290 +#define USERBUTTON 291 +#define BEDIT 292 +#define HEDIT 293 +#define IEDIT 294 +#define FONT 295 +#define ICON 296 +#define LANGUAGE 297 +#define CHARACTERISTICS 298 +#define VERSIONK 299 +#define MENU 300 +#define MENUEX 301 +#define MENUITEM 302 +#define SEPARATOR 303 +#define POPUP 304 +#define CHECKED 305 +#define GRAYED 306 +#define HELP 307 +#define INACTIVE 308 +#define MENUBARBREAK 309 +#define MENUBREAK 310 +#define MESSAGETABLE 311 +#define RCDATA 312 +#define STRINGTABLE 313 +#define VERSIONINFO 314 +#define FILEVERSION 315 +#define PRODUCTVERSION 316 +#define FILEFLAGSMASK 317 +#define FILEFLAGS 318 +#define FILEOS 319 +#define FILETYPE 320 +#define FILESUBTYPE 321 +#define BLOCKSTRINGFILEINFO 322 +#define BLOCKVARFILEINFO 323 +#define VALUE 324 +#define BLOCK 325 +#define MOVEABLE 326 +#define FIXED 327 +#define PURE 328 +#define IMPURE 329 +#define PRELOAD 330 +#define LOADONCALL 331 +#define DISCARDABLE 332 +#define NOT 333 +#define QUOTEDSTRING 334 +#define STRING 335 +#define NUMBER 336 +#define SIZEDSTRING 337 +#define IGNORED_TOKEN 338 +#define NEG 339 + + +extern YYSTYPE yylval; diff --git a/binutils/sysinfo.c b/binutils/sysinfo.c new file mode 100644 index 0000000..68c258c --- /dev/null +++ b/binutils/sysinfo.c @@ -0,0 +1,1309 @@ + +/* A Bison parser, made from sysinfo.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define COND 257 +#define REPEAT 258 +#define TYPE 259 +#define NAME 260 +#define NUMBER 261 +#define UNIT 262 + +#line 1 "sysinfo.y" + +#include <stdio.h> +#include <stdlib.h> + +extern char *word; +extern char writecode; +extern int number; +extern int unit; +char nice_name[1000]; +char *it; +int sofar; +int width; +int code; +char * repeat; +char *oldrepeat; +char *name; +int rdepth; +char *loop [] = {"","n","m","/*BAD*/"}; +char *names[] = {" ","[n]","[n][m]"}; +char *pnames[]= {"","*","**"}; + +#line 24 "sysinfo.y" +typedef union { + int i; + char *s; +} YYSTYPE; +#include <stdio.h> + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 55 +#define YYFLAG -32768 +#define YYNTBASE 11 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 262 ? yytranslate[x] : 29) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, + 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 7, 8, + 9, 10 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 1, 4, 7, 8, 9, 16, 19, 22, 25, + 26, 27, 34, 35, 42, 43, 54, 56, 57, 61, + 64, 68, 69, 70, 74, 75 +}; + +static const short yyrhs[] = { -1, + 12, 13, 0, 14, 13, 0, 0, 0, 5, 8, + 9, 15, 16, 6, 0, 21, 16, 0, 19, 16, + 0, 17, 16, 0, 0, 0, 5, 4, 8, 18, + 16, 6, 0, 0, 5, 3, 8, 20, 16, 6, + 0, 0, 5, 24, 5, 23, 25, 6, 26, 22, + 27, 6, 0, 7, 0, 0, 5, 8, 6, 0, + 9, 10, 0, 5, 8, 6, 0, 0, 0, 5, + 28, 6, 0, 0, 28, 5, 8, 8, 6, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 38, 59, 75, 76, 79, 130, 150, 152, 153, 154, + 157, 186, 204, 217, 230, 233, 338, 340, 343, 348, + 354, 356, 359, 360, 362, 363 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","COND","REPEAT", +"'('","')'","TYPE","NAME","NUMBER","UNIT","top","@1","it_list","it","@2","it_field_list", +"repeat_it_field","@3","cond_it_field","@4","it_field","@5","attr_type","attr_desc", +"attr_size","attr_id","enums","enum_list", NULL +}; +#endif + +static const short yyr1[] = { 0, + 12, 11, 13, 13, 15, 14, 16, 16, 16, 16, + 18, 17, 20, 19, 22, 21, 23, 23, 24, 25, + 26, 26, 27, 27, 28, 28 +}; + +static const short yyr2[] = { 0, + 0, 2, 2, 0, 0, 6, 2, 2, 2, 0, + 0, 6, 0, 6, 0, 10, 1, 0, 3, 2, + 3, 0, 0, 3, 0, 5 +}; + +static const short yydefact[] = { 1, + 4, 0, 2, 4, 0, 3, 5, 10, 0, 0, + 10, 10, 10, 0, 0, 0, 0, 6, 9, 8, + 7, 13, 11, 0, 18, 10, 10, 19, 17, 0, + 0, 0, 0, 0, 14, 12, 20, 22, 0, 15, + 0, 23, 21, 25, 0, 0, 16, 0, 24, 0, + 0, 26, 0, 0, 0 +}; + +static const short yydefgoto[] = { 53, + 1, 3, 4, 8, 10, 11, 27, 12, 26, 13, + 42, 30, 17, 34, 40, 45, 46 +}; + +static const short yypact[] = {-32768, + 3, 2,-32768, 3, 4,-32768,-32768, 6, 0, 8, + 6, 6, 6, 9, 10, 11, 7,-32768,-32768,-32768, +-32768,-32768,-32768, 14, 15, 6, 6,-32768,-32768, 12, + 17, 18, -1, 19,-32768,-32768,-32768, 21, 20,-32768, + 23, 22,-32768,-32768, 24, 1,-32768, 25,-32768, 26, + 29,-32768, 31, 32,-32768 +}; + +static const short yypgoto[] = {-32768, +-32768, 33,-32768,-32768, -11,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768 +}; + + +#define YYLAST 37 + + +static const short yytable[] = { 19, + 20, 21, 14, 15, 16, 48, 49, 2, 37, 5, + 9, 25, 7, 18, 31, 32, 22, 23, 24, 28, + 33, 29, 35, 36, 38, 39, 44, 41, 43, 47, + 54, 55, 50, 51, 52, 0, 6 +}; + +static const short yycheck[] = { 11, + 12, 13, 3, 4, 5, 5, 6, 5, 10, 8, + 5, 5, 9, 6, 26, 27, 8, 8, 8, 6, + 9, 7, 6, 6, 6, 5, 5, 8, 6, 6, + 0, 0, 8, 8, 6, -1, 4 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/misc/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include <alloca.h> +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include <malloc.h> +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include <malloc.h> */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/misc/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 1: +#line 38 "sysinfo.y" +{ + switch (writecode) + { + case 'i': + printf("#ifdef SYSROFF_SWAP_IN\n"); + break; + case 'p': + printf("#ifdef SYSROFF_p\n"); + break; + case 'd': + break; + case 'g': + printf("#ifdef SYSROFF_SWAP_OUT\n"); + break; + case 'c': + printf("#ifdef SYSROFF_PRINT\n"); + printf("#include <stdio.h>\n"); + printf("#include <stdlib.h>\n"); + break; + } + ; + break;} +case 2: +#line 59 "sysinfo.y" +{ + switch (writecode) { + case 'i': + case 'p': + case 'g': + case 'c': + printf("#endif\n"); + break; + case 'd': + break; + } +; + break;} +case 5: +#line 81 "sysinfo.y" +{ + it = yyvsp[-1].s; code = yyvsp[0].i; + switch (writecode) + { + case 'd': + printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code); + printf("struct IT_%s { \n", it); + break; + case 'i': + printf("void sysroff_swap_%s_in(ptr)\n",yyvsp[-1].s); + printf("struct IT_%s *ptr;\n", it); + printf("{\n"); + printf("char raw[255];\n"); + printf("\tint idx = 0 ;\n"); + printf("\tint size;\n"); + printf("memset(raw,0,255);\n"); + printf("memset(ptr,0,sizeof(*ptr));\n"); + printf("size = fillup(raw);\n"); + break; + case 'g': + printf("void sysroff_swap_%s_out(file,ptr)\n",yyvsp[-1].s); + printf("FILE * file;\n"); + printf("struct IT_%s *ptr;\n", it); + printf("{\n"); + printf("\tchar raw[255];\n"); + printf("\tint idx = 16 ;\n"); + printf("\tmemset (raw, 0, 255);\n"); + printf("\tcode = IT_%s_CODE;\n", it); + break; + case 'o': + printf("void sysroff_swap_%s_out(abfd,ptr)\n",yyvsp[-1].s); + printf("bfd * abfd;\n"); + printf("struct IT_%s *ptr;\n",it); + printf("{\n"); + printf("int idx = 0 ;\n"); + break; + case 'c': + printf("void sysroff_print_%s_out(ptr)\n",yyvsp[-1].s); + printf("struct IT_%s *ptr;\n", it); + printf("{\n"); + printf("itheader(\"%s\", IT_%s_CODE);\n",yyvsp[-1].s,yyvsp[-1].s); + break; + + case 't': + break; + } + + ; + break;} +case 6: +#line 131 "sysinfo.y" +{ + switch (writecode) { + case 'd': + printf("};\n"); + break; + case 'g': + printf("\tchecksum(file,raw, idx, IT_%s_CODE);\n", it); + + case 'i': + + case 'o': + case 'c': + printf("}\n"); + } +; + break;} +case 11: +#line 158 "sysinfo.y" +{ + rdepth++; + switch (writecode) + { + case 'c': + if (rdepth==1) + printf("\tprintf(\"repeat %%d\\n\", %s);\n",yyvsp[0].s); + if (rdepth==2) + printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",yyvsp[0].s); + case 'i': + case 'g': + case 'o': + + if (rdepth==1) + { + printf("\t{ int n; for (n = 0; n < %s; n++) {\n", yyvsp[0].s); + } + if (rdepth == 2) { + printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n", yyvsp[0].s); + } + + break; + } + + oldrepeat = repeat; + repeat = yyvsp[0].s; + ; + break;} +case 12: +#line 188 "sysinfo.y" +{ + repeat = oldrepeat; + oldrepeat =0; + rdepth--; + switch (writecode) + { + case 'i': + case 'g': + case 'o': + case 'c': + printf("\t}}\n"); + } + ; + break;} +case 13: +#line 205 "sysinfo.y" +{ + switch (writecode) + { + case 'i': + case 'g': + case 'o': + case 'c': + printf("\tif (%s) {\n", yyvsp[0].s); + break; + } + ; + break;} +case 14: +#line 218 "sysinfo.y" +{ + switch (writecode) + { + case 'i': + case 'g': + case 'o': + case 'c': + printf("\t}\n"); + } + ; + break;} +case 15: +#line 232 "sysinfo.y" +{name = yyvsp[0].s; ; + break;} +case 16: +#line 234 "sysinfo.y" +{ + char *desc = yyvsp[-8].s; + char *type = yyvsp[-6].s; + int size = yyvsp[-5].i; + char *id = yyvsp[-3].s; +char *p = names[rdepth]; +char *ptr = pnames[rdepth]; + switch (writecode) + { + case 'g': + if (size % 8) + { + + printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n", + id, + names[rdepth], size); + + } + else { + printf("\twrite%s(ptr->%s%s,raw,&idx,%d,file);\n", + type, + id, + names[rdepth],size/8); + } + break; + case 'i': + { + + if (rdepth >= 1) + + { + printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n", + id, + id, + type, + repeat, + id); + } + + if (rdepth == 2) + { + printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n", + id, + id, + type, + repeat, + id); + } + + } + + if (size % 8) + { + printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n", + id, + names[rdepth], + size); + } + else { + printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n", + id, + names[rdepth], + type, + size/8); + } + break; + case 'o': + printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type,size/8,size%8,id,names[rdepth]); + break; + case 'd': + if (repeat) + printf("\t/* repeat %s */\n", repeat); + + if (type[0] == 'I') { + printf("\tint %s%s; \t/* %s */\n",ptr,id, desc); + } + else if (type[0] =='C') { + printf("\tchar %s*%s;\t /* %s */\n",ptr,id, desc); + } + else { + printf("\tbarray %s%s;\t /* %s */\n",ptr,id, desc); + } + break; + case 'c': + printf("tabout();\n"); + printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc, id); + + if (type[0] == 'I') + printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id,p); + else if (type[0] == 'C') + printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id,p); + + else if (type[0] == 'B') + { + printf("\tpbarray(&ptr->%s%s);\n", id,p); + } + else abort(); + break; + } + ; + break;} +case 17: +#line 339 "sysinfo.y" +{ yyval.s = yyvsp[0].s; ; + break;} +case 18: +#line 340 "sysinfo.y" +{ yyval.s = "INT";; + break;} +case 19: +#line 345 "sysinfo.y" +{ yyval.s = yyvsp[-1].s; ; + break;} +case 20: +#line 350 "sysinfo.y" +{ yyval.i = yyvsp[-1].i * yyvsp[0].i; ; + break;} +case 21: +#line 355 "sysinfo.y" +{ yyval.s = yyvsp[-1].s; ; + break;} +case 22: +#line 356 "sysinfo.y" +{ yyval.s = "dummy";; + break;} +case 26: +#line 364 "sysinfo.y" +{ + switch (writecode) + { + case 'd': + printf("#define %s %s\n", yyvsp[-2].s,yyvsp[-1].s); + break; + case 'c': + printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],yyvsp[-1].s,yyvsp[-2].s); + } + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/misc/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 379 "sysinfo.y" + +/* four modes + + -d write structure defintions for sysroff in host format + -i write functions to swap into sysroff format in + -o write functions to swap into sysroff format out + -c write code to print info in human form */ + +int yydebug; +char writecode; + +int +main(ac,av) +int ac; +char **av; +{ + yydebug=0; + if (ac > 1) + writecode = av[1][1]; +if (writecode == 'd') + { + printf("typedef struct { unsigned char *data; int len; } barray; \n"); + printf("typedef int INT;\n"); + printf("typedef char * CHARS;\n"); + + } + yyparse(); +return 0; +} + +int +yyerror(s) + char *s; +{ + fprintf(stderr, "%s\n" , s); + return 0; +} diff --git a/binutils/sysinfo.h b/binutils/sysinfo.h new file mode 100644 index 0000000..871c3be --- /dev/null +++ b/binutils/sysinfo.h @@ -0,0 +1,13 @@ +typedef union { + int i; + char *s; +} YYSTYPE; +#define COND 257 +#define REPEAT 258 +#define TYPE 259 +#define NAME 260 +#define NUMBER 261 +#define UNIT 262 + + +extern YYSTYPE yylval; diff --git a/binutils/syslex.c b/binutils/syslex.c new file mode 100644 index 0000000..73ff50f --- /dev/null +++ b/binutils/syslex.c @@ -0,0 +1,1683 @@ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_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 YY_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 yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#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 ) + * yyless( 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 yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_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 yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_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 yy_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 yy_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 yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_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 YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 25 +#define YY_END_OF_BUFFER 26 +static yyconst short int yy_accept[81] = + { 0, + 0, 0, 26, 25, 7, 8, 5, 25, 1, 2, + 11, 11, 6, 3, 4, 25, 25, 25, 25, 25, + 25, 25, 0, 9, 11, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, + 13, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 12, 15, 0, 23, 0, 0, 0, 0, 0, + 0, 14, 18, 0, 0, 0, 0, 0, 17, 0, + 24, 0, 0, 0, 20, 22, 0, 21, 19, 0 + } ; + +static yyconst int yy_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, 4, 1, 5, 1, 1, 1, 1, 1, 6, + 7, 1, 1, 1, 1, 1, 1, 8, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 1, 10, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 11, 1, 12, 1, 1, 1, 13, 14, 15, 16, + + 17, 18, 19, 20, 21, 1, 1, 22, 1, 23, + 24, 25, 1, 26, 27, 28, 29, 30, 1, 31, + 32, 33, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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 yyconst int yy_meta[34] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 3, 3, 1, + 1, 1, 3, 3, 3, 3, 3, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1 + } ; + +static yyconst short int yy_base[84] = + { 0, + 0, 0, 100, 101, 101, 101, 101, 94, 101, 101, + 26, 28, 0, 101, 101, 82, 26, 18, 74, 79, + 78, 81, 88, 101, 32, 0, 0, 76, 65, 62, + 61, 75, 20, 59, 61, 66, 58, 0, 57, 56, + 54, 63, 53, 62, 54, 101, 59, 48, 53, 46, + 59, 101, 44, 43, 101, 41, 55, 46, 53, 44, + 31, 101, 101, 39, 27, 21, 39, 19, 101, 35, + 101, 33, 26, 29, 101, 101, 28, 101, 101, 101, + 58, 61, 41 + } ; + +static yyconst short int yy_def[84] = + { 0, + 80, 1, 80, 80, 80, 80, 80, 81, 80, 80, + 80, 80, 82, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 81, 80, 80, 83, 82, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 83, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, + 80, 80, 80 + } ; + +static yyconst short int yy_nxt[135] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 4, 4, 4, 4, 4, + 19, 4, 4, 4, 4, 20, 21, 4, 4, 22, + 4, 4, 4, 25, 25, 25, 25, 32, 29, 25, + 25, 33, 44, 38, 79, 78, 30, 77, 45, 76, + 75, 74, 73, 72, 71, 70, 26, 31, 23, 23, + 23, 27, 69, 27, 68, 67, 66, 65, 64, 63, + 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, + 52, 51, 50, 49, 48, 47, 46, 43, 42, 41, + 40, 39, 24, 37, 36, 35, 34, 28, 24, 80, + + 3, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80 + } ; + +static yyconst short int yy_chk[135] = + { 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, 11, 11, 12, 12, 18, 17, 25, + 25, 18, 33, 83, 77, 74, 17, 73, 33, 72, + 70, 68, 67, 66, 65, 64, 11, 17, 81, 81, + 81, 82, 61, 82, 60, 59, 58, 57, 56, 54, + 53, 51, 50, 49, 48, 47, 45, 44, 43, 42, + 41, 40, 39, 37, 36, 35, 34, 32, 31, 30, + 29, 28, 23, 22, 21, 20, 19, 16, 8, 3, + + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_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 yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "syslex.l" +#define INITIAL 0 +#line 2 "syslex.l" +#include "sysinfo.h" +char *word; +int number; +int unit; + +#ifndef yywrap +static int yywrap () { return 1; } +#endif +#line 426 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#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 YY_READ_BUF_SIZE +#define YY_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( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 11 "syslex.l" + +#line 579 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 101 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 12 "syslex.l" +{ return '(';} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 13 "syslex.l" +{ return ')';} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 14 "syslex.l" +{ return '[';} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 15 "syslex.l" +{ return ']';} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 16 "syslex.l" +{ ; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 17 "syslex.l" +{ ; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 18 "syslex.l" +{ ; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 19 "syslex.l" +{ ; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 20 "syslex.l" +{ +yylval.s = malloc(strlen (yytext)); +strcpy(yylval.s, yytext+1); +yylval.s[strlen(yylval.s)-1] = 0; + return NAME; + } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 27 "syslex.l" +{ + yylval.i = strtol(yytext,0,16); + return NUMBER; + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 32 "syslex.l" +{ + yylval.i = atoi(yytext); + return NUMBER; + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 38 "syslex.l" +{ yylval.i =1 ;return UNIT;} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 39 "syslex.l" +{ yylval.i = 1; return UNIT;} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 40 "syslex.l" +{ yylval.i= 8; return UNIT;} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 41 "syslex.l" +{ yylval.i = 8; return UNIT;} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 43 "syslex.l" +{ yylval.s = "INT"; return TYPE;} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 44 "syslex.l" +{ yylval.s = "BARRAY"; return TYPE;} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 45 "syslex.l" +{ yylval.s = "CHARS"; return TYPE;} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 46 "syslex.l" +{ yylval.i = 0; return NUMBER;} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 47 "syslex.l" +{ yylval.i = -4; return NUMBER;} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 48 "syslex.l" +{ yylval.i = -2; return NUMBER; } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 49 "syslex.l" +{ yylval.i = -1; return NUMBER; } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 50 "syslex.l" +{ return COND;} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 51 "syslex.l" +{ return REPEAT;} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 52 "syslex.l" +ECHO; + YY_BREAK +#line 798 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_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. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_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). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_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 yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_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) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 81 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 80); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_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 YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 52 "syslex.l" |