* m10300-opc.c (asr, lsr, asl): Fix am33 single bit shift opcode.
[deliverable/binutils-gdb.git] / binutils / defparse.y
index 4a9ca394450ec47f6c110500e560237756a6f7ad..44b7a2aba0697637a1e8f53a128f7cf4ffed1347 100644 (file)
@@ -1,7 +1,6 @@
-{
-/* defparse.y - parser for .def files */
+%{ /* defparse.y - parser for .def files */
 
-/*   Copyright (C) 1995 Free Software Foundation, Inc.
+/*   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -17,22 +16,25 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
+#include "bfd.h"
+#include "bucomm.h"
+#include "dlltool.h"
+%}
 
 %union {
   char *id;
   int number;
-char *string;
 };
 
 %token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATA
-%token SECTIONS, EXPORTS, IMPORTS, VERSION, BASE, CONSTANT
+%token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANT
 %token READ WRITE EXECUTE SHARED NONAME
 %token <id> ID
-%token <string> STRING
 %token <number> NUMBER
-%type  <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT attr attr_list opt_number
+%type  <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
+%type  <number> attr attr_list opt_number
 %type  <id> opt_name opt_equal_name 
 
 %%
@@ -45,26 +47,27 @@ command:
                NAME opt_name opt_base { def_name ($2, $3); }
        |       LIBRARY opt_name opt_base { def_library ($2, $3); }
        |       EXPORTS explist 
-       |       DESCRIPTION STRING { def_description ($2);}
+       |       DESCRIPTION ID { def_description ($2);}
        |       STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
        |       HEAPSIZE NUMBER opt_number { def_heapsize ($2, $3);}
        |       CODE attr_list { def_code ($2);}
        |       DATA attr_list  { def_data ($2);}
        |       SECTIONS seclist
        |       IMPORTS implist
-       |       VERSION NUMBER { def_version ($2,0);}
-       |       VERSION NUMBER '.' NUMBER { def_version ($2,$4);}
+       |       VERSIONK NUMBER { def_version ($2,0);}
+       |       VERSIONK NUMBER '.' NUMBER { def_version ($2,$4);}
        ;
 
 
 explist:
-               explist expline
+               /* EMPTY */
        |       expline
+       |       explist expline
        ;
 
 expline:
-               ID opt_equal_name opt_ordinal opt_NONAME opt_CONSTANT
-                       { def_exports ($1, $2, $3, $4, $5);}
+               ID opt_equal_name opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
+                       { def_exports ($1, $2, $3, $4, $5, $6);}
        ;
 implist:       
                implist impline
@@ -72,9 +75,16 @@ implist:
        ;
 
 impline:
-               ID '=' ID '.' ID { def_import ($1,$3,$5);}
-       |       ID '.' ID        { def_import (0, $1,$3);}
-       ;
+               ID '=' ID '.' ID '.' ID     { def_import ($1,$3,$5,$7, 0); }
+       |       ID '=' ID '.' ID '.' NUMBER { def_import ($1,$3,$5, 0,$7); }
+       |       ID '=' ID '.' ID            { def_import ($1,$3, 0,$5, 0); }
+       |       ID '=' ID '.' NUMBER        { def_import ($1,$3, 0, 0,$5); }
+       |       ID '.' ID '.' ID            { def_import ( 0,$1,$3,$5, 0); }
+       |       ID '.' ID '.' NUMBER        { def_import ( 0,$1,$3, 0,$5); }
+       |       ID '.' ID                   { def_import ( 0,$1, 0,$3, 0); }
+       |       ID '.' NUMBER               { def_import ( 0,$1, 0, 0,$3); }
+;
+
 seclist:
                seclist secline
        |       secline
@@ -108,11 +118,17 @@ opt_CONSTANT:
                CONSTANT {$$=1;}
        |                {$$=0;}
        ;
+
 opt_NONAME:
                NONAME {$$=1;}
        |                {$$=0;}
        ;
 
+opt_DATA:
+               DATA { $$ = 1; }
+       |            { $$ = 0; }
+       ;
+
 opt_name: ID           { $$ =$1; }
        |               { $$=""; }
        ;
This page took 0.028204 seconds and 4 git commands to generate.