Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
8906a4aa
Commit
8906a4aa
authored
13 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
vbscript: Added beginning interpreter implementation.
parent
c674c7a7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/vbscript/Makefile.in
+1
-0
1 addition, 0 deletions
dlls/vbscript/Makefile.in
dlls/vbscript/interp.c
+77
-0
77 additions, 0 deletions
dlls/vbscript/interp.c
dlls/vbscript/vbscript.c
+29
-5
29 additions, 5 deletions
dlls/vbscript/vbscript.c
dlls/vbscript/vbscript.h
+1
-0
1 addition, 0 deletions
dlls/vbscript/vbscript.h
with
108 additions
and
5 deletions
dlls/vbscript/Makefile.in
+
1
−
0
View file @
8906a4aa
...
...
@@ -2,6 +2,7 @@ MODULE = vbscript.dll
C_SRCS
=
\
compile.c
\
interp.c
\
lex.c
\
vbdisp.c
\
vbscript.c
\
...
...
This diff is collapsed.
Click to expand it.
dlls/vbscript/interp.c
0 → 100644
+
77
−
0
View file @
8906a4aa
/*
* Copyright 2011 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include
<assert.h>
#include
"vbscript.h"
#include
"wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
typedef
struct
{
vbscode_t
*
code
;
instr_t
*
instr
;
}
exec_ctx_t
;
typedef
HRESULT
(
*
instr_func_t
)(
exec_ctx_t
*
);
static
HRESULT
interp_ret
(
exec_ctx_t
*
ctx
)
{
TRACE
(
"
\n
"
);
ctx
->
instr
=
NULL
;
return
S_OK
;
}
static
const
instr_func_t
op_funcs
[]
=
{
#define X(x,n) interp_ ## x,
OP_LIST
#undef X
};
static
const
unsigned
op_move
[]
=
{
#define X(x,n) n,
OP_LIST
#undef X
};
HRESULT
exec_script
(
script_ctx_t
*
ctx
,
function_t
*
func
)
{
exec_ctx_t
exec
;
vbsop_t
op
;
HRESULT
hres
=
S_OK
;
exec
.
code
=
func
->
code_ctx
;
exec
.
instr
=
exec
.
code
->
instrs
+
func
->
code_off
;
while
(
exec
.
instr
)
{
op
=
exec
.
instr
->
op
;
hres
=
op_funcs
[
op
](
&
exec
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Failed %08x
\n
"
,
hres
);
break
;
}
exec
.
instr
+=
op_move
[
op
];
}
return
hres
;
}
This diff is collapsed.
Click to expand it.
dlls/vbscript/vbscript.c
+
29
−
5
View file @
8906a4aa
...
...
@@ -63,9 +63,34 @@ static void change_state(VBScript *This, SCRIPTSTATE state)
IActiveScriptSite_OnStateChange
(
This
->
site
,
state
);
}
static
void
exec_queued_code
(
VBScript
*
This
)
static
inline
BOOL
is_started
(
VBScript
*
This
)
{
FIXME
(
"
\n
"
);
return
This
->
state
==
SCRIPTSTATE_STARTED
||
This
->
state
==
SCRIPTSTATE_CONNECTED
||
This
->
state
==
SCRIPTSTATE_DISCONNECTED
;
}
static
HRESULT
exec_global_code
(
script_ctx_t
*
ctx
,
vbscode_t
*
code
)
{
HRESULT
hres
;
code
->
global_executed
=
TRUE
;
IActiveScriptSite_OnEnterScript
(
ctx
->
site
);
hres
=
exec_script
(
ctx
,
&
code
->
global_code
);
IActiveScriptSite_OnLeaveScript
(
ctx
->
site
);
return
hres
;
}
static
void
exec_queued_code
(
script_ctx_t
*
ctx
)
{
vbscode_t
*
iter
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
ctx
->
code_list
,
vbscode_t
,
entry
)
{
if
(
!
iter
->
global_executed
)
exec_global_code
(
ctx
,
iter
);
}
}
static
HRESULT
set_ctx_site
(
VBScript
*
This
)
...
...
@@ -264,7 +289,7 @@ static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE
if
(
This
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
exec_queued_code
(
This
);
exec_queued_code
(
This
->
ctx
);
break
;
case
SCRIPTSTATE_INITIALIZED
:
FIXME
(
"unimplemented SCRIPTSTATE_INITIALIZED
\n
"
);
...
...
@@ -530,8 +555,7 @@ static HRESULT WINAPI VBScriptParse_ParseScriptText(IActiveScriptParse *iface,
if
(
FAILED
(
hres
))
return
hres
;
FIXME
(
"executing script not implemented
\n
"
);
return
E_NOTIMPL
;
return
is_started
(
This
)
?
exec_global_code
(
This
->
ctx
,
code
)
:
S_OK
;
}
static
const
IActiveScriptParseVtbl
VBScriptParseVtbl
=
{
...
...
This diff is collapsed.
Click to expand it.
dlls/vbscript/vbscript.h
+
1
−
0
View file @
8906a4aa
...
...
@@ -93,6 +93,7 @@ struct _vbscode_t {
void
release_vbscode
(
vbscode_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
vbscode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
exec_script
(
script_ctx_t
*
,
function_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
WINAPI
VBScriptFactory_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment