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
d27c7601
Commit
d27c7601
authored
Apr 20, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add support for arrays in expressions.
parent
03d50174
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
header.c
tools/widl/header.c
+8
-0
parser.y
tools/widl/parser.y
+2
-1
typegen.c
tools/widl/typegen.c
+9
-0
widltypes.h
tools/widl/widltypes.h
+1
-0
No files found.
tools/widl/header.c
View file @
d27c7601
...
...
@@ -559,6 +559,14 @@ void write_expr(FILE *h, const expr_t *e, int brackets)
fprintf
(
h
,
"&"
);
write_expr
(
h
,
e
->
ref
,
1
);
break
;
case
EXPR_ARRAY
:
if
(
brackets
)
fprintf
(
h
,
"("
);
write_expr
(
h
,
e
->
ref
,
1
);
fprintf
(
h
,
"["
);
write_expr
(
h
,
e
->
u
.
ext
,
1
);
fprintf
(
h
,
"]"
);
if
(
brackets
)
fprintf
(
h
,
")"
);
break
;
}
}
...
...
tools/widl/parser.y
View file @
d27c7601
...
...
@@ -295,7 +295,7 @@ static void add_explicit_handle_if_necessary(func_t *func);
%left '-' '+'
%left '*' '/'
%left SHL SHR
%left '.' MEMBERPTR
%left '.' MEMBERPTR
'[' ']'
%right '~'
%right CAST
%right PPTR
...
...
@@ -644,6 +644,7 @@ expr: aNUM { $$ = make_exprl(EXPR_NUM, $1); }
| expr '.' expr { $$ = make_expr2(EXPR_MEMBER, $1, $3); }
| '(' type ')' expr %prec CAST { $$ = make_exprt(EXPR_CAST, $2, $4); }
| tSIZEOF '(' type ')' { $$ = make_exprt(EXPR_SIZEOF, $3, NULL); }
| expr '[' expr ']' { $$ = make_expr2(EXPR_ARRAY, $1, $3); }
| '(' expr ')' { $$ = $2; }
;
...
...
tools/widl/typegen.c
View file @
d27c7601
...
...
@@ -358,6 +358,7 @@ static int compare_expr(const expr_t *a, const expr_t *b)
case
EXPR_SHR
:
case
EXPR_MEMBERPTR
:
case
EXPR_MEMBER
:
case
EXPR_ARRAY
:
ret
=
compare_expr
(
a
->
ref
,
b
->
ref
);
if
(
ret
!=
0
)
return
ret
;
...
...
@@ -3186,6 +3187,14 @@ static void write_struct_expr(FILE *h, const expr_t *e, int brackets,
fprintf
(
h
,
"&"
);
write_struct_expr
(
h
,
e
->
ref
,
1
,
fields
,
structvar
);
break
;
case
EXPR_ARRAY
:
if
(
brackets
)
fprintf
(
h
,
"("
);
write_struct_expr
(
h
,
e
->
ref
,
1
,
fields
,
structvar
);
fprintf
(
h
,
"["
);
write_struct_expr
(
h
,
e
->
u
.
ext
,
1
,
fields
,
structvar
);
fprintf
(
h
,
"]"
);
if
(
brackets
)
fprintf
(
h
,
")"
);
break
;
}
}
...
...
tools/widl/widltypes.h
View file @
d27c7601
...
...
@@ -163,6 +163,7 @@ enum expr_type
EXPR_ADDRESSOF
,
EXPR_MEMBERPTR
,
EXPR_MEMBER
,
EXPR_ARRAY
,
};
enum
type_kind
...
...
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