aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1992-05-22 20:56:37 +0000
committerPer Bothner <per@bothner.com>1992-05-22 20:56:37 +0000
commit91e25b4f8f14ebe408b603c829e2d0f8010ff13d (patch)
tree45ca1217a7eae0cfa206987dbe232f7bea2bbdf0 /ld/ldlex.l
parentd219bf5068bacfb47f19ff2667160f577751a139 (diff)
downloadgdb-91e25b4f8f14ebe408b603c829e2d0f8010ff13d.zip
gdb-91e25b4f8f14ebe408b603c829e2d0f8010ff13d.tar.gz
gdb-91e25b4f8f14ebe408b603c829e2d0f8010ff13d.tar.bz2
* ldlex.c: Fix some unnecessary flex-specific-isms.
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r--ld/ldlex.l34
1 files changed, 13 insertions, 21 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 31b85a2..2c21a58 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -74,15 +74,15 @@ FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\]
FILENAME {FILENAMECHAR}+
WHITE [ \t\n]+
-%x COMMAND
-%x SCRIPT
-%x EXPRESSION
-%x COMMENT
-%x BOTH
-%x DEFSYMEXP
-%x MRI
+%s COMMAND
+%s SCRIPT
+%s EXPRESSION
+%s COMMENT
+%s BOTH
+%s DEFSYMEXP
+%s MRI
%%
-
+
<DEFSYMEXP>"-" { RTOKEN('-');}
<DEFSYMEXP>"+" { RTOKEN('+');}
<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; }
@@ -172,8 +172,7 @@ WHITE [ \t\n]+
return INT;
}
-<MRI,EXPRESSION>([0-9A-Fa-f])+(H|X|B|O|D)
- {
+<MRI,EXPRESSION>([0-9A-Fa-f])+(H|X|B|O|D) {
int base ;
switch (yytext[yyleng-1]) {
case 'X':
@@ -289,10 +288,13 @@ WHITE [ \t\n]+
<BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
<BOTH,SCRIPT>"len" { RTOKEN( LENGTH);}
<MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
-<MRI>^"*".* { /* Mri comment line */ }
+<MRI>"*".* { /* Mri comment line */ }
<MRI>"END" { RTOKEN(ENDWORD); }
<MRI>"CHIP" { RTOKEN(CHIP); }
+<MRI>"BASE" { RTOKEN(BASE); }
+<MRI>"ALIAS" { RTOKEN(ALIAS); }
<MRI>"LOAD" { RTOKEN(LOAD); }
+<MRI>"PUBLIC" { RTOKEN(PUBLIC); }
<MRI>"ORDER" { RTOKEN(ORDER); }
<MRI>"NAME" { RTOKEN(NAMEWORD); }
<MRI>"FORMAT" { RTOKEN(FORMAT); }
@@ -343,8 +345,6 @@ WHITE [ \t\n]+
<COMMENT>"*"+[^*/\\n]*
<COMMENT>\\n { ++lineno;}
<COMMENT>"*"+"/" { BEGIN(old); }
-
-
<<EOF>> {
include_stack_ptr--;
@@ -360,13 +360,6 @@ WHITE [ \t\n]+
return END;
}
-
-
-
-
-
-
-
%%
void
@@ -508,4 +501,3 @@ int max_size;
YY_FATAL_ERROR( "read() in flex scanner failed" );
}
}
-