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
b3a6217e
Commit
b3a6217e
authored
Sep 15, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added set statement parser/compiler implementation.
parent
e8797c29
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
5 deletions
+41
-5
compile.c
dlls/vbscript/compile.c
+7
-4
interp.c
dlls/vbscript/interp.c
+14
-0
parse.h
dlls/vbscript/parse.h
+2
-1
parser.y
dlls/vbscript/parser.y
+16
-0
vbscript.h
dlls/vbscript/vbscript.h
+2
-0
No files found.
dlls/vbscript/compile.c
View file @
b3a6217e
...
@@ -475,7 +475,7 @@ static HRESULT compile_if_statement(compile_ctx_t *ctx, if_statement_t *stat)
...
@@ -475,7 +475,7 @@ static HRESULT compile_if_statement(compile_ctx_t *ctx, if_statement_t *stat)
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
compile_assign_statement
(
compile_ctx_t
*
ctx
,
assign_statement_t
*
stat
)
static
HRESULT
compile_assign_statement
(
compile_ctx_t
*
ctx
,
assign_statement_t
*
stat
,
BOOL
is_set
)
{
{
HRESULT
hres
;
HRESULT
hres
;
...
@@ -493,9 +493,9 @@ static HRESULT compile_assign_statement(compile_ctx_t *ctx, assign_statement_t *
...
@@ -493,9 +493,9 @@ static HRESULT compile_assign_statement(compile_ctx_t *ctx, assign_statement_t *
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
hres
=
push_instr_bstr
(
ctx
,
OP_assign_member
,
stat
->
member_expr
->
identifier
);
hres
=
push_instr_bstr
(
ctx
,
is_set
?
OP_set_member
:
OP_assign_member
,
stat
->
member_expr
->
identifier
);
}
else
{
}
else
{
hres
=
push_instr_bstr
(
ctx
,
OP_assign_ident
,
stat
->
member_expr
->
identifier
);
hres
=
push_instr_bstr
(
ctx
,
is_set
?
OP_set_ident
:
OP_assign_ident
,
stat
->
member_expr
->
identifier
);
}
}
return
hres
;
return
hres
;
...
@@ -585,7 +585,7 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat)
...
@@ -585,7 +585,7 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat)
while
(
stat
)
{
while
(
stat
)
{
switch
(
stat
->
type
)
{
switch
(
stat
->
type
)
{
case
STAT_ASSIGN
:
case
STAT_ASSIGN
:
hres
=
compile_assign_statement
(
ctx
,
(
assign_statement_t
*
)
stat
);
hres
=
compile_assign_statement
(
ctx
,
(
assign_statement_t
*
)
stat
,
FALSE
);
break
;
break
;
case
STAT_CALL
:
case
STAT_CALL
:
hres
=
compile_member_expression
(
ctx
,
((
call_statement_t
*
)
stat
)
->
expr
,
FALSE
);
hres
=
compile_member_expression
(
ctx
,
((
call_statement_t
*
)
stat
)
->
expr
,
FALSE
);
...
@@ -605,6 +605,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat)
...
@@ -605,6 +605,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat)
case
STAT_IF
:
case
STAT_IF
:
hres
=
compile_if_statement
(
ctx
,
(
if_statement_t
*
)
stat
);
hres
=
compile_if_statement
(
ctx
,
(
if_statement_t
*
)
stat
);
break
;
break
;
case
STAT_SET
:
hres
=
compile_assign_statement
(
ctx
,
(
assign_statement_t
*
)
stat
,
TRUE
);
break
;
default:
default:
FIXME
(
"Unimplemented statement type %d
\n
"
,
stat
->
type
);
FIXME
(
"Unimplemented statement type %d
\n
"
,
stat
->
type
);
hres
=
E_NOTIMPL
;
hres
=
E_NOTIMPL
;
...
...
dlls/vbscript/interp.c
View file @
b3a6217e
...
@@ -385,6 +385,13 @@ static HRESULT interp_assign_ident(exec_ctx_t *ctx)
...
@@ -385,6 +385,13 @@ static HRESULT interp_assign_ident(exec_ctx_t *ctx)
return
assign_ident
(
ctx
,
arg
,
v
.
v
,
v
.
owned
);
return
assign_ident
(
ctx
,
arg
,
v
.
v
,
v
.
owned
);
}
}
static
HRESULT
interp_set_ident
(
exec_ctx_t
*
ctx
)
{
const
BSTR
arg
=
ctx
->
instr
->
arg1
.
bstr
;
FIXME
(
"%s
\n
"
,
debugstr_w
(
arg
));
return
E_NOTIMPL
;
}
static
HRESULT
interp_assign_member
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_assign_member
(
exec_ctx_t
*
ctx
)
{
{
BSTR
identifier
=
ctx
->
instr
->
arg1
.
bstr
;
BSTR
identifier
=
ctx
->
instr
->
arg1
.
bstr
;
...
@@ -419,6 +426,13 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx)
...
@@ -419,6 +426,13 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx)
return
hres
;
return
hres
;
}
}
static
HRESULT
interp_set_member
(
exec_ctx_t
*
ctx
)
{
BSTR
identifier
=
ctx
->
instr
->
arg1
.
bstr
;
FIXME
(
"%s
\n
"
,
debugstr_w
(
identifier
));
return
E_NOTIMPL
;
}
static
HRESULT
interp_jmp
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_jmp
(
exec_ctx_t
*
ctx
)
{
{
const
unsigned
arg
=
ctx
->
instr
->
arg1
.
uint
;
const
unsigned
arg
=
ctx
->
instr
->
arg1
.
uint
;
...
...
dlls/vbscript/parse.h
View file @
b3a6217e
...
@@ -94,7 +94,8 @@ typedef enum {
...
@@ -94,7 +94,8 @@ typedef enum {
STAT_EXITFUNC
,
STAT_EXITFUNC
,
STAT_EXITSUB
,
STAT_EXITSUB
,
STAT_FUNC
,
STAT_FUNC
,
STAT_IF
STAT_IF
,
STAT_SET
}
statement_type_t
;
}
statement_type_t
;
typedef
struct
_statement_t
{
typedef
struct
_statement_t
{
...
...
dlls/vbscript/parser.y
View file @
b3a6217e
...
@@ -49,6 +49,7 @@ static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,co
...
@@ -49,6 +49,7 @@ static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,co
static void *new_statement(parser_ctx_t*,statement_type_t,size_t);
static void *new_statement(parser_ctx_t*,statement_type_t,size_t);
static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
static statement_t *new_assign_statement(parser_ctx_t*,member_expression_t*,expression_t*);
static statement_t *new_assign_statement(parser_ctx_t*,member_expression_t*,expression_t*);
static statement_t *new_set_statement(parser_ctx_t*,member_expression_t*,expression_t*);
static statement_t *new_dim_statement(parser_ctx_t*,dim_decl_t*);
static statement_t *new_dim_statement(parser_ctx_t*,dim_decl_t*);
static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,elseif_decl_t*,statement_t*);
static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,elseif_decl_t*,statement_t*);
static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*);
static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*);
...
@@ -146,6 +147,8 @@ Statement
...
@@ -146,6 +147,8 @@ Statement
| FunctionDecl { $$ = new_function_statement(ctx, $1); CHECK_ERROR; }
| FunctionDecl { $$ = new_function_statement(ctx, $1); CHECK_ERROR; }
| tEXIT tFUNCTION { $$ = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; }
| tEXIT tFUNCTION { $$ = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; }
| tEXIT tSUB { $$ = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; }
| tEXIT tSUB { $$ = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; }
| tSET MemberExpression Arguments_opt '=' Expression
{ $2->args = $3; $$ = new_set_statement(ctx, $2, $5); CHECK_ERROR; }
MemberExpression
MemberExpression
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
...
@@ -465,6 +468,19 @@ static statement_t *new_assign_statement(parser_ctx_t *ctx, member_expression_t
...
@@ -465,6 +468,19 @@ static statement_t *new_assign_statement(parser_ctx_t *ctx, member_expression_t
return &stat->stat;
return &stat->stat;
}
}
static statement_t *new_set_statement(parser_ctx_t *ctx, member_expression_t *left, expression_t *right)
{
assign_statement_t *stat;
stat = new_statement(ctx, STAT_SET, sizeof(*stat));
if(!stat)
return NULL;
stat->member_expr = left;
stat->value_expr = right;
return &stat->stat;
}
static dim_decl_t *new_dim_decl(parser_ctx_t *ctx, const WCHAR *name, dim_decl_t *next)
static dim_decl_t *new_dim_decl(parser_ctx_t *ctx, const WCHAR *name, dim_decl_t *next)
{
{
dim_decl_t *decl;
dim_decl_t *decl;
...
...
dlls/vbscript/vbscript.h
View file @
b3a6217e
...
@@ -150,6 +150,8 @@ typedef enum {
...
@@ -150,6 +150,8 @@ typedef enum {
X(null, 1, 0, 0) \
X(null, 1, 0, 0) \
X(or, 1, 0, 0) \
X(or, 1, 0, 0) \
X(ret, 0, 0, 0) \
X(ret, 0, 0, 0) \
X(set_ident, 1, ARG_BSTR, 0) \
X(set_member, 1, ARG_BSTR, 0) \
X(short, 1, ARG_INT, 0) \
X(short, 1, ARG_INT, 0) \
X(string, 1, ARG_STR, 0) \
X(string, 1, ARG_STR, 0) \
X(sub, 1, 0, 0) \
X(sub, 1, 0, 0) \
...
...
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