#define DEBUG 1
/* External Functions used */
extern int yyparse();
extern int column, line;
BString fileName;
TypeList gtypelist; // Ctypes list
Node* result;
static void print(FILE* file, int tab, const char* fmt, ...){
va_list ap;
va_start(ap, fmt);
while(tab--)
fprintf(file, " ");
vfprintf(file, fmt, ap);
}
void produceTree(Node* n, FILE* file, int tab){
BIter i;
print(file, tab, "%s %s {\n", Node::nodeTypeName(n->nodeType()).retStr(), n->name().retStr());
for(n->nodes().start(i); !n->nodes().isEnd(i); n->nodes().next(i)){
if(n->nodes()[i])
produceTree(n->nodes()[i], file, tab + 1);
else {
print(file, tab + 1, "Null none {\n");
print(file, tab + 1, "}\n");
}
}
print(file, tab, "}\n");
}
int usage(){
fprintf(stderr, "Usage: bidl [options] infile -o outfile\n");