aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/ast.h')
-rw-r--r--mesalib/src/glsl/ast.h83
1 files changed, 79 insertions, 4 deletions
diff --git a/mesalib/src/glsl/ast.h b/mesalib/src/glsl/ast.h
index 9fe6c4125..d899bc62a 100644
--- a/mesalib/src/glsl/ast.h
+++ b/mesalib/src/glsl/ast.h
@@ -629,13 +629,78 @@ public:
class ast_case_label : public ast_node {
public:
+ ast_case_label(ast_expression *test_value);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
/**
- * An expression of NULL means 'default'.
+ * An test value of NULL means 'default'.
*/
- ast_expression *expression;
+ ast_expression *test_value;
+};
+
+
+class ast_case_label_list : public ast_node {
+public:
+ ast_case_label_list(void);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+ /**
+ * A list of case labels.
+ */
+ exec_list labels;
};
+
+class ast_case_statement : public ast_node {
+public:
+ ast_case_statement(ast_case_label_list *labels);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+ ast_case_label_list *labels;
+
+ /**
+ * A list of statements.
+ */
+ exec_list stmts;
+};
+
+
+class ast_case_statement_list : public ast_node {
+public:
+ ast_case_statement_list(void);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+ /**
+ * A list of cases.
+ */
+ exec_list cases;
+};
+
+
+class ast_switch_body : public ast_node {
+public:
+ ast_switch_body(ast_case_statement_list *stmts);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+ ast_case_statement_list *stmts;
+};
+
+
class ast_selection_statement : public ast_node {
public:
ast_selection_statement(ast_expression *condition,
@@ -654,8 +719,18 @@ public:
class ast_switch_statement : public ast_node {
public:
- ast_expression *expression;
- exec_list statements;
+ ast_switch_statement(ast_expression *test_expression,
+ ast_node *body);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+ ast_expression *test_expression;
+ ast_node *body;
+
+protected:
+ void test_to_hir(exec_list *, struct _mesa_glsl_parse_state *);
};
class ast_iteration_statement : public ast_node {