aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-05-02 16:42:55 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-05-02 16:42:55 +0000
commitd1b2b2dcb9990cc1b113ce35fe9ebe120d34b1c3 (patch)
tree1b9443e600a2baea4f6e474bbbf51aa384bb04fb /ld/ldlex.l
parent5cb1517bba5802b8b14e2ed42cffdaee788704df (diff)
downloadgdb-d1b2b2dcb9990cc1b113ce35fe9ebe120d34b1c3.zip
gdb-d1b2b2dcb9990cc1b113ce35fe9ebe120d34b1c3.tar.gz
gdb-d1b2b2dcb9990cc1b113ce35fe9ebe120d34b1c3.tar.bz2
2001-05-02 H.J. Lu <hjl@gnu.org>
* ldfile.c: Include "libiberty.h". * ldlex.l: Likewise. * ldmisc.c (buystring): Removed. * ldmisc.h: Likewise. * ldfile.c: Replace buystring with xstrdup. * ldlang.c: Likewise. * ldlex.l: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * lexsup.c: Likewise. * mpw-eppcmac.c: Likewise.
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r--ld/ldlex.l17
1 files changed, 9 insertions, 8 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index e0a50af..eecb902 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -45,6 +45,7 @@ This was written by steve chamberlain
#include "ldfile.h"
#include "ldlex.h"
#include "ldmain.h"
+#include "libiberty.h"
/* The type of top-level parser input.
yylex and yyparse (indirectly) both check this. */
@@ -147,7 +148,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<DEFSYMEXP>"-" { RTOKEN('-');}
<DEFSYMEXP>"+" { RTOKEN('+');}
-<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; }
+<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup(yytext); return NAME; }
<DEFSYMEXP>"=" { RTOKEN('='); }
<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
@@ -333,17 +334,17 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
/* Filename without commas, needed to parse mri stuff */
- yylval.name = buystring(yytext);
+ yylval.name = xstrdup(yytext);
return NAME;
}
<BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
- yylval.name = buystring(yytext);
+ yylval.name = xstrdup(yytext);
return NAME;
}
<BOTH,EXPRESSION>"-l"{FILENAMECHAR}+ {
- yylval.name = buystring (yytext + 2);
+ yylval.name = xstrdup (yytext + 2);
return LNAME;
}
<SCRIPT>{WILDCHAR}* {
@@ -358,7 +359,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
}
else
{
- yylval.name = buystring(yytext);
+ yylval.name = xstrdup(yytext);
return NAME;
}
}
@@ -366,7 +367,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<EXPRESSION,BOTH,SCRIPT,VERS_NODE>"\""[^\"]*"\"" {
/* No matter the state, quotes
give what's inside */
- yylval.name = buystring(yytext+1);
+ yylval.name = xstrdup(yytext+1);
yylval.name[yyleng-2] = 0;
return NAME;
}
@@ -381,10 +382,10 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<VERS_NODE>extern { RTOKEN(EXTERN); }
-<VERS_NODE>{V_IDENTIFIER} { yylval.name = buystring (yytext);
+<VERS_NODE>{V_IDENTIFIER} { yylval.name = xstrdup (yytext);
return VERS_IDENTIFIER; }
-<VERS_SCRIPT>{V_TAG} { yylval.name = buystring (yytext);
+<VERS_SCRIPT>{V_TAG} { yylval.name = xstrdup (yytext);
return VERS_TAG; }
<VERS_START>"{" { BEGIN(VERS_SCRIPT); return *yytext; }