#include "debug.h" #include "types.h" extern int msglevel; /* the higher, the more messages... */ void pmesg(int level, const char* format, ...) { va_list args; if (level <= msglevel) { va_start(args, format); vfprintf(stderr, format, args); va_end(args); } } void pmesg_node(int level, const Node& n) { Node &node = const_cast(n); const char * const node_type_str = NodeTypeToString(node.GetNodeType()); const char * const return_type_str = ReturnTypeToString(node.GetReturnType()); pmesg(level, "Parser: Node: %s; Type: %s;\n", node_type_str, return_type_str); }