2 * Mesa 3-D graphics library
5 * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
25 #if !defined SLANG_COMPILE_OPERATION_H
26 #define SLANG_COMPILE_OPERATION_H
28 #if defined __cplusplus
32 typedef enum slang_operation_type_
35 slang_oper_block_no_new_scope
,
36 slang_oper_block_new_scope
,
37 slang_oper_variable_decl
,
43 slang_oper_expression
,
49 slang_oper_literal_bool
,
50 slang_oper_literal_int
,
51 slang_oper_literal_float
,
52 slang_oper_identifier
,
59 /*slang_oper_modassign,*/
60 /*slang_oper_lshassign,*/
61 /*slang_oper_rshassign,*/
62 /*slang_oper_orassign,*/
63 /*slang_oper_xorassign,*/
64 /*slang_oper_andassign,*/
67 slang_oper_logicalxor
,
68 slang_oper_logicaland
,
70 /*slang_oper_bitxor,*/
71 /*slang_oper_bitand,*/
77 slang_oper_greaterequal
,
78 /*slang_oper_lshift,*/
79 /*slang_oper_rshift,*/
84 /*slang_oper_modulus,*/
85 slang_oper_preincrement
,
86 slang_oper_predecrement
,
89 /*slang_oper_complement,*/
94 slang_oper_postincrement
,
95 slang_oper_postdecrement
96 } slang_operation_type
;
98 typedef struct slang_operation_
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
;
108 int slang_operation_construct (slang_operation
*);
109 void slang_operation_destruct (slang_operation
*);
110 int slang_operation_copy (slang_operation
*, const slang_operation
*);