summaryrefslogtreecommitdiff
path: root/gnu/dist/binutils/defparse.y
diff options
context:
space:
mode:
authortv <tv@NetBSD.org>1999-02-02 19:51:16 +0000
committertv <tv@NetBSD.org>1999-02-02 19:51:16 +0000
commit2e8b57510c512922b01977bf9c07cb986ddbaa67 (patch)
tree99f0ff2ba55134ad127492d887b5b6567773ef25 /gnu/dist/binutils/defparse.y
parent269cb58003ce63bbb1763517287a25b909583ae4 (diff)
By popular demand, import binutils 2.9.1.
Diffstat (limited to 'gnu/dist/binutils/defparse.y')
-rw-r--r--gnu/dist/binutils/defparse.y30
1 files changed, 21 insertions, 9 deletions
diff --git a/gnu/dist/binutils/defparse.y b/gnu/dist/binutils/defparse.y
index 8a0f844458e..713b5d71c0c 100644
--- a/gnu/dist/binutils/defparse.y
+++ b/gnu/dist/binutils/defparse.y
@@ -1,6 +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.
@@ -18,6 +18,10 @@ 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"
+%}
%union {
char *id;
@@ -25,11 +29,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
};
%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 <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
%%
@@ -49,19 +54,20 @@ command:
| 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
@@ -105,11 +111,17 @@ opt_CONSTANT:
CONSTANT {$$=1;}
| {$$=0;}
;
+
opt_NONAME:
NONAME {$$=1;}
| {$$=0;}
;
+opt_DATA:
+ DATA { $$ = 1; }
+ | { $$ = 0; }
+ ;
+
opt_name: ID { $$ =$1; }
| { $$=""; }
;