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
924da405
Commit
924da405
authored
Sep 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added dim statement parser implementation.
parent
29ccac79
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
parse.h
dlls/vbscript/parse.h
+12
-1
parser.y
dlls/vbscript/parser.y
+36
-1
No files found.
dlls/vbscript/parse.h
View file @
924da405
...
...
@@ -79,7 +79,8 @@ typedef struct {
typedef
enum
{
STAT_ASSIGN
,
STAT_CALL
STAT_CALL
,
STAT_DIM
}
statement_type_t
;
typedef
struct
_statement_t
{
...
...
@@ -98,6 +99,16 @@ typedef struct {
expression_t
*
value_expr
;
}
assign_statement_t
;
typedef
struct
_dim_decl_t
{
const
WCHAR
*
name
;
struct
_dim_decl_t
*
next
;
}
dim_decl_t
;
typedef
struct
_dim_statement_t
{
statement_t
stat
;
dim_decl_t
*
dim_decls
;
}
dim_statement_t
;
typedef
struct
{
const
WCHAR
*
code
;
const
WCHAR
*
ptr
;
...
...
dlls/vbscript/parser.y
View file @
924da405
...
...
@@ -46,7 +46,10 @@ static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expre
static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*);
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_dim_statement(parser_ctx_t*,dim_decl_t*);
static dim_decl_t *new_dim_decl(parser_ctx_t*,const WCHAR*,dim_decl_t*);
#define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT
...
...
@@ -60,6 +63,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
statement_t *statement;
expression_t *expression;
member_expression_t *member;
dim_decl_t *dim_decl;
LONG lng;
BOOL bool;
double dbl;
...
...
@@ -89,6 +93,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList_opt ArgumentList
%type <bool> OptionExplicit_opt
%type <dim_decl> DimDeclList
%%
...
...
@@ -111,11 +116,16 @@ Statement
| tCALL MemberExpression Arguments_opt { $2->args = $3; $$ = new_call_statement(ctx, $2); CHECK_ERROR; }
| MemberExpression Arguments_opt '=' Expression
{ $1->args = $2; $$ = new_assign_statement(ctx, $1, $4); CHECK_ERROR; }
| tDIM DimDeclList { $$ = new_dim_statement(ctx, $2); CHECK_ERROR; }
MemberExpression
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
| CallExpression '.' tIdentifier { $$ = new_member_expression(ctx, $1, $3); CHECK_ERROR; }
DimDeclList /* FIXME: Support arrays */
: tIdentifier { $$ = new_dim_decl(ctx, $1, NULL); CHECK_ERROR; }
| tIdentifier ',' DimDeclList { $$ = new_dim_decl(ctx, $1, $3); CHECK_ERROR; }
Arguments_opt
: EmptyBrackets_opt { $$ = NULL; }
| '(' ArgumentList ')' { $$ = $2; }
...
...
@@ -341,6 +351,31 @@ static statement_t *new_assign_statement(parser_ctx_t *ctx, member_expression_t
return &stat->stat;
}
static dim_decl_t *new_dim_decl(parser_ctx_t *ctx, const WCHAR *name, dim_decl_t *next)
{
dim_decl_t *decl;
decl = parser_alloc(ctx, sizeof(*decl));
if(!decl)
return NULL;
decl->name = name;
decl->next = next;
return decl;
}
static statement_t *new_dim_statement(parser_ctx_t *ctx, dim_decl_t *decls)
{
dim_statement_t *stat;
stat = new_statement(ctx, STAT_DIM, sizeof(*stat));
if(!stat)
return NULL;
stat->dim_decls = decls;
return &stat->stat;
}
void *parser_alloc(parser_ctx_t *ctx, size_t size)
{
void *ret;
...
...
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