aboutsummaryrefslogtreecommitdiff
path: root/binutils/defparse.y
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2012-02-11 20:02:03 +0000
committerKai Tietz <kai.tietz@onevision.com>2012-02-11 20:02:03 +0000
commitaa83d1ec50580e15fe002044c8d8babb6da8a4c0 (patch)
treece7c32fd204bf68c4be6141836c90599b30b2f96 /binutils/defparse.y
parent98872a7c392dee50629a3cb54b85db4d904cae1c (diff)
downloadgdb-aa83d1ec50580e15fe002044c8d8babb6da8a4c0.zip
gdb-aa83d1ec50580e15fe002044c8d8babb6da8a4c0.tar.gz
gdb-aa83d1ec50580e15fe002044c8d8babb6da8a4c0.tar.bz2
ChangeLog binutils
2012-02-11 Kai Tietz <ktietz@redhat.com> PR binutils/13657 * defparse.y (%union): New type id_const. (opt_name2): New rule. (keyword_as_name): New rule. (opt_name): Adjust rule. (opt_import_name): Likewise. (opt_equal_name): Likewise. ChangeLog binutils/testsuite 2012-02-11 Kai Tietz <ktietz@redhat.com> * binutils-all/version.def: New file. * binutils-all/dlltool.exp: Add version-dll test. ChangeLog ld 2012-02-11 Kai Tietz <ktietz@redhat.com> * deffilep.y (%union): New type id_const. (opt_name2): New rule. (keyword_as_name): New rule. (dot_name): Replaced by opt_name2 rule. (opt_name): Adjust rule. (opt_equal_name): Likewise.
Diffstat (limited to 'binutils/defparse.y')
-rw-r--r--binutils/defparse.y66
1 files changed, 55 insertions, 11 deletions
diff --git a/binutils/defparse.y b/binutils/defparse.y
index c05254a..b21ce93 100644
--- a/binutils/defparse.y
+++ b/binutils/defparse.y
@@ -28,6 +28,7 @@
%union {
char *id;
+ const char *id_const;
int number;
};
@@ -40,7 +41,8 @@
%token <number> NUMBER
%type <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA opt_PRIVATE
%type <number> attr attr_list opt_number
-%type <id> opt_name opt_equal_name opt_import_name
+%type <id> opt_name opt_name2 opt_equal_name opt_import_name
+%type <id_const> keyword_as_name
%%
@@ -150,13 +152,61 @@ opt_PRIVATE:
| { $$ = 0; }
;
-opt_name: ID { $$ =$1; }
- | ID '.' ID
+keyword_as_name: NAME { $$ = "NAME"; }
+ | LIBRARY { $$ = "LIBRARY"; }
+ | DESCRIPTION { $$ = "DESCRIPTION"; }
+ | STACKSIZE { $$ = "STACKSIZE"; }
+ | HEAPSIZE { $$ = "HEAPSIZE"; }
+ | CODE { $$ = "CODE"; }
+ | DATA { $$ = "DATA"; }
+ | SECTIONS { $$ = "SECTIONS"; }
+ | EXPORTS { $$ = "EXPORTS"; }
+ | IMPORTS { $$ = "IMPORTS"; }
+ | VERSIONK { $$ = "VERSION"; }
+ | BASE { $$ = "BASE"; }
+ | CONSTANT { $$ = "CONSTANT"; }
+ | NONAME { $$ = "NONAME"; }
+ | PRIVATE { $$ = "PRIVATE"; }
+ | READ { $$ = "READ"; }
+ | WRITE { $$ = "WRITE"; }
+ | EXECUTE { $$ = "EXECUTE"; }
+ | SHARED { $$ = "SHARED"; }
+ | NONSHARED { $$ = "NONSHARED"; }
+ | SINGLE { $$ = "SINGLE"; }
+ | MULTIPLE { $$ = "MULTIPLE"; }
+ | INITINSTANCE { $$ = "INITINSTANCE"; }
+ | INITGLOBAL { $$ = "INITGLOBAL"; }
+ | TERMINSTANCE { $$ = "TERMINSTANCE"; }
+ | TERMGLOBAL { $$ = "TERMGLOBAL"; }
+ ;
+
+opt_name2: ID { $$ = $1; }
+ | '.' keyword_as_name
+ {
+ char *name = xmalloc (strlen ($2) + 2);
+ sprintf (name, ".%s", $2);
+ $$ = name;
+ }
+ | '.' opt_name2
+ {
+ char *name = xmalloc (strlen ($2) + 2);
+ sprintf (name, ".%s", $2);
+ $$ = name;
+ }
+ | keyword_as_name '.' opt_name2
+ {
+ char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
+ sprintf (name, "%s.%s", $1, $3);
+ $$ = name;
+ }
+ | ID '.' opt_name2
{
char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
sprintf (name, "%s.%s", $1, $3);
$$ = name;
}
+ ;
+opt_name: opt_name2 { $$ =$1; }
| { $$=""; }
;
@@ -166,18 +216,12 @@ opt_ordinal:
;
opt_import_name:
- EQUAL ID { $$ = $2; }
+ EQUAL opt_name2 { $$ = $2; }
| { $$ = 0; }
;
opt_equal_name:
- '=' ID { $$ = $2; }
- | '=' ID '.' ID
- {
- char *name = xmalloc (strlen ($2) + 1 + strlen ($4) + 1);
- sprintf (name, "%s.%s", $2, $4);
- $$ = name;
- }
+ '=' opt_name2 { $$ = $2; }
| { $$ = 0; }
;