/* * Interface from browsers to parser. */ #include #include <../rsl/std-macros.h> extern FILE *yyin; extern int ANY_PARSE_ERROR; int bm_position = -1; /* position (in chars) of current symbol */ int bm_startpos,bm_endpos; int bm_lineNum; int byyparse() { return yyparse(); } bm_initinput(filename) char *filename; { bm_position = -1; InitLex(); InitSymtab(); InitSymtabAux(); InitTypechk(); InitErrors(); InitMainChkList(); ANY_PARSE_ERROR = false; if (! (yyin = fopen(filename, "r"))) { error("File %s not found\n", filename); } } bm_initline() {} bm_resetInput() { bm_lineNum = 0 ; bm_position = -1 ; bm_startpos = 0 ; bm_endpos = 0 ; } /* * Taken from misc.c. Make of browser in../hyperlinks cant include ./misc.o * since stralloc gets mult def'd. Hence, we leave stralloc in ./misc.c, but * stick in itoa here from misc.c. */ char *itoa(n) int n; { #define max 20 #define AsciiNum 0x30 int place = 10; int i; char* str; str = (char*)malloc(max * sizeof(char)); for (i = 1;i 0) { i = n % place; n /= place; str--; *str = i + AsciiNum; } return str; }