+2021-02-01 Alan Modra <amodra@gmail.com>
+
+ * ldgram.y (defsym_expr): Use assignment rule.
+ * ldlex.h (ldlex_defsym): Delete.
+ * ldlex.l (DEFSYMEXP, ldlex_defsym): Delete.
+
2021-02-01 Alan Modra <amodra@gmail.com>
* ldgram.y (section): Call ldlex_backup. Remove empty action.
extern void ldlex_mri_script (void);
extern void ldlex_version_script (void);
extern void ldlex_version_file (void);
-extern void ldlex_defsym (void);
extern void ldlex_expression (void);
extern void ldlex_both (void);
extern void ldlex_popstate (void);
SCRIPT definitely in a script
INPUTLIST definitely in a script, a filename-list
BOTH either EXPRESSION or SCRIPT
- DEFSYMEXP in an argument to -defsym
MRI in an MRI script
VERS_START starting a Sun style mapfile
VERS_SCRIPT a Sun style mapfile
%s INPUTLIST
%s EXPRESSION
%s BOTH
-%s DEFSYMEXP
%s MRI
%s VERS_START
%s VERS_SCRIPT
<BOTH,SCRIPT,EXPRESSION,VERS_START,VERS_NODE,VERS_SCRIPT,INPUTLIST>"/*" { comment (); }
-<DEFSYMEXP>"-" { RTOKEN('-');}
-<DEFSYMEXP>"+" { RTOKEN('+');}
-<DEFSYMEXP>{SYMBOLNAMECHAR1}{SYMBOLNAMECHAR}* { yylval.name = xstrdup (yytext);
- return NAME; }
-<DEFSYMEXP>"=" { RTOKEN('='); }
-
<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
yylval.integer = bfd_scan_vma (yytext + 1, 0, 16);
yylval.bigint.str = NULL;
yylval.bigint.str = NULL;
return INT;
}
-<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
+<SCRIPT,MRI,BOTH,EXPRESSION>((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
char *s = yytext;
int ibase = 0;
}
<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid (" in script", yytext);
-<EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid (" in expression", yytext);
+<EXPRESSION,BOTH>. lex_warn_invalid (" in expression", yytext);
%%
\f
BEGIN (VERS_SCRIPT);
}
-void
-ldlex_defsym (void)
-{
- *(state_stack_p)++ = yy_start;
- BEGIN (DEFSYMEXP);
-}
-
void
ldlex_expression (void)
{