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
82b76518
Commit
82b76518
authored
Sep 09, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added parser support for equality expression.
parent
6ca3cb62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
parse.h
dlls/vbscript/parse.h
+7
-0
parser.y
dlls/vbscript/parser.y
+24
-2
No files found.
dlls/vbscript/parse.h
View file @
82b76518
...
...
@@ -18,6 +18,7 @@
typedef
enum
{
EXPR_BOOL
,
EXPR_EQUAL
,
EXPR_MEMBER
,
EXPR_NOT
,
EXPR_STRING
...
...
@@ -45,6 +46,12 @@ typedef struct {
typedef
struct
{
expression_t
expr
;
expression_t
*
left
;
expression_t
*
right
;
}
binary_expression_t
;
typedef
struct
{
expression_t
expr
;
expression_t
*
obj_expr
;
const
WCHAR
*
identifier
;
expression_t
*
args
;
...
...
dlls/vbscript/parser.y
View file @
82b76518
...
...
@@ -38,6 +38,7 @@ static void source_add_statement(parser_ctx_t*,statement_t*);
static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL);
static expression_t *new_string_expression(parser_ctx_t*,const WCHAR*);
static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*);
static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expression_t*,expression_t*);
static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*);
...
...
@@ -74,7 +75,8 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%token <string> tIdentifier tString
%type <statement> Statement StatementNl
%type <expression> Expression LiteralExpression PrimaryExpression
%type <expression> Expression LiteralExpression PrimaryExpression EqualityExpression
%type <expression> ConcatExpression
%type <expression> NotExpression
%type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList_opt ArgumentList
...
...
@@ -124,9 +126,16 @@ Expression
: NotExpression { $$ = $1; }
NotExpression
: EqualityExpression { $$ = $1; }
| tNOT NotExpression { $$ = new_unary_expression(ctx, EXPR_NOT, $2); CHECK_ERROR; }
EqualityExpression
: ConcatExpression { $$ = $1; }
| EqualityExpression '=' ConcatExpression { $$ = new_binary_expression(ctx, EXPR_EQUAL, $1, $3); CHECK_ERROR; }
ConcatExpression
: LiteralExpression /* FIXME */ { $$ = $1; }
| PrimaryExpression /* FIXME */ { $$ = $1; }
| tNOT NotExpression { $$ = new_unary_expression(ctx, EXPR_NOT, $2); CHECK_ERROR; }
LiteralExpression
: tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
...
...
@@ -208,6 +217,19 @@ static expression_t *new_unary_expression(parser_ctx_t *ctx, expression_type_t t
return &expr->expr;
}
static expression_t *new_binary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *left, expression_t *right)
{
binary_expression_t *expr;
expr = new_expression(ctx, type, sizeof(*expr));
if(!expr)
return NULL;
expr->left = left;
expr->right = right;
return &expr->expr;
}
static member_expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *obj_expr, const WCHAR *identifier)
{
member_expression_t *expr;
...
...
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