diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2001-05-02 16:42:55 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2001-05-02 16:42:55 +0000 |
commit | d1b2b2dcb9990cc1b113ce35fe9ebe120d34b1c3 (patch) | |
tree | 1b9443e600a2baea4f6e474bbbf51aa384bb04fb /ld/ldlex.l | |
parent | 5cb1517bba5802b8b14e2ed42cffdaee788704df (diff) | |
download | gdb-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.l | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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; } |