source: liacs/coco/assignment2/debug.c@ 199

Last change on this file since 199 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 598 bytes
Line 
1#include "debug.h"
2#include "types.h"
3
4extern int msglevel; /* the higher, the more messages... */
5
6void pmesg(int level, const char* format, ...) {
7 va_list args;
8
9 if (level <= msglevel) {
10 va_start(args, format);
11 vfprintf(stderr, format, args);
12 va_end(args);
13 }
14}
15
16void pmesg_node(int level, const Node& n)
17{
18 Node &node = const_cast<Node&>(n);
19 const char * const node_type_str = NodeTypeToString(node.GetNodeType());
20 const char * const return_type_str = ReturnTypeToString(node.GetReturnType());
21 pmesg(level, "Parser: Node: %s; Type: %s;\n", node_type_str, return_type_str);
22}
Note: See TracBrowser for help on using the repository browser.