Matteo Bruni : d3dcompiler: Stub assignment parsing.

Alexandre Julliard julliard at winehq.org
Fri Jul 20 15:29:59 CDT 2012


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri Jul 20 16:37:40 2012 +0200

d3dcompiler: Stub assignment parsing.

---

 dlls/d3dcompiler_43/d3dcompiler_private.h |   15 ++++++++
 dlls/d3dcompiler_43/hlsl.y                |   51 +++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h
index 769bf74..efba080 100644
--- a/dlls/d3dcompiler_43/d3dcompiler_private.h
+++ b/dlls/d3dcompiler_43/d3dcompiler_private.h
@@ -912,6 +912,21 @@ enum parse_unary_op
     UNARY_OP_BITNOT,
 };
 
+enum parse_assign_op
+{
+    ASSIGN_OP_ASSIGN,
+    ASSIGN_OP_ADD,
+    ASSIGN_OP_SUB,
+    ASSIGN_OP_MUL,
+    ASSIGN_OP_DIV,
+    ASSIGN_OP_MOD,
+    ASSIGN_OP_LSHIFT,
+    ASSIGN_OP_RSHIFT,
+    ASSIGN_OP_AND,
+    ASSIGN_OP_OR,
+    ASSIGN_OP_XOR,
+};
+
 struct hlsl_parse_ctx
 {
     const char **source_files;
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index 177330f..6184d6a 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -207,6 +207,7 @@ static unsigned int components_count_expr_list(struct list *list)
     struct parse_parameter parameter;
     struct parse_variable_def *variable_def;
     enum parse_unary_op unary_op;
+    enum parse_assign_op assign_op;
 }
 
 %token KW_BLENDSTATE
@@ -352,6 +353,7 @@ static unsigned int components_count_expr_list(struct list *list)
 %type <instr> assignment_expr
 %type <list> expr_statement
 %type <unary_op> unary_op
+%type <assign_op> assign_op
 %type <modifiers> input_mod
 %%
 
@@ -1209,6 +1211,55 @@ assignment_expr:          conditional_expr
                             {
                                 $$ = $1;
                             }
+                        | unary_expr assign_op assignment_expr
+                            {
+                                FIXME("Assignment\n");
+                            }
+
+assign_op:                '='
+                            {
+                                $$ = ASSIGN_OP_ASSIGN;
+                            }
+                        | OP_ADDASSIGN
+                            {
+                                $$ = ASSIGN_OP_ADD;
+                            }
+                        | OP_SUBASSIGN
+                            {
+                                $$ = ASSIGN_OP_SUB;
+                            }
+                        | OP_MULASSIGN
+                            {
+                                $$ = ASSIGN_OP_MUL;
+                            }
+                        | OP_DIVASSIGN
+                            {
+                                $$ = ASSIGN_OP_DIV;
+                            }
+                        | OP_MODASSIGN
+                            {
+                                $$ = ASSIGN_OP_MOD;
+                            }
+                        | OP_LEFTSHIFTASSIGN
+                            {
+                                $$ = ASSIGN_OP_LSHIFT;
+                            }
+                        | OP_RIGHTSHIFTASSIGN
+                            {
+                                $$ = ASSIGN_OP_RSHIFT;
+                            }
+                        | OP_ANDASSIGN
+                            {
+                                $$ = ASSIGN_OP_AND;
+                            }
+                        | OP_ORASSIGN
+                            {
+                                $$ = ASSIGN_OP_OR;
+                            }
+                        | OP_XORASSIGN
+                            {
+                                $$ = ASSIGN_OP_XOR;
+                            }
 
 expr:                     assignment_expr
                             {




More information about the wine-cvs mailing list