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
f8e72b29
Commit
f8e72b29
authored
13 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
vbscript: Added beginning lexer implementation.
parent
80bcaf8d
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/lex.c
+56
-0
56 additions, 0 deletions
dlls/vbscript/lex.c
dlls/vbscript/parse.h
+5
-1
5 additions, 1 deletion
dlls/vbscript/parse.h
dlls/vbscript/parser.y
+5
-6
5 additions, 6 deletions
dlls/vbscript/parser.y
with
67 additions
and
7 deletions
dlls/vbscript/Makefile.in
+
1
−
0
View file @
f8e72b29
MODULE
=
vbscript.dll
C_SRCS
=
\
lex.c
\
vbdisp.c
\
vbscript.c
\
vbscript_main.c
...
...
This diff is collapsed.
Click to expand it.
dlls/vbscript/lex.c
0 → 100644
+
56
−
0
View file @
f8e72b29
/*
* 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
"parse.h"
#include
"parser.tab.h"
#include
"wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
static
int
parse_next_token
(
void
*
lval
,
parser_ctx_t
*
ctx
)
{
WCHAR
c
;
while
(
*
ctx
->
ptr
==
' '
||
*
ctx
->
ptr
==
'\t'
||
*
ctx
->
ptr
==
'\r'
)
ctx
->
ptr
++
;
if
(
ctx
->
ptr
==
ctx
->
end
)
return
ctx
->
last_token
==
tNL
?
tEOF
:
tNL
;
c
=
*
ctx
->
ptr
;
FIXME
(
"Unhandled char %c in %s
\n
"
,
*
ctx
->
ptr
,
debugstr_w
(
ctx
->
ptr
));
return
c
;
}
int
parser_lex
(
void
*
lval
,
parser_ctx_t
*
ctx
)
{
int
ret
;
while
(
1
)
{
ret
=
parse_next_token
(
lval
,
ctx
);
if
(
ret
!=
tNL
||
ctx
->
last_token
!=
tNL
)
break
;
ctx
->
last_nl
=
ctx
->
ptr
-
ctx
->
code
;
}
return
(
ctx
->
last_token
=
ret
);
}
This diff is collapsed.
Click to expand it.
dlls/vbscript/parse.h
+
5
−
1
View file @
f8e72b29
...
...
@@ -23,6 +23,10 @@ typedef struct {
BOOL
parse_complete
;
HRESULT
hres
;
int
last_token
;
unsigned
last_nl
;
}
parser_ctx_t
;
HRESULT
parse_script
(
parser_ctx_t
*
,
const
WCHAR
*
);
HRESULT
parse_script
(
parser_ctx_t
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
int
parser_lex
(
void
*
,
parser_ctx_t
*
)
DECLSPEC_HIDDEN
;
This diff is collapsed.
Click to expand it.
dlls/vbscript/parser.y
+
5
−
6
View file @
f8e72b29
...
...
@@ -33,12 +33,6 @@ static int parser_error(const char*);
static void parse_complete(parser_ctx_t*);
static int parser_lex(void *lval, parser_ctx_t *ctx)
{
FIXME("\n");
return 0;
}
%}
%pure_parser
...
...
@@ -50,6 +44,8 @@ static int parser_lex(void *lval, parser_ctx_t *ctx)
const WCHAR *string;
}
%token tNL
%%
Program : tEOF { parse_complete(ctx); }
...
...
@@ -74,6 +70,9 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
ctx->parse_complete = FALSE;
ctx->hres = S_OK;
ctx->last_token = tNL;
ctx->last_nl = 0;
parser_parse(ctx);
if(FAILED(ctx->hres))
...
...
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