From: Dan McCabe Date: Mon, 7 Nov 2011 23:09:40 +0000 (-0800) Subject: glsl: Create AST structs corresponding to new productions in grammar X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0afcc67196baa588ec0ac246be6c4996a328f0b;p=mesa.git glsl: Create AST structs corresponding to new productions in grammar Previously we added productions for: switch_body case_label_list case_statement case_statement_list Now add AST structs corresponding to those productions. Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 208ffc4197a..d899bc62a81 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -642,6 +642,65 @@ public: }; +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,