CVS: winex/tools/wrc parser.l,1.3,1.4
[email protected] 31 Jul 2007 20:01:38 -0000
| Newsgroups | gmane.comp.emulators.winex.cvs |
|---|---|
| Message-ID | <[email protected]> |
Subject: winex/tools/wrc parser.l,1.3,1.4Update of /var/lib/cvsd/cvsroot/winex/tools/wrc
In directory agravaine:/tmp/cvs-serv2565/tools/wrc
Modified Files:
parser.l
Log Message:
flex on the Mac can use yy_str, so we must use something else; this fixes the Mac build
Index: parser.l
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/tools/wrc/parser.l,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- parser.l 31 Jul 2007 20:01:30 -0000 1.3
+++ parser.l 31 Jul 2007 20:01:36 -0000 1.4
@@ -53,7 +53,7 @@
*/
/* Exclusive string handling */
-%x yy_str
+%x yy_str2
/* Exclusive unicode string handling */
%x yylstr
/* Exclusive rcdata single quoted data handling */
@@ -440,46 +440,46 @@
/*
* Normal string scanning
*/
-\" yy_push_state(yy_str); cbufidx = 0;
-<yy_str>\"{ws}+ |
-<yy_str>\" {
+\" yy_push_state(yy_str2); cbufidx = 0;
+<yy_str2>\"{ws}+ |
+<yy_str2>\" {
yy_pop_state();
yylval.str = get_buffered_cstring();
return tSTRING;
}
-<yy_str>\\[0-7]{1,3} { /* octal escape sequence */
+<yy_str2>\\[0-7]{1,3} { /* octal escape sequence */
int result;
result = strtol(yytext+1, 0, 8);
if ( result > 0xff )
yyerror("Character constant out of range");
addcchar((char)result);
}
-<yy_str>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
+<yy_str2>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
int result;
result = strtol(yytext+2, 0, 16);
addcchar((char)result);
}
-<yy_str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
+<yy_str2>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
-<yy_str>\\[0-9]+ yyerror("Bad escape secuence");
-<yy_str>\\a addcchar('\a');
-<yy_str>\\b addcchar('\b');
-<yy_str>\\f addcchar('\f');
-<yy_str>\\n addcchar('\n');
-<yy_str>\\r addcchar('\r');
-<yy_str>\\t addcchar('\t');
-<yy_str>\\v addcchar('\v');
-<yy_str>\\(\n|.) addcchar(yytext[1]);
-<yy_str>\\\r\n addcchar(yytext[2]);
-<yy_str>[^\\\n\"]+ {
+<yy_str2>\\[0-9]+ yyerror("Bad escape secuence");
+<yy_str2>\\a addcchar('\a');
+<yy_str2>\\b addcchar('\b');
+<yy_str2>\\f addcchar('\f');
+<yy_str2>\\n addcchar('\n');
+<yy_str2>\\r addcchar('\r');
+<yy_str2>\\t addcchar('\t');
+<yy_str2>\\v addcchar('\v');
+<yy_str2>\\(\n|.) addcchar(yytext[1]);
+<yy_str2>\\\r\n addcchar(yytext[2]);
+<yy_str2>[^\\\n\"]+ {
char *yptr = yytext;
while(*yptr)
addcchar(*yptr++);
}
-<yy_str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
-<yy_str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
-<yy_str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
-<yy_str>\n yyerror("Unterminated string");
+<yy_str2>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
+<yy_str2>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
+<yy_str2>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
+<yy_str2>\n yyerror("Unterminated string");
/*
* Raw data scanning