d3dcompiler: Stub assignment parsing.

This commit is contained in:
Matteo Bruni 2012-07-20 16:37:40 +02:00 committed by Alexandre Julliard
parent fbb7e20ffd
commit 6ccbccbb29
2 changed files with 66 additions and 0 deletions

View File

@ -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;

View File

@ -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
{