#include "jqplib.h" #include /* for malloc() */ #include /* for fprintf() */ #include /* for strlen() and strcpy() */ #include "bintree.h" /* $Id: jqplib.c,v 1.12 2005/09/04 14:14:56 joshr Exp $ */ /* By Josh Rabinowitz 2005 */ static char *progname = "jqp"; static struct bintree *gTree; int yyerror( char * s ) /* required by lexer */ { fprintf(stdout, "Parser: Error: %s\n", s); exit(1); return 0; /* K&P p240 doesn't mention a return value for the int */ } struct bintree *getTree() { return gTree; } void setTree(struct bintree *t) { gTree = t; } void debug (char *msg) { printf("lexer: %s: debug: %s\n", progname, msg); } void warning (char *s, char *t) { fprintf(stdout, "lexer: %s: %s", progname, s); if (t) fprintf(stdout, " %s", t); }