%{ /* rclex.l -- lexer for Windows rc files parser */
-/* Copyright 1997 Free Software Foundation, Inc.
+/* Copyright 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
%%
"BEGIN" { return BEG; }
+"{" { return BEG; }
"END" { return END; }
+"}" { return END; }
"ACCELERATORS" { return ACCELERATORS; }
"VIRTKEY" { return VIRTKEY; }
"ASCII" { return ASCII; }
}
}
-[A-Za-z][^ \t\r\n]* {
+[A-Za-z][^ ,\t\r\n]* {
char *s;
+ /* I rejected comma in a string in order to
+ handle VIRTKEY, CONTROL in an accelerator
+ resource. This means that an unquoted
+ file name can not contain a comma. I
+ don't know what rc permits. */
+
s = get_string (strlen (yytext) + 1);
strcpy (s, yytext);
yylval.s = s;
rcparse_warning ("use \"\" to put \" in a string");
break;
+ case 'a':
+ *s++ = ESCAPE_A;
+ ++t;
+ break;
+
+ case 'b':
+ *s++ = ESCAPE_B;
+ ++t;
+ break;
+
+ case 'f':
+ *s++ = ESCAPE_F;
+ ++t;
+ break;
+
+ case 'n':
+ *s++ = ESCAPE_N;
+ ++t;
+ break;
+
+ case 'r':
+ *s++ = ESCAPE_R;
+ ++t;
+ break;
+
+ case 't':
+ *s++ = ESCAPE_T;
+ ++t;
+ break;
+
+ case 'v':
+ *s++ = ESCAPE_V;
+ ++t;
+ break;
+
case '\\':
*s++ = *t++;
break;
}
*s++ = ch;
break;
+
+ default:
+ rcparse_warning ("unrecognized escape sequence");
+ *s++ = '\\';
+ *s++ = *t++;
+ break;
}
}
else if (*t != '"')