+/* -*- c++ -*- */
/*
* Copyright © 2009 Intel Corporation
*
*/
class ast_function_expression : public ast_expression {
public:
- ast_function_expression(ast_node *callee)
- : ast_expression(ast_function_call, (ast_expression *) callee,
- NULL, NULL)
+ ast_function_expression(ast_expression *callee)
+ : ast_expression(ast_function_call, callee,
+ NULL, NULL),
+ cons(false)
{
/* empty */
}
+ ast_function_expression(class ast_type_specifier *type)
+ : ast_expression(ast_function_call, (ast_expression *) type,
+ NULL, NULL),
+ cons(true)
+ {
+ /* empty */
+ }
+
+ bool is_constructor() const
+ {
+ return cons;
+ }
virtual ir_instruction *hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state);
+
+private:
+ /**
+ * Is this function call actually a constructor?
+ */
+ bool cons;
};
public:
ast_type_specifier(int specifier);
+ /** Construct a type specifier from a type name */
+ ast_type_specifier(const char *name)
+ : type_specifier(ast_type_name), type_name(name), structure(NULL),
+ is_array(false), array_size(NULL), precision(ast_precision_high)
+ {
+ /* empty */
+ }
+
+ /** Construct a type specifier from a structure definition */
+ ast_type_specifier(ast_struct_specifier *s)
+ : type_specifier(ast_struct), type_name(s->name), structure(s),
+ is_array(false), array_size(NULL), precision(ast_precision_high)
+ {
+ /* empty */
+ }
+
virtual void print(void) const;
enum ast_types type_specifier;
- char *type_name;
+ const char *type_name;
ast_struct_specifier *structure;
int is_array;
ast_jump_statement(int mode, ast_expression *return_value);
virtual void print(void) const;
+ virtual ir_instruction *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
enum ast_jump_modes {
ast_continue,
ast_break,