aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-04-22 19:55:15 +0000
committerSteve Chamberlain <sac@cygnus>1992-04-22 19:55:15 +0000
commitee0c4cf7d1dbda957222ab27b037ef0be2b74ce2 (patch)
treeaea2b93f8cfeb04ff870d40acf835e148f096ff9 /ld/ldlex.l
parent35a258406b3b386ab7c4196673e390fa3eb4dca5 (diff)
downloadgdb-ee0c4cf7d1dbda957222ab27b037ef0be2b74ce2.zip
gdb-ee0c4cf7d1dbda957222ab27b037ef0be2b74ce2.tar.gz
gdb-ee0c4cf7d1dbda957222ab27b037ef0be2b74ce2.tar.bz2
* ldlex.l: added CMDFILENAMECHAR state so that you can lex
different sorts of filenames on the command line than in a script.
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r--ld/ldlex.l11
1 files changed, 10 insertions, 1 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index b52ba2e..d2f4db3 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -65,6 +65,9 @@ unsigned int include_stack_ptr = 0;
%a 4000
%o 5000
+
+CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-]
+CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>]
FILENAMECHAR1 [_a-zA-Z\/\.\\]
SYMBOLCHARN [_a-zA-Z\/\.\\0-9]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\]
@@ -189,7 +192,7 @@ WHITE [ \t\n]+
yylval.integer = strtol(yytext+1, 0, base);
return INT;
}
-<MRI,BOTH,EXPRESSION>"$"?"0x"?([0-9A-Fa-f])+(M|K|m|k)? {
+<DEFSYMEXP,MRI,BOTH,EXPRESSION>"$"?"0x"?([0-9A-Fa-f])+(M|K|m|k)? {
yylval.integer = strtol(yytext,0,hex_mode);
if (yytext[yyleng-1]=='M'
|| yytext[yyleng-1] == 'm') {
@@ -306,6 +309,12 @@ WHITE [ \t\n]+
<MRI>"sect" { RTOKEN(SECT); }
<MRI>"absolute" { RTOKEN(ABSOLUTE); }
+<COMMAND>{CMDFILENAMECHAR1}{CMDFILENAMECHAR}* {
+ yylval.name = buystring(yytext);
+ return NAME;
+ }
+
+
<MRI,BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
yylval.name = buystring(yytext);
return NAME;