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
Releases
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
Tayshawnna Jackson
wine
Commits
a0f03896
Commit
a0f03896
authored
10 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
jscript: Added parser rules for missing expressions.
parent
f41ac94e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/jscript/cc_parser.y
+116
-7
116 additions, 7 deletions
dlls/jscript/cc_parser.y
with
116 additions
and
7 deletions
dlls/jscript/cc_parser.y
+
116
−
7
View file @
a0f03896
...
...
@@ -37,10 +37,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
ccval_t ccval;
}
%token t
N
EQ
%token t
EQ tEQEQ tNEQ tNEQEQ tLSHIFT tRSHIFT tRRSHIFT tOR tAND tLEQ tG
EQ
%token <ccval> tCCValue
%type <ccval> CCUnaryExpression CCEqualityExpression CCAdditiveExpression CCMultiplicativeExpression
%type <ccval> CCUnaryExpression CCLogicalORExpression CCLogicalANDExpression
%type <ccval> CCBitwiseORExpression CCBitwiseXORExpression CCBitwiseANDExpression
%type <ccval> CCEqualityExpression CCRelationalExpression CCShiftExpression CCAdditiveExpression CCMultiplicativeExpression
%{
...
...
@@ -69,14 +71,65 @@ static int cc_parser_lex(void *lval, parser_ctx_t *ctx)
case '-':
case '*':
case '/':
case '~':
case '%':
case '^':
return *ctx->ptr++;
case '=':
if(*++ctx->ptr == '=') {
if(*++ctx->ptr == '=') {
ctx->ptr++;
return tEQEQ;
}
return tEQ;
}
break;
case '!':
if(*++ctx->ptr == '=') {
ctx->ptr++;
if(*++ctx->ptr == '=') {
ctx->ptr++;
return tNEQEQ;
}
return tNEQ;
}
return '!';
case '<':
switch(*++ctx->ptr) {
case '<':
ctx->ptr++;
return tLSHIFT;
case '=':
ctx->ptr++;
return tLEQ;
default:
return '<';
}
case '>':
switch(*++ctx->ptr) {
case '>':
if(*++ctx->ptr == '>') {
ctx->ptr++;
return tRRSHIFT;
}
return tRSHIFT;
case '=':
ctx->ptr++;
return tGEQ;
default:
return '>';
}
case '|':
if(*++ctx->ptr == '|') {
ctx->ptr++;
return tOR;
}
return '|';
case '&':
if(*++ctx->ptr == '&') {
ctx->ptr++;
return tAND;
}
return '&';
}
WARN("Failed to interpret %s\n", debugstr_w(ctx->ptr));
...
...
@@ -94,13 +147,67 @@ CCExpr
CCUnaryExpression
: tCCValue { $$ = $1; }
| '(' CC
Equality
Expression ')'
{ $$ = $2; }
| '(' CC
LogicalOR
Expression ')' { $$ = $2; }
| '!' CCUnaryExpression { $$ = ccval_bool(!get_ccbool($2)); };
| '~' CCUnaryExpression { FIXME("'~' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| '+' CCUnaryExpression { FIXME("'+' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| '-' CCUnaryExpression { FIXME("'-' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCLogicalORExpression
: CCLogicalANDExpression { $$ = $1; }
| CCLogicalORExpression tOR CCLogicalANDExpression
{ FIXME("'||' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCLogicalANDExpression
: CCBitwiseORExpression { $$ = $1; }
| CCBitwiseANDExpression tAND CCBitwiseORExpression
{ FIXME("'&&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCBitwiseORExpression
: CCBitwiseXORExpression { $$ = $1; }
| CCBitwiseORExpression '|' CCBitwiseXORExpression
{ FIXME("'|' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCBitwiseXORExpression
: CCBitwiseANDExpression { $$ = $1; }
| CCBitwiseXORExpression '^' CCBitwiseANDExpression
{ FIXME("'^' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCBitwiseANDExpression
: CCEqualityExpression { $$ = $1; }
| CCBitwiseANDExpression '&' CCEqualityExpression
{ FIXME("'&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCEqualityExpression
: CCAdditiveExpression { $$ = $1; }
| CCEqualityExpression tNEQ CCAdditiveExpression
: CCRelationalExpression { $$ = $1; }
| CCEqualityExpression tEQ CCRelationalExpression
{ FIXME("'==' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCEqualityExpression tNEQ CCRelationalExpression
{ $$ = ccval_bool(get_ccnum($1) != get_ccnum($3)); }
| CCEqualityExpression tEQEQ CCRelationalExpression
{ FIXME("'===' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCEqualityExpression tNEQEQ CCRelationalExpression
{ FIXME("'!==' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCRelationalExpression
: CCShiftExpression { $$ = $1; }
| CCRelationalExpression '<' CCShiftExpression
{ FIXME("'<' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCRelationalExpression tLEQ CCShiftExpression
{ FIXME("'<=' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCRelationalExpression '>' CCShiftExpression
{ FIXME("'>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCRelationalExpression tGEQ CCShiftExpression
{ FIXME("'>=' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCShiftExpression
: CCAdditiveExpression { $$ = $1; }
| CCShiftExpression tLSHIFT CCAdditiveExpression
{ FIXME("'<<' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCShiftExpression tRSHIFT CCAdditiveExpression
{ FIXME("'>>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
| CCShiftExpression tRRSHIFT CCAdditiveExpression
{ FIXME("'>>>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
CCAdditiveExpression
: CCMultiplicativeExpression { $$ = $1; }
...
...
@@ -115,6 +222,8 @@ CCMultiplicativeExpression
{ $$ = ccval_num(get_ccnum($1) * get_ccnum($3)); }
| CCMultiplicativeExpression '/' CCUnaryExpression
{ $$ = ccval_num(get_ccnum($1) / get_ccnum($3)); }
| CCMultiplicativeExpression '%' CCUnaryExpression
{ FIXME("'%%' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
%%
...
...
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