323 static uint32_t
id = 0;
324 uint32_t current_id = 0;
326 when_null(node, exit);
329 amxc_string_t expr_txt;
330 amxc_string_init(&expr_txt, 0);
331 amxc_string_setf(&expr_txt,
"%s", expr->
expression);
332 amxc_string_replace(&expr_txt,
"\"",
"\\\"", UINT32_MAX);
333 printf(
"digraph D {\n");
334 printf(
"graph [ordering=\"out\"];\n");
335 printf(
"label = \"%s\";\n", amxc_string_get(&expr_txt, 0));
336 printf(
"labelloc = \"t\";\n");
339 amxc_string_clean(&expr_txt);
346 printf(
"node_%d", current_id);
354 printf(
"[shape=\"box\" label=\"AND\"];\n");
359 printf(
"[shape=\"box\" label=\"OR\"];\n");
364 printf(
"[shape=\"box\" label=\"NOT\"];\n");
368 char* value = amxc_var_dyncast(cstring_t, node->
left.
value);
369 printf(
"[shape=\"record\" label=\"{VALUE|%s}\"];\n", value);
374 printf(
"[shape=\"record\" label=\"{VALUE FUNCTION|%s}\"];\n", node->
left.
func_name);
377 printf(
"[shape=\"record\" label=\"{BOOL FUNCTION|%s}\"];\n", node->
left.
func_name);
380 printf(
"[shape=\"record\" label=\"{FIELD|%s}\"];\n", node->
left.
field);
385 printf(
"node_%d -> node_%d;\n", parent_id, current_id);
static const char * amxp_expr_compop2string(amxp_expr_comp_t op)
void amxp_expr_node_dump(amxp_expr_t *expr, amxp_expr_node_t *node, uint32_t level, uint32_t parent_id)
union _amxp_expr_node::@0 left
amxp_expr_node_type_t type