struct YYLTYPE;
-#define _mesa_ast_print(n) \
- ((ast_node *) n)->print()
-
-#define _mesa_ast_to_hir(n, instr, s) \
- ((struct ast_node *) n)->vtbl->to_hir((struct ast_node *) n, instr, s)
-
-#define _mesa_ast_function_call_to_hir(n, p, s) \
- ((struct ast_node *) n)->vtbl->function_call_to_hir( \
- (struct ast_node *) n, \
- (struct ast_node *) p, \
- s)
-
class ast_node : public simple_node {
public:
virtual ~ast_node();
printf("{\n");
foreach(ptr, & statements) {
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
printf("}\n");
parameters->print();
foreach (ptr, (struct simple_node *) parameters) {
printf(", ");
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
}
if (ptr != head)
printf(", ");
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
printf(") ");
break;
printf(" %s (", identifier);
foreach(ptr, & parameters) {
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
printf(")");
if (ptr != head)
printf(", ");
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
printf("; ");
printf("struct %s { ", name);
foreach (ptr, & declarations) {
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
printf("} ");
}
_mesa_glsl_lexer_dtor(& state);
foreach (ptr, & state.translation_unit) {
- _mesa_ast_print(ptr);
+ ((ast_node *)ptr)->print();
}
#if 0