/* $Id: url_test.c,v 1.2 1994/03/16 20:03:38 connolly Exp $ */ #include #include #include #define SAFEFREE(x) if(x){ free(x); x = NULL; };; static char buffer[5000]; static int index; int main(int argc, char **argv) { char *there, *here; char *scheme, *hostport, *port, *path, *id; while(gets(buffer)){ /* skip blank lines, comments */ if(buffer[0] == '#' || buffer[0] == 0) continue; there = buffer; if(here = strchr(buffer, '\t')){ *here++ = 0; if(scheme = strchr(here, '\t')){ *scheme++ = 0; } } printf("\n***********\n"); printf("here: %s\n", here); printf("there: %s\n", there); index = 0; yyparse(); } return 0; } int lex_input() { return buffer[index++]; } int lex_unput(int c) { buffer[--index] = c; } yyerror() { printf("syntax error in URI\n"); }