#ifndef SLANG_COMPILE_OPERATION_H
#define SLANG_COMPILE_OPERATION_H
-#if defined __cplusplus
-extern "C" {
-#endif
-
/**
* Types of slang operations.
SLANG_OPER_CONTINUE, /* "continue" statement */
SLANG_OPER_DISCARD, /* "discard" (kill fragment) statement */
SLANG_OPER_RETURN, /* "return" [expr] */
- SLANG_OPER_GOTO, /* jump to label */
SLANG_OPER_LABEL, /* a jump target */
SLANG_OPER_EXPRESSION, /* [expr] */
SLANG_OPER_IF, /* "if" [0] then [1] else [2] */
SLANG_OPER_NOTEQUAL, /* [expr] "!=" [expr] */
SLANG_OPER_LESS, /* [expr] "<" [expr] */
SLANG_OPER_GREATER, /* [expr] ">" [expr] */
- SLANG_OPER_LESSequal, /* [expr] "<=" [expr] */
- SLANG_OPER_GREATERequal, /* [expr] ">=" [expr] */
+ SLANG_OPER_LESSEQUAL, /* [expr] "<=" [expr] */
+ SLANG_OPER_GREATEREQUAL, /* [expr] ">=" [expr] */
/*SLANG_OPER_LSHIFT, */
/*SLANG_OPER_RSHIFT, */
SLANG_OPER_ADD, /* [expr] "+" [expr] */
SLANG_OPER_NOT, /* "!" [expr] */
SLANG_OPER_SUBSCRIPT, /* [expr] "[" [expr] "]" */
SLANG_OPER_CALL, /* [func name] [param] [param] [...] */
+ SLANG_OPER_NON_INLINED_CALL, /* a real function call */
SLANG_OPER_FIELD, /* i.e.: ".next" or ".xzy" or ".xxx" etc */
SLANG_OPER_POSTINCREMENT, /* [var] "++" */
SLANG_OPER_POSTDECREMENT /* [var] "--" */
slang_variable_scope *locals; /**< local vars for scope */
struct slang_function_ *fun; /**< If type == SLANG_OPER_CALL */
struct slang_variable_ *var; /**< If type == slang_oper_identier */
+ struct slang_label_ *label; /**< If type == SLANG_OPER_LABEL */
} slang_operation;
extern void
slang_operation_destruct(slang_operation *);
+extern void
+slang_replace_scope(slang_operation *oper,
+ slang_variable_scope *oldScope,
+ slang_variable_scope *newScope);
+
extern GLboolean
slang_operation_copy(slang_operation *, const slang_operation *);
slang_operation_insert(GLuint *numChildren, slang_operation **children,
GLuint pos);
+extern void
+_slang_operation_swap(slang_operation *oper0, slang_operation *oper1);
-#ifdef __cplusplus
-}
-#endif
#endif /* SLANG_COMPILE_OPERATION_H */