Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
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 @@
...
@@ -68,11 +68,11 @@
*/
*/
/* Exclusive string handling */
/* Exclusive string handling */
%x
yy
str
%x
tk
str
/* Exclusive unicode string handling */
/* Exclusive unicode string handling */
%x
yy
lstr
%x
tk
lstr
/* Exclusive rcdata single quoted data handling */
/* Exclusive rcdata single quoted data handling */
%x
yy
rcd
%x
tk
rcd
/* Exclusive comment eating... */
/* Exclusive comment eating... */
%x comment
%x comment
/* Set when stripping c-junk */
/* Set when stripping c-junk */
...
@@ -428,102 +428,102 @@ static struct keyword *iskeyword(char *kw)
...
@@ -428,102 +428,102 @@ static struct keyword *iskeyword(char *kw)
* Wide string scanning
* Wide string scanning
*/
*/
L\" {
L\" {
yy_push_state(
yy
lstr);
yy_push_state(
tk
lstr);
wbufidx = 0;
wbufidx = 0;
if(!win32)
if(!win32)
yywarning("16bit resource contains unicode strings\n");
yywarning("16bit resource contains unicode strings\n");
}
}
<
yy
lstr>\"{ws}+ |
<
tk
lstr>\"{ws}+ |
<
yy
lstr>\" {
<
tk
lstr>\" {
yy_pop_state();
yy_pop_state();
yylval.str = get_buffered_wstring();
yylval.str = get_buffered_wstring();
return tSTRING;
return tSTRING;
}
}
<
yy
lstr>\\[0-7]{1,6} { /* octal escape sequence */
<
tk
lstr>\\[0-7]{1,6} { /* octal escape sequence */
unsigned int result;
unsigned int result;
result = strtoul(yytext+1, 0, 8);
result = strtoul(yytext+1, 0, 8);
if ( result > 0xffff )
if ( result > 0xffff )
yyerror("Character constant out of range");
yyerror("Character constant out of range");
addwchar((WCHAR)result);
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;
unsigned int result;
result = strtoul(yytext+2, 0, 16);
result = strtoul(yytext+2, 0, 16);
addwchar((WCHAR)result);
addwchar((WCHAR)result);
}
}
<
yy
lstr>\\x[0-9a-fA-F]{1,3} { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
tk
lstr>\\x[0-9a-fA-F]{1,3} { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
yy
lstr>\\[0-9]+ yyerror("Bad escape sequence");
<
tk
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 */
<
tk
lstr>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<
yy
lstr>\\a addwchar('\a');
<
tk
lstr>\\a addwchar('\a');
<
yy
lstr>\\b addwchar('\b');
<
tk
lstr>\\b addwchar('\b');
<
yy
lstr>\\f addwchar('\f');
<
tk
lstr>\\f addwchar('\f');
<
yy
lstr>\\n addwchar('\n');
<
tk
lstr>\\n addwchar('\n');
<
yy
lstr>\\r addwchar('\r');
<
tk
lstr>\\r addwchar('\r');
<
yy
lstr>\\t addwchar('\t');
<
tk
lstr>\\t addwchar('\t');
<
yy
lstr>\\v addwchar('\v');
<
tk
lstr>\\v addwchar('\v');
<
yy
lstr>\\. addwchar(yytext[1]);
<
tk
lstr>\\. addwchar(yytext[1]);
<
yy
lstr>\\\r\n addwchar(yytext[2]); line_number++; char_number = 1;
<
tk
lstr>\\\r\n addwchar(yytext[2]); line_number++; char_number = 1;
<
yy
lstr>\"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
tk
lstr>\"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
yy
lstr>\\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
tk
lstr>\\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
yy
lstr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
tk
lstr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
yy
lstr>[^\\\n\"]+ {
<
tk
lstr>[^\\\n\"]+ {
char *yptr = yytext;
char *yptr = yytext;
while(*yptr) /* FIXME: codepage translation */
while(*yptr) /* FIXME: codepage translation */
addwchar(*yptr++ & 0xff);
addwchar(*yptr++ & 0xff);
}
}
<
yy
lstr>\n yyerror("Unterminated string");
<
tk
lstr>\n yyerror("Unterminated string");
/*
/*
* Normal string scanning
* Normal string scanning
*/
*/
\" yy_push_state(
yy
str); cbufidx = 0;
\" yy_push_state(
tk
str); cbufidx = 0;
<
yy
str>\"{ws}+ |
<
tk
str>\"{ws}+ |
<
yy
str>\" {
<
tk
str>\" {
yy_pop_state();
yy_pop_state();
yylval.str = get_buffered_cstring();
yylval.str = get_buffered_cstring();
return tSTRING;
return tSTRING;
}
}
<
yy
str>\\[0-7]{1,3} { /* octal escape sequence */
<
tk
str>\\[0-7]{1,3} { /* octal escape sequence */
int result;
int result;
result = strtol(yytext+1, 0, 8);
result = strtol(yytext+1, 0, 8);
if ( result > 0xff )
if ( result > 0xff )
yyerror("Character constant out of range");
yyerror("Character constant out of range");
addcchar((char)result);
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;
int result;
result = strtol(yytext+2, 0, 16);
result = strtol(yytext+2, 0, 16);
addcchar((char)result);
addcchar((char)result);
}
}
<
yy
str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
tk
str>\\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); }
<
yy
str>\\[0-9]+ yyerror("Bad escape sequence");
<
tk
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 */
<
tk
str>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<
yy
str>\\a addcchar('\a');
<
tk
str>\\a addcchar('\a');
<
yy
str>\\b addcchar('\b');
<
tk
str>\\b addcchar('\b');
<
yy
str>\\f addcchar('\f');
<
tk
str>\\f addcchar('\f');
<
yy
str>\\n addcchar('\n');
<
tk
str>\\n addcchar('\n');
<
yy
str>\\r addcchar('\r');
<
tk
str>\\r addcchar('\r');
<
yy
str>\\t addcchar('\t');
<
tk
str>\\t addcchar('\t');
<
yy
str>\\v addcchar('\v');
<
tk
str>\\v addcchar('\v');
<
yy
str>\\. addcchar(yytext[1]);
<
tk
str>\\. addcchar(yytext[1]);
<
yy
str>\\\r\n addcchar(yytext[2]); line_number++; char_number = 1;
<
tk
str>\\\r\n addcchar(yytext[2]); line_number++; char_number = 1;
<
yy
str>[^\\\n\"]+ {
<
tk
str>[^\\\n\"]+ {
char *yptr = yytext;
char *yptr = yytext;
while(*yptr)
while(*yptr)
addcchar(*yptr++);
addcchar(*yptr++);
}
}
<
yy
str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
tk
str>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
<
yy
str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
tk
str>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<
yy
str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
tk
str>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<
yy
str>\n yyerror("Unterminated string");
<
tk
str>\n yyerror("Unterminated string");
/*
/*
* Raw data scanning
* Raw data scanning
*/
*/
\' yy_push_state(
yy
rcd); cbufidx = 0;
\' yy_push_state(
tk
rcd); cbufidx = 0;
<
yy
rcd>\' {
<
tk
rcd>\' {
yy_pop_state();
yy_pop_state();
yylval.raw = new_raw_data();
yylval.raw = new_raw_data();
yylval.raw->size = cbufidx;
yylval.raw->size = cbufidx;
...
@@ -531,14 +531,14 @@ L\" {
...
@@ -531,14 +531,14 @@ L\" {
memcpy(yylval.raw->data, cbuffer, yylval.raw->size);
memcpy(yylval.raw->data, cbuffer, yylval.raw->size);
return tRAWDATA;
return tRAWDATA;
}
}
<
yy
rcd>[0-9a-fA-F]{2} {
<
tk
rcd>[0-9a-fA-F]{2} {
int result;
int result;
result = strtol(yytext, 0, 16);
result = strtol(yytext, 0, 16);
addcchar((char)result);
addcchar((char)result);
}
}
<
yy
rcd>{ws}+ ; /* Ignore space */
<
tk
rcd>{ws}+ ; /* Ignore space */
<
yy
rcd>\n line_number++; char_number = 1;
<
tk
rcd>\n line_number++; char_number = 1;
<
yy
rcd>. yyerror("Malformed data-line");
<
tk
rcd>. yyerror("Malformed data-line");
/*
/*
* Comment stripping
* 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