vbscript: Added exp expression parser/compiler implementation.
This commit is contained in:
parent
9db2d7c352
commit
b5d8554f1e
|
@ -361,6 +361,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
|
||||||
return push_instr(ctx, OP_empty) != -1 ? S_OK : E_OUTOFMEMORY;
|
return push_instr(ctx, OP_empty) != -1 ? S_OK : E_OUTOFMEMORY;
|
||||||
case EXPR_EQUAL:
|
case EXPR_EQUAL:
|
||||||
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_equal);
|
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_equal);
|
||||||
|
case EXPR_EXP:
|
||||||
|
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_exp);
|
||||||
case EXPR_IDIV:
|
case EXPR_IDIV:
|
||||||
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_idiv);
|
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_idiv);
|
||||||
case EXPR_MEMBER:
|
case EXPR_MEMBER:
|
||||||
|
|
|
@ -738,6 +738,12 @@ static HRESULT interp_mul(exec_ctx_t *ctx)
|
||||||
return stack_push(ctx, &v);
|
return stack_push(ctx, &v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT interp_exp(exec_ctx_t *ctx)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT interp_neg(exec_ctx_t *ctx)
|
static HRESULT interp_neg(exec_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
variant_val_t val;
|
variant_val_t val;
|
||||||
|
|
|
@ -24,6 +24,7 @@ typedef enum {
|
||||||
EXPR_DOUBLE,
|
EXPR_DOUBLE,
|
||||||
EXPR_EMPTY,
|
EXPR_EMPTY,
|
||||||
EXPR_EQUAL,
|
EXPR_EQUAL,
|
||||||
|
EXPR_EXP,
|
||||||
EXPR_IDIV,
|
EXPR_IDIV,
|
||||||
EXPR_MEMBER,
|
EXPR_MEMBER,
|
||||||
EXPR_MOD,
|
EXPR_MOD,
|
||||||
|
|
|
@ -210,7 +210,8 @@ MultiplicativeExpression
|
||||||
{ $$ = new_binary_expression(ctx, EXPR_DIV, $1, $3); CHECK_ERROR; }
|
{ $$ = new_binary_expression(ctx, EXPR_DIV, $1, $3); CHECK_ERROR; }
|
||||||
|
|
||||||
ExpExpression
|
ExpExpression
|
||||||
: UnaryExpression /* FIXME */ { $$ = $1; }
|
: UnaryExpression { $$ = $1; }
|
||||||
|
| ExpExpression '^' UnaryExpression { $$ = new_binary_expression(ctx, EXPR_EXP, $1, $3); CHECK_ERROR; }
|
||||||
|
|
||||||
UnaryExpression
|
UnaryExpression
|
||||||
: LiteralExpression { $$ = $1; }
|
: LiteralExpression { $$ = $1; }
|
||||||
|
|
|
@ -107,6 +107,7 @@ typedef enum {
|
||||||
X(double, 1, ARG_DOUBLE, 0) \
|
X(double, 1, ARG_DOUBLE, 0) \
|
||||||
X(empty, 1, 0, 0) \
|
X(empty, 1, 0, 0) \
|
||||||
X(equal, 1, 0, 0) \
|
X(equal, 1, 0, 0) \
|
||||||
|
X(exp, 1, 0, 0) \
|
||||||
X(icall, 1, ARG_BSTR, ARG_UINT) \
|
X(icall, 1, ARG_BSTR, ARG_UINT) \
|
||||||
X(icallv, 1, ARG_BSTR, ARG_UINT) \
|
X(icallv, 1, ARG_BSTR, ARG_UINT) \
|
||||||
X(idiv, 1, 0, 0) \
|
X(idiv, 1, 0, 0) \
|
||||||
|
|
Loading…
Reference in New Issue