GLSL fixes:
[mesa.git] / src / mesa / shader / slang / slang_compile_operation.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.5
4 *
5 * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 #if !defined SLANG_COMPILE_OPERATION_H
26 #define SLANG_COMPILE_OPERATION_H
27
28 #if defined __cplusplus
29 extern "C" {
30 #endif
31
32 typedef enum slang_operation_type_
33 {
34 slang_oper_none,
35 slang_oper_block_no_new_scope,
36 slang_oper_block_new_scope,
37 slang_oper_variable_decl,
38 slang_oper_asm,
39 slang_oper_break,
40 slang_oper_continue,
41 slang_oper_discard,
42 slang_oper_return,
43 slang_oper_expression,
44 slang_oper_if,
45 slang_oper_while,
46 slang_oper_do,
47 slang_oper_for,
48 slang_oper_void,
49 slang_oper_literal_bool,
50 slang_oper_literal_int,
51 slang_oper_literal_float,
52 slang_oper_identifier,
53 slang_oper_sequence,
54 slang_oper_assign,
55 slang_oper_addassign,
56 slang_oper_subassign,
57 slang_oper_mulassign,
58 slang_oper_divassign,
59 /*slang_oper_modassign,*/
60 /*slang_oper_lshassign,*/
61 /*slang_oper_rshassign,*/
62 /*slang_oper_orassign,*/
63 /*slang_oper_xorassign,*/
64 /*slang_oper_andassign,*/
65 slang_oper_select,
66 slang_oper_logicalor,
67 slang_oper_logicalxor,
68 slang_oper_logicaland,
69 /*slang_oper_bitor,*/
70 /*slang_oper_bitxor,*/
71 /*slang_oper_bitand,*/
72 slang_oper_equal,
73 slang_oper_notequal,
74 slang_oper_less,
75 slang_oper_greater,
76 slang_oper_lessequal,
77 slang_oper_greaterequal,
78 /*slang_oper_lshift,*/
79 /*slang_oper_rshift,*/
80 slang_oper_add,
81 slang_oper_subtract,
82 slang_oper_multiply,
83 slang_oper_divide,
84 /*slang_oper_modulus,*/
85 slang_oper_preincrement,
86 slang_oper_predecrement,
87 slang_oper_plus,
88 slang_oper_minus,
89 /*slang_oper_complement,*/
90 slang_oper_not,
91 slang_oper_subscript,
92 slang_oper_call,
93 slang_oper_field,
94 slang_oper_postincrement,
95 slang_oper_postdecrement
96 } slang_operation_type;
97
98 typedef struct slang_operation_
99 {
100 slang_operation_type type;
101 struct slang_operation_ *children;
102 unsigned int num_children;
103 float literal; /* type: bool, literal_int, literal_float */
104 slang_atom a_id; /* type: asm, identifier, call, field */
105 slang_variable_scope *locals;
106 } slang_operation;
107
108 int slang_operation_construct (slang_operation *);
109 void slang_operation_destruct (slang_operation *);
110 int slang_operation_copy (slang_operation *, const slang_operation *);
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif
117