Fixed the shift reduce errors in the grammer using the yacc debugger.
authorSteve Chamberlain <steve@cygnus>
Tue, 7 May 1991 19:16:33 +0000 (19:16 +0000)
committerSteve Chamberlain <steve@cygnus>
Tue, 7 May 1991 19:16:33 +0000 (19:16 +0000)
Removed some lint highlighted by the same.

ld/ldexp.c
ld/ldgram.y
ld/ldlex.l

index fe86a7ca904c4482cfb8de7c92f2b1d09e8b1b2e..c91af29aaff237a9a0215b4650b232b9c0e95952 100644 (file)
@@ -65,7 +65,6 @@ token_code_type code;
   } table[] =
     {
       INT,     "int",
-      CHAR,"char",
       NAME,"NAME",
       PLUSEQ,"+=",
       MINUSEQ,"-=",
@@ -86,17 +85,16 @@ token_code_type code;
       ALIGN_K,"ALIGN",
       BLOCK,"BLOCK",
       SECTIONS,"SECTIONS",
-      ALIGNMENT,"ALIGNMENT",
       SIZEOF_HEADERS,"SIZEOF_HEADERS",
       NEXT,"NEXT",
       SIZEOF,"SIZEOF",
       ADDR,"ADDR",
       MEMORY,"MEMORY",
-      DSECT,"DSECT",
-      NOLOAD,"NOLOAD",
-      COPY,"COPY",
-      INFO,"INFO",
-      OVERLAY,"OVERLAY",
+
+
+
+
+
       DEFINED,"DEFINED",
       TARGET_K,"TARGET",
       SEARCH_DIR,"SEARCH_DIR",
index 419c54e5f800fe96784d66073c9036e6f36ec6e3..dbdeaa46a80e26101ad2ba61b81d1e08d09ae559 100644 (file)
@@ -88,10 +88,10 @@ boolean ldgram_had_equals = false;
   
 }
 
-%type <etree> exp  opt_exp  exp_head
+%type <etree> exp  opt_exp  
 %type <integer> fill_opt opt_block
 %type <name> memspec_opt
-%token <integer> INT CHAR 
+%token <integer> INT  
 %token <name> NAME
 %type  <integer> length
 
@@ -105,30 +105,32 @@ boolean ldgram_had_equals = false;
 %left <token>  EQ NE
 %left  <token> '<' '>' LE GE
 %left  <token> LSHIFT RSHIFT
+
 %left  <token> '+' '-'
 %left  <token> '*' '/' '%'
+
+/*%token <token> '+' '-' '*' '/' '%'*/
 %right UNARY
 %left <token> '('
 %token <token> ALIGN_K BLOCK LONG SHORT BYTE
 %token SECTIONS  
 %token '{' '}'
-%token ALIGNMENT SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
-%token NEXT SIZEOF ADDR  SCRIPT ENDSCRIPT SIZEOF_HEADERS
+%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
+%token SIZEOF_HEADERS
 %token MEMORY 
-%token DSECT NOLOAD COPY INFO OVERLAY 
 %token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY 
 %token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common
 %token OPTION_format  OPTION_F OPTION_u
-
+%token <integer> SIZEOF NEXT ADDR 
 %token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
 %token OPTION_v OPTION_M OPTION_t STARTUP HLL SYSLIB FLOAT NOFLOAT 
-%token OPTION_n OPTION_r OPTION_o OPTION_b  OPTION_A OPTION_R
+%token OPTION_n OPTION_r OPTION_o OPTION_b  OPTION_R
 %token <name> OPTION_l OPTION_L  OPTION_T OPTION_Aarch OPTION_Tfile  OPTION_Texp
 %token OPTION_Ur 
 %token ORIGIN FILL OPTION_g
-%token LENGTH  BIND SUBSECTION_ALIGN   CREATE_OBJECT_SYMBOLS INPUT OUTPUT
-%type <token> assign_op SIZEOF NEXT ADDR 
-%type <etree> assignment
+%token LENGTH    CREATE_OBJECT_SYMBOLS INPUT OUTPUT  
+%type <token> assign_op 
+
 %type <name>  filename
 
 %{
@@ -284,7 +286,7 @@ command_line_option:
                        {
                        }
                NAME     '='
-               exp_head 
+               exp 
                        {
                        lang_add_assignment(exp_assop($4,$3,$5));
                        }       
@@ -405,12 +407,12 @@ statement:
                  lang_add_attribute(lang_object_symbols_statement_enum); }
 
        |       statement input_section_spec
-        |       statement length '(' exp_head ')'
+        |       statement length '(' exp ')'
                        {
                        lang_add_data($2,$4);
                        }
   
-       |       statement FILL '(' exp_head ')'
+       |       statement FILL '(' exp ')'
                        {
                          lang_add_fill
                            (exp_get_value_int($4,
@@ -431,7 +433,7 @@ length:
        ;
 
 fill_opt:
-          '=' exp_head
+          '=' exp
                {
                  $$ =   exp_get_value_int($2,
                                           0,
@@ -468,12 +470,11 @@ end:      ';' | ','
 
 
 assignment:
-       
-               NAME '=' exp_head 
+               NAME '=' exp 
                {
                  lang_add_assignment(exp_assop($2,$1,$3));
                }
-       |       NAME assign_op exp_head 
+       |       NAME assign_op exp 
                {
                  lang_add_assignment(exp_assop('=',$1,exp_binop($2,exp_nameop(NAME,$1),$3)));
                }
@@ -657,18 +658,18 @@ opt_things:
        }
        ;
 
-exp_head:
-       exp { $$ = $1; }
-       ;
+
+
+
 
 opt_exp:
-               exp_head
+               exp
                        { $$ = $1; }
        |               { $$= (etree_type *)NULL; }
        ;
 
 opt_block:
-               BLOCK '(' exp_head ')'
+               BLOCK '(' exp ')'
                { $$ = exp_get_value_int($3,
                                         1L,
                                         "block",
index b1b9619c2ea05861867de7b0b206b2b4645fef17..7d50ccdfa03a623a856d21a3ef3b4b1d16178be5 100644 (file)
@@ -68,11 +68,8 @@ keyword_type keywords[] =
 "BLOCK",BLOCK,
 "LENGTH",LENGTH,
 "ALIGN",ALIGN_K,
-"SUBSECTION_ALIGN",SUBSECTION_ALIGN,
 "ADDR",ADDR,
 "ENTRY",ENTRY,
-"SCRIPT", SCRIPT,
-"ENDSCRIPT", ENDSCRIPT,
 "NEXT",NEXT,
 "sizeof_headers",SIZEOF_HEADERS,
 "SIZEOF_HEADERS",SIZEOF_HEADERS,