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
03d50174
Commit
03d50174
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 "->" and "." operators in expressions.
parent
efd10742
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
1 deletion
+18
-1
header.c
tools/widl/header.c
+4
-0
parser.l
tools/widl/parser.l
+1
-0
parser.y
tools/widl/parser.y
+5
-1
typegen.c
tools/widl/typegen.c
+6
-0
widltypes.h
tools/widl/widltypes.h
+2
-0
No files found.
tools/widl/header.c
View file @
03d50174
...
...
@@ -526,6 +526,8 @@ void write_expr(FILE *h, const expr_t *e, int brackets)
case
EXPR_SUB
:
case
EXPR_AND
:
case
EXPR_OR
:
case
EXPR_MEMBERPTR
:
case
EXPR_MEMBER
:
if
(
brackets
)
fprintf
(
h
,
"("
);
write_expr
(
h
,
e
->
ref
,
1
);
switch
(
e
->
type
)
{
...
...
@@ -537,6 +539,8 @@ void write_expr(FILE *h, const expr_t *e, int brackets)
case
EXPR_SUB
:
fprintf
(
h
,
" - "
);
break
;
case
EXPR_AND
:
fprintf
(
h
,
" & "
);
break
;
case
EXPR_OR
:
fprintf
(
h
,
" | "
);
break
;
case
EXPR_MEMBERPTR
:
fprintf
(
h
,
"->"
);
break
;
case
EXPR_MEMBER
:
fprintf
(
h
,
"."
);
break
;
default:
break
;
}
write_expr
(
h
,
e
->
u
.
ext
,
1
);
...
...
tools/widl/parser.l
View file @
03d50174
...
...
@@ -162,6 +162,7 @@ SAFEARRAY{ws}*/\( return tSAFEARRAY;
<INITIAL,ATTR>{ws}
<INITIAL,ATTR>\<\< return SHL;
<INITIAL,ATTR>\>\> return SHR;
<INITIAL,ATTR>\-\> return MEMBERPTR;
<INITIAL,ATTR>. return yytext[0];
<<EOF>> {
if (import_stack_ptr)
...
...
tools/widl/parser.y
View file @
03d50174
...
...
@@ -180,6 +180,7 @@ static void add_explicit_handle_if_necessary(func_t *func);
%token <uuid> aUUID
%token aEOF
%token SHL SHR
%token MEMBERPTR
%token tAGGREGATABLE tALLOCATE tAPPOBJECT tASYNC tASYNCUUID
%token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT
%token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS
...
...
@@ -294,6 +295,7 @@ static void add_explicit_handle_if_necessary(func_t *func);
%left '-' '+'
%left '*' '/'
%left SHL SHR
%left '.' MEMBERPTR
%right '~'
%right CAST
%right PPTR
...
...
@@ -636,8 +638,10 @@ expr: aNUM { $$ = make_exprl(EXPR_NUM, $1); }
| expr SHR expr { $$ = make_expr2(EXPR_SHR, $1, $3); }
| '~' expr { $$ = make_expr1(EXPR_NOT, $2); }
| '-' expr %prec NEG { $$ = make_expr1(EXPR_NEG, $2); }
| '&' expr %prec ADDRESSOF
{ $$ = make_expr1(EXPR_ADDRESSOF, $2); }
| '&' expr %prec ADDRESSOF
{ $$ = make_expr1(EXPR_ADDRESSOF, $2); }
| '*' expr %prec PPTR { $$ = make_expr1(EXPR_PPTR, $2); }
| expr MEMBERPTR expr { $$ = make_expr2(EXPR_MEMBERPTR, $1, $3); }
| 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 ')' { $$ = $2; }
...
...
tools/widl/typegen.c
View file @
03d50174
...
...
@@ -356,6 +356,8 @@ static int compare_expr(const expr_t *a, const expr_t *b)
case
EXPR_DIV
:
case
EXPR_SHL
:
case
EXPR_SHR
:
case
EXPR_MEMBERPTR
:
case
EXPR_MEMBER
:
ret
=
compare_expr
(
a
->
ref
,
b
->
ref
);
if
(
ret
!=
0
)
return
ret
;
...
...
@@ -3151,6 +3153,8 @@ static void write_struct_expr(FILE *h, const expr_t *e, int brackets,
case
EXPR_SUB
:
case
EXPR_AND
:
case
EXPR_OR
:
case
EXPR_MEMBERPTR
:
case
EXPR_MEMBER
:
if
(
brackets
)
fprintf
(
h
,
"("
);
write_struct_expr
(
h
,
e
->
ref
,
1
,
fields
,
structvar
);
switch
(
e
->
type
)
{
...
...
@@ -3162,6 +3166,8 @@ static void write_struct_expr(FILE *h, const expr_t *e, int brackets,
case
EXPR_SUB
:
fprintf
(
h
,
" - "
);
break
;
case
EXPR_AND
:
fprintf
(
h
,
" & "
);
break
;
case
EXPR_OR
:
fprintf
(
h
,
" | "
);
break
;
case
EXPR_MEMBERPTR
:
fprintf
(
h
,
"->"
);
break
;
case
EXPR_MEMBER
:
fprintf
(
h
,
"."
);
break
;
default:
break
;
}
write_struct_expr
(
h
,
e
->
u
.
ext
,
1
,
fields
,
structvar
);
...
...
tools/widl/widltypes.h
View file @
03d50174
...
...
@@ -161,6 +161,8 @@ enum expr_type
EXPR_COND
,
EXPR_TRUEFALSE
,
EXPR_ADDRESSOF
,
EXPR_MEMBERPTR
,
EXPR_MEMBER
,
};
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