#include #include #include #include #define MAX_SYMB 1000 typedef struct { char name[64]; char *value; } stentry; typedef stentry symboltable[MAX_SYMB]; void rmws ( char *line ) { int i, j; i = j = 0; do { if ((line[i] != ' ') && (line[i] != '\t') && (line[i] != '\n')) { line[j] = line[i]; ++j; } ++i; } while (line[j]); } int validname ( char *str ) { if ( ((*str >= 'a') && (*str <= 'z')) || ((*str >= 'A') && (*str <= 'Z')) || (*str == '_') ) ++str; else return 0; while (*str) { if ( ((*str >= 'a') && (*str <= 'z')) || ((*str >= 'A') && (*str <= 'Z')) || ((*str >= '0') && (*str <= '9')) || (*str == '_') ) ++str; else return 0; } return 1; } int STlookup ( char *name, symboltable ST, int nsymb ) { int i; for (i=0; i "); fgets(line, 8192, stdin); line[strlen(line) - 1] = '\0'; nsymb = procline(line,ST,nsymb); } exit(0); }