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
86bb809e
Commit
86bb809e
authored
Sep 12, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Change the prefix on bison-generated names to avoid the name-prefix directive.
parent
2d778c5e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
37 deletions
+35
-37
header.c
tools/widl/header.c
+2
-2
parser.h
tools/widl/parser.h
+5
-5
parser.l
tools/widl/parser.l
+15
-15
parser.y
tools/widl/parser.y
+0
-2
proxy.c
tools/widl/proxy.c
+1
-1
utils.c
tools/widl/utils.c
+4
-4
utils.h
tools/widl/utils.h
+2
-2
widl.c
tools/widl/widl.c
+6
-6
No files found.
tools/widl/header.c
View file @
86bb809e
...
...
@@ -716,7 +716,7 @@ static void write_method_proto(const type_t *iface)
fprintf
(
header
,
");
\n
"
);
}
else
{
yy
warning
(
"invalid call_as attribute (%s -> %s)
\n
"
,
get_name
(
def
),
cas
->
name
);
parser_
warning
(
"invalid call_as attribute (%s -> %s)
\n
"
,
get_name
(
def
),
cas
->
name
);
}
}
...
...
@@ -802,7 +802,7 @@ static void write_coclass_guid(type_t *cocl)
static
void
write_com_interface
(
type_t
*
iface
)
{
if
(
!
iface
->
funcs
&&
!
iface
->
ref
)
{
yy
warning
(
"%s has no methods"
,
iface
->
name
);
parser_
warning
(
"%s has no methods"
,
iface
->
name
);
return
;
}
...
...
tools/widl/parser.h
View file @
86bb809e
...
...
@@ -21,14 +21,14 @@
#ifndef __WIDL_PARSER_H
#define __WIDL_PARSER_H
int
yy
parse
(
void
);
int
parser_
parse
(
void
);
extern
FILE
*
yy
in
;
extern
char
*
yy
text
;
extern
int
yy
debug
;
extern
FILE
*
parser_
in
;
extern
char
*
parser_
text
;
extern
int
parser_
debug
;
extern
int
yy_flex_debug
;
int
yy
lex
(
void
);
int
parser_
lex
(
void
);
extern
int
import_stack_ptr
;
int
do_import
(
char
*
fname
);
...
...
tools/widl/parser.l
View file @
86bb809e
...
...
@@ -20,7 +20,7 @@
%option stack
%option nounput noyy_top_state
%option 8bit never-interactive
%option 8bit never-interactive
prefix="parser_"
nl \r?\n
ws [ \f\t\r]
...
...
@@ -110,14 +110,14 @@ static UUID* parse_uuid(const char*u)
yy_pop_state();
lineno = (int)strtol(yytext, &cptr, 10);
if(!lineno)
yy
error("Malformed '#...' line-directive; invalid linenumber");
parser_
error("Malformed '#...' line-directive; invalid linenumber");
fname = strchr(cptr, '"');
if(!fname)
yy
error("Malformed '#...' line-directive; missing filename");
parser_
error("Malformed '#...' line-directive; missing filename");
fname++;
cptr = strchr(fname, '"');
if(!cptr)
yy
error("Malformed '#...' line-directive; missing terminating \"");
parser_
error("Malformed '#...' line-directive; missing terminating \"");
*cptr = '\0';
line_number = lineno - 1; /* We didn't read the newline */
free( input_name );
...
...
@@ -126,7 +126,7 @@ static UUID* parse_uuid(const char*u)
\" yy_push_state(QUOTE); cbufidx = 0;
<QUOTE>\" {
yy_pop_state();
yy
lval.str = get_buffered_cstring();
parser_
lval.str = get_buffered_cstring();
return aSTRING;
}
<QUOTE>\\\\ |
...
...
@@ -134,15 +134,15 @@ static UUID* parse_uuid(const char*u)
<QUOTE>\\. addcchar('\\'); addcchar(yytext[1]);
<QUOTE>. addcchar(yytext[0]);
{uuid} {
yy
lval.uuid = parse_uuid(yytext);
parser_
lval.uuid = parse_uuid(yytext);
return aUUID;
}
{hex} {
yy
lval.num = strtoul(yytext, NULL, 0);
parser_
lval.num = strtoul(yytext, NULL, 0);
return aHEXNUM;
}
{int} {
yy
lval.num = strtoul(yytext, NULL, 0);
parser_
lval.num = strtoul(yytext, NULL, 0);
return aNUM;
}
SAFEARRAY{ws}*/\( return tSAFEARRAY;
...
...
@@ -161,8 +161,8 @@ SAFEARRAY{ws}*/\( return tSAFEARRAY;
}
%%
#ifndef
yy
wrap
int
yy
wrap(void)
#ifndef
parser_
wrap
int
parser_
wrap(void)
{
return 1;
}
...
...
@@ -338,10 +338,10 @@ static int kw_token(const char *kw)
}
#endif
if (kwp) {
yy
lval.str = (char*)kwp->kw;
parser_
lval.str = (char*)kwp->kw;
return kwp->token;
}
yy
lval.str = xstrdup(kw);
parser_
lval.str = xstrdup(kw);
return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER;
}
...
...
@@ -352,7 +352,7 @@ static void addcchar(char c)
cbufalloc += 1024;
cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0]));
if(cbufalloc > 65536)
yy
warning("Reallocating string buffer larger than 64kB");
parser_
warning("Reallocating string buffer larger than 64kB");
}
cbuffer[cbufidx++] = c;
}
...
...
@@ -414,7 +414,7 @@ int do_import(char *fname)
first_import = import;
if (!(path = wpp_find_include( fname, input_name )))
yy
error("Unable to open include file %s", fname);
parser_
error("Unable to open include file %s", fname);
import_stack[ptr].temp_name = temp_name;
import_stack[ptr].input_name = input_name;
...
...
@@ -427,7 +427,7 @@ int do_import(char *fname)
if (ret) exit(1);
if((f = fopen(temp_name, "r")) == NULL)
yy
error("Unable to open %s", temp_name);
parser_
error("Unable to open %s", temp_name);
import_stack[ptr].state = YY_CURRENT_BUFFER;
yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
...
...
tools/widl/parser.y
View file @
86bb809e
...
...
@@ -126,8 +126,6 @@ static void check_arg(var_t *arg);
unsigned int num;
}
%name-prefix="yy"
%token <str> aIDENTIFIER
%token <str> aKNOWNTYPE
%token <num> aNUM aHEXNUM
...
...
tools/widl/proxy.c
View file @
86bb809e
...
...
@@ -936,7 +936,7 @@ static void write_proxy(type_t *iface)
gen_proxy
(
iface
,
cur
,
idx
);
gen_stub
(
iface
,
cur
,
cname
);
if
(
midx
==
-
1
)
midx
=
idx
;
else
if
(
midx
!=
idx
)
yy
error
(
"method index mismatch in write_proxy"
);
else
if
(
midx
!=
idx
)
parser_
error
(
"method index mismatch in write_proxy"
);
midx
++
;
}
cur
=
PREV_LINK
(
cur
);
...
...
tools/widl/utils.c
View file @
86bb809e
...
...
@@ -68,21 +68,21 @@ static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
}
int
yy
error
(
const
char
*
s
,
...)
int
parser_
error
(
const
char
*
s
,
...)
{
va_list
ap
;
va_start
(
ap
,
s
);
generic_msg
(
s
,
"Error"
,
yy
text
,
ap
);
generic_msg
(
s
,
"Error"
,
parser_
text
,
ap
);
va_end
(
ap
);
exit
(
1
);
return
1
;
}
int
yy
warning
(
const
char
*
s
,
...)
int
parser_
warning
(
const
char
*
s
,
...)
{
va_list
ap
;
va_start
(
ap
,
s
);
generic_msg
(
s
,
"Warning"
,
yy
text
,
ap
);
generic_msg
(
s
,
"Warning"
,
parser_
text
,
ap
);
va_end
(
ap
);
return
0
;
}
...
...
tools/widl/utils.h
View file @
86bb809e
...
...
@@ -33,8 +33,8 @@ char *xstrdup(const char *str);
#define __attribute__(X)
#endif
int
yy
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
yy
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
parser_
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
parser_
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
internal_error
(
const
char
*
file
,
int
line
,
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
3
,
4
)));
void
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
...
...
tools/widl/widl.c
View file @
86bb809e
...
...
@@ -84,7 +84,7 @@ static const char version_string[] = "Wine IDL Compiler version " PACKAGE_VERSIO
int
win32
=
1
;
int
debuglevel
=
DEBUGLEVEL_NONE
;
int
yy
debug
,
yy_flex_debug
;
int
parser_
debug
,
yy_flex_debug
;
int
pedantic
=
0
;
static
int
do_everything
=
1
;
...
...
@@ -271,7 +271,7 @@ int main(int argc,char *argv[])
setbuf
(
stderr
,
0
);
}
yy
debug
=
debuglevel
&
DEBUGLEVEL_TRACE
?
1
:
0
;
parser_
debug
=
debuglevel
&
DEBUGLEVEL_TRACE
?
1
:
0
;
yy_flex_debug
=
debuglevel
&
DEBUGLEVEL_TRACE
?
1
:
0
;
wpp_set_debug
(
(
debuglevel
&
DEBUGLEVEL_PPLEX
)
!=
0
,
...
...
@@ -330,13 +330,13 @@ int main(int argc,char *argv[])
if
(
ret
)
exit
(
1
);
if
(
preprocess_only
)
exit
(
0
);
if
(
!
(
yy
in
=
fopen
(
temp_name
,
"r"
)))
{
if
(
!
(
parser_
in
=
fopen
(
temp_name
,
"r"
)))
{
fprintf
(
stderr
,
"Could not open %s for input
\n
"
,
temp_name
);
return
1
;
}
}
else
{
if
(
!
(
yy
in
=
fopen
(
input_name
,
"r"
)))
{
if
(
!
(
parser_
in
=
fopen
(
input_name
,
"r"
)))
{
fprintf
(
stderr
,
"Could not open %s for input
\n
"
,
input_name
);
return
1
;
}
...
...
@@ -380,7 +380,7 @@ int main(int argc,char *argv[])
}
init_types
();
ret
=
yy
parse
();
ret
=
parser_
parse
();
if
(
do_header
)
{
fprintf
(
header
,
"/* Begin additional prototypes for all interfaces */
\n
"
);
...
...
@@ -405,7 +405,7 @@ int main(int argc,char *argv[])
fclose
(
idfile
);
}
fclose
(
yy
in
);
fclose
(
parser_
in
);
if
(
ret
)
{
exit
(
1
);
...
...
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