Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
69dcbaaf
Commit
69dcbaaf
authored
Mar 06, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Don't use identifiers starting yy*, they're reserved for flex.
parent
8723936d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
55 deletions
+55
-55
parser.l
tools/wrc/parser.l
+55
-55
No files found.
tools/wrc/parser.l
View file @
69dcbaaf
...
...
@@ -68,11 +68,11 @@
*/
/* Exclusive string handling */
%x
yy
str
%x
tk
str
/* Exclusive unicode string handling */
%x
yy
lstr
%x
tk
lstr
/* Exclusive rcdata single quoted data handling */
%x
yy
rcd
%x
tk
rcd
/* Exclusive comment eating... */
%x comment
/* Set when stripping c-junk */
...
...
@@ -428,102 +428,102 @@ static struct keyword *iskeyword(char *kw)
* Wide string scanning
*/
L\" {
yy_push_state(
yy
lstr);
yy_push_state(
tk
lstr);
wbufidx = 0;
if(!win32)
yywarning("16bit resource contains unicode strings\n");
}
<
yy
lstr>\"{ws}+ |
<
yy
lstr>\" {
<
tk
lstr>\"{ws}+ |
<
tk
lstr>\" {
yy_pop_state();
yylval.str = get_buffered_wstring();
return tSTRING;
}
<
yy
lstr>\\[0-7]{1,6} { /* octal escape sequence */
<
tk
lstr>\\[0-7]{1,6} { /* octal escape sequence */
unsigned int result;
result = strtoul(yytext+1, 0, 8);
if ( result > 0xffff )
yyerror("Character constant out of range");
addwchar((WCHAR)result);
}
<
yy
lstr>\\x[0-9a-fA-F]{4} { /* hex escape sequence */
<
tk
lstr>\\x[0-9a-fA-F]{4} { /* hex escape sequence */
unsigned int result;
result = strtoul(yytext+2, 0, 16);
addwchar((WCHAR)result);
}
<
yy
lstr>\\x[0-9a-fA-F]{1,3} { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
yy
lstr>\\[0-9]+ yyerror("Bad escape sequence");
<
yy
lstr>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<
yy
lstr>\\a addwchar('\a');
<
yy
lstr>\\b addwchar('\b');
<
yy
lstr>\\f addwchar('\f');
<
yy
lstr>\\n addwchar('\n');
<
yy
lstr>\\r addwchar('\r');
<
yy
lstr>\\t addwchar('\t');
<
yy
lstr>\\v addwchar('\v');
<
yy
lstr>\\. addwchar(yytext[1]);
<
yy
lstr>\\\r\n addwchar(yytext[2]); line_number++; char_number = 1;
<
yy
lstr>\"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
yy
lstr>\\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
yy
lstr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
yy
lstr>[^\\\n\"]+ {
<
tk
lstr>\\x[0-9a-fA-F]{1,3} { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
tk
lstr>\\[0-9]+ yyerror("Bad escape sequence");
<
tk
lstr>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<
tk
lstr>\\a addwchar('\a');
<
tk
lstr>\\b addwchar('\b');
<
tk
lstr>\\f addwchar('\f');
<
tk
lstr>\\n addwchar('\n');
<
tk
lstr>\\r addwchar('\r');
<
tk
lstr>\\t addwchar('\t');
<
tk
lstr>\\v addwchar('\v');
<
tk
lstr>\\. addwchar(yytext[1]);
<
tk
lstr>\\\r\n addwchar(yytext[2]); line_number++; char_number = 1;
<
tk
lstr>\"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
tk
lstr>\\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
tk
lstr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
tk
lstr>[^\\\n\"]+ {
char *yptr = yytext;
while(*yptr) /* FIXME: codepage translation */
addwchar(*yptr++ & 0xff);
}
<
yy
lstr>\n yyerror("Unterminated string");
<
tk
lstr>\n yyerror("Unterminated string");
/*
* Normal string scanning
*/
\" yy_push_state(
yy
str); cbufidx = 0;
<
yy
str>\"{ws}+ |
<
yy
str>\" {
\" yy_push_state(
tk
str); cbufidx = 0;
<
tk
str>\"{ws}+ |
<
tk
str>\" {
yy_pop_state();
yylval.str = get_buffered_cstring();
return tSTRING;
}
<
yy
str>\\[0-7]{1,3} { /* octal escape sequence */
<
tk
str>\\[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 */
<
tk
str>\\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
str>\\[0-9]+ yyerror("Bad escape sequence");
<
yy
str>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<
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>\\. addcchar(yytext[1]);
<
yy
str>\\\r\n addcchar(yytext[2]); line_number++; char_number = 1;
<
yy
str>[^\\\n\"]+ {
<
tk
str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
tk
str>\\[0-9]+ yyerror("Bad escape sequence");
<
tk
str>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<
tk
str>\\a addcchar('\a');
<
tk
str>\\b addcchar('\b');
<
tk
str>\\f addcchar('\f');
<
tk
str>\\n addcchar('\n');
<
tk
str>\\r addcchar('\r');
<
tk
str>\\t addcchar('\t');
<
tk
str>\\v addcchar('\v');
<
tk
str>\\. addcchar(yytext[1]);
<
tk
str>\\\r\n addcchar(yytext[2]); line_number++; char_number = 1;
<
tk
str>[^\\\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");
<
tk
str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
tk
str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
tk
str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
tk
str>\n yyerror("Unterminated string");
/*
* Raw data scanning
*/
\' yy_push_state(
yy
rcd); cbufidx = 0;
<
yy
rcd>\' {
\' yy_push_state(
tk
rcd); cbufidx = 0;
<
tk
rcd>\' {
yy_pop_state();
yylval.raw = new_raw_data();
yylval.raw->size = cbufidx;
...
...
@@ -531,14 +531,14 @@ L\" {
memcpy(yylval.raw->data, cbuffer, yylval.raw->size);
return tRAWDATA;
}
<
yy
rcd>[0-9a-fA-F]{2} {
<
tk
rcd>[0-9a-fA-F]{2} {
int result;
result = strtol(yytext, 0, 16);
addcchar((char)result);
}
<
yy
rcd>{ws}+ ; /* Ignore space */
<
yy
rcd>\n line_number++; char_number = 1;
<
yy
rcd>. yyerror("Malformed data-line");
<
tk
rcd>{ws}+ ; /* Ignore space */
<
tk
rcd>\n line_number++; char_number = 1;
<
tk
rcd>. yyerror("Malformed data-line");
/*
* Comment stripping
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment