Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e63c4472
Commit
e63c4472
authored
Sep 12, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added assign statement parser implementation.
parent
43f6a684
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
parse.h
dlls/vbscript/parse.h
+7
-0
parser.y
dlls/vbscript/parser.y
+16
-0
No files found.
dlls/vbscript/parse.h
View file @
e63c4472
...
@@ -78,6 +78,7 @@ typedef struct {
...
@@ -78,6 +78,7 @@ typedef struct {
}
member_expression_t
;
}
member_expression_t
;
typedef
enum
{
typedef
enum
{
STAT_ASSIGN
,
STAT_CALL
STAT_CALL
}
statement_type_t
;
}
statement_type_t
;
...
@@ -92,6 +93,12 @@ typedef struct {
...
@@ -92,6 +93,12 @@ typedef struct {
}
call_statement_t
;
}
call_statement_t
;
typedef
struct
{
typedef
struct
{
statement_t
stat
;
member_expression_t
*
member_expr
;
expression_t
*
value_expr
;
}
assign_statement_t
;
typedef
struct
{
const
WCHAR
*
code
;
const
WCHAR
*
code
;
const
WCHAR
*
ptr
;
const
WCHAR
*
ptr
;
const
WCHAR
*
end
;
const
WCHAR
*
end
;
...
...
dlls/vbscript/parser.y
View file @
e63c4472
...
@@ -46,6 +46,7 @@ static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expre
...
@@ -46,6 +46,7 @@ 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 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_call_statement(parser_ctx_t*,member_expression_t*);
static statement_t *new_assign_statement(parser_ctx_t*,member_expression_t*,expression_t*);
#define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT
#define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT
...
@@ -108,6 +109,8 @@ StatementNl
...
@@ -108,6 +109,8 @@ StatementNl
Statement
Statement
: MemberExpression ArgumentList_opt { $1->args = $2; $$ = new_call_statement(ctx, $1); CHECK_ERROR; }
: MemberExpression ArgumentList_opt { $1->args = $2; $$ = new_call_statement(ctx, $1); CHECK_ERROR; }
| tCALL MemberExpression Arguments_opt { $2->args = $3; $$ = new_call_statement(ctx, $2); CHECK_ERROR; }
| 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; }
MemberExpression
MemberExpression
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
...
@@ -325,6 +328,19 @@ static statement_t *new_call_statement(parser_ctx_t *ctx, member_expression_t *e
...
@@ -325,6 +328,19 @@ static statement_t *new_call_statement(parser_ctx_t *ctx, member_expression_t *e
return &stat->stat;
return &stat->stat;
}
}
static statement_t *new_assign_statement(parser_ctx_t *ctx, member_expression_t *left, expression_t *right)
{
assign_statement_t *stat;
stat = new_statement(ctx, STAT_ASSIGN, sizeof(*stat));
if(!stat)
return NULL;
stat->member_expr = left;
stat->value_expr = right;
return &stat->stat;
}
void *parser_alloc(parser_ctx_t *ctx, size_t size)
void *parser_alloc(parser_ctx_t *ctx, size_t size)
{
{
void *ret;
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