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
a110cffd
Commit
a110cffd
authored
Mar 31, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Parse typedefs of function pointers.
parent
08ae5654
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
22 deletions
+20
-22
parser.y
tools/widl/parser.y
+18
-22
widltypes.h
tools/widl/widltypes.h
+2
-0
No files found.
tools/widl/parser.y
View file @
a110cffd
...
...
@@ -100,7 +100,7 @@ static var_t *make_var(char *name);
static pident_list_t *append_pident(pident_list_t *list, pident_t *p);
static pident_t *make_pident(var_t *var);
static func_list_t *append_func(func_list_t *list, func_t *func);
static func_t *make_func(var_t *def
, var_list_t *args
);
static func_t *make_func(var_t *def);
static type_t *make_class(char *name);
static type_t *make_safearray(type_t *type);
static type_t *make_builtin(char *name);
...
...
@@ -259,7 +259,7 @@ static void check_all_user_types(ifref_list_t *ifaces);
%type <var> arg field s_field case enum constdef externdef
%type <var_list> m_args no_args args fields cases enums enum_list dispint_props
%type <var> m_ident t_ident ident
%type <pident> p
_ident p
ident
%type <pident> p
ident func_ident direct_
ident
%type <pident_list> pident_list
%type <func> funcdef
%type <func_list> int_statements dispint_meths
...
...
@@ -394,17 +394,6 @@ arg: attributes type pident array { $$ = $3->var;
set_type($$, $1, $2->ptr_level, $3, TRUE);
free($2);
}
| attributes type pident '(' m_args ')' { $$ = $3->var;
$$->attrs = $1;
set_type($$, $2, $3->ptr_level - 1, NULL, TRUE);
free($3);
$$->args = $5;
}
| type pident '(' m_args ')' { $$ = $2->var;
set_type($$, $1, $2->ptr_level - 1, NULL, TRUE);
free($2);
$$->args = $4;
}
;
array: { $$ = NULL; }
...
...
@@ -654,12 +643,11 @@ s_field: m_attributes type pident array { $$ = $3->var;
;
funcdef:
m_attributes type callconv pident
'(' m_args ')' { var_t *v = $4->var;
m_attributes type callconv pident { var_t *v = $4->var;
v->attrs = $1;
set_type(v, $2, $4->ptr_level, NULL, FALSE);
free($4);
$$ = make_func(v
, $6
);
$$ = make_func(v);
if (is_attr(v->attrs, ATTR_IN)) {
error_loc("inapplicable attribute [in] for function '%s'\n",$$->def->name);
}
...
...
@@ -859,13 +847,19 @@ moduledef: modulehdr '{' int_statements '}' { $$ = $1;
}
;
p_ident: '*' pident %prec PPTR { $$ = $2; $$->ptr_level++; }
| tCONST p_ident { $$ = $2; /* FIXME */ }
pident: '*' pident %prec PPTR { $$ = $2; $$->ptr_level++; }
| tCONST pident { $$ = $2; /* FIXME */ }
| direct_ident
;
pident: ident { $$ = make_pident($1); }
| p_ident
func_ident: direct_ident '(' m_args ')' { $$ = $1; $1->var->args = $3; }
direct_ident: ident { $$ = make_pident($1); }
| '(' pident ')' { $$ = $2; }
| func_ident { $$ = $1;
$$->func_ptr_level = $$->ptr_level;
$$->ptr_level = 0;
}
;
pident_list:
...
...
@@ -1521,6 +1515,7 @@ static pident_t *make_pident(var_t *var)
pident_t *p = xmalloc(sizeof(*p));
p->var = var;
p->ptr_level = 0;
p->func_ptr_level = 0;
return p;
}
...
...
@@ -1536,11 +1531,12 @@ static func_list_t *append_func(func_list_t *list, func_t *func)
return list;
}
static func_t *make_func(var_t *def
, var_list_t *args
)
static func_t *make_func(var_t *def)
{
func_t *f = xmalloc(sizeof(func_t));
f->def = def;
f->args = args;
f->args = def->args;
def->args = NULL;
f->ignore = parse_only;
f->idx = -1;
return f;
...
...
tools/widl/widltypes.h
View file @
a110cffd
...
...
@@ -244,6 +244,8 @@ struct _var_t {
struct
_pident_t
{
var_t
*
var
;
int
ptr_level
;
/* levels of indirection for function pointers */
int
func_ptr_level
;
/* parser-internal */
struct
list
entry
;
...
...
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