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
a0f03896
Commit
a0f03896
authored
Oct 02, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added parser rules for missing expressions.
parent
f41ac94e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
7 deletions
+116
-7
cc_parser.y
dlls/jscript/cc_parser.y
+116
-7
No files found.
dlls/jscript/cc_parser.y
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
EqualityExpression ')'
{ $$ = $2; }
| '(' CC
LogicalORExpression ')'
{ $$ = $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; }
%%
...
...
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