Jacek Caban : vbscript: Added exp expression parser/compiler implementation .

Alexandre Julliard julliard at winehq.org
Tue Sep 13 12:18:10 CDT 2011


Module: wine
Branch: master
Commit: b5d8554f1ef1bc186033a7d1ef783cc66675dee7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b5d8554f1ef1bc186033a7d1ef783cc66675dee7

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Sep 13 11:41:15 2011 +0200

vbscript: Added exp expression parser/compiler implementation.

---

 dlls/vbscript/compile.c  |    2 ++
 dlls/vbscript/interp.c   |    6 ++++++
 dlls/vbscript/parse.h    |    1 +
 dlls/vbscript/parser.y   |    3 ++-
 dlls/vbscript/vbscript.h |    1 +
 5 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index d14e8de..d39b94e 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -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;
     case EXPR_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:
         return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_idiv);
     case EXPR_MEMBER:
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index 7a5be72..6cf50b9 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -738,6 +738,12 @@ static HRESULT interp_mul(exec_ctx_t *ctx)
     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)
 {
     variant_val_t val;
diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h
index e15a851..cfeb8c0 100644
--- a/dlls/vbscript/parse.h
+++ b/dlls/vbscript/parse.h
@@ -24,6 +24,7 @@ typedef enum {
     EXPR_DOUBLE,
     EXPR_EMPTY,
     EXPR_EQUAL,
+    EXPR_EXP,
     EXPR_IDIV,
     EXPR_MEMBER,
     EXPR_MOD,
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index 7d574d1..c9f9c76 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -210,7 +210,8 @@ MultiplicativeExpression
                                                 { $$ = new_binary_expression(ctx, EXPR_DIV, $1, $3); CHECK_ERROR; }
 
 ExpExpression
-    : UnaryExpression /* FIXME */   { $$ = $1; }
+    : UnaryExpression                           { $$ = $1; }
+    | ExpExpression '^' UnaryExpression         { $$ = new_binary_expression(ctx, EXPR_EXP, $1, $3); CHECK_ERROR; }
 
 UnaryExpression
     : LiteralExpression             { $$ = $1; }
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 690cad3..afa9d83 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -107,6 +107,7 @@ typedef enum {
     X(double,         1, ARG_DOUBLE,  0)          \
     X(empty,          1, 0,           0)          \
     X(equal,          1, 0,           0)          \
+    X(exp,            1, 0,           0)          \
     X(icall,          1, ARG_BSTR,    ARG_UINT)   \
     X(icallv,         1, ARG_BSTR,    ARG_UINT)   \
     X(idiv,           1, 0,           0)          \




More information about the wine-cvs mailing list