version 1.24, 2000/01/11 14:06:11 |
version 1.25, 2000/01/11 14:10:01 |
|
|
|
|
static void macro __P((void)); |
static void macro __P((void)); |
static void initkwds __P((void)); |
static void initkwds __P((void)); |
static ndptr inspect __P((char *)); |
static ndptr inspect __P((char, char *)); |
static int do_look_ahead __P((int, const char *)); |
static int do_look_ahead __P((int, const char *)); |
|
|
int main __P((int, char *[])); |
int main __P((int, char *[])); |
|
|
cycle { |
cycle { |
t = gpbc(); |
t = gpbc(); |
if (t == '_' || isalpha(t)) { |
if (t == '_' || isalpha(t)) { |
putback(t); |
|
s = token; |
s = token; |
p = inspect(s); |
p = inspect(t, s); |
if (p != nil) |
if (p != nil) |
putback(l = gpbc()); |
putback(l = gpbc()); |
if (p == nil || (l != LPAREN && |
if (p == nil || (l != LPAREN && |
|
|
* combo with lookup to speed things up. |
* combo with lookup to speed things up. |
*/ |
*/ |
static ndptr |
static ndptr |
inspect(tp) |
inspect(c, tp) |
|
char c; |
char *tp; |
char *tp; |
{ |
{ |
char c; |
|
char *name = tp; |
char *name = tp; |
char *etp = tp+MAXTOK; |
char *etp = tp+MAXTOK; |
ndptr p; |
ndptr p; |
unsigned int h = 0; |
unsigned int h; |
|
|
|
h = *tp++ = c; |
|
|
while ((isalnum(c = gpbc()) || c == '_') && tp < etp) |
while ((isalnum(c = gpbc()) || c == '_') && tp < etp) |
h = (h << 5) + h + (*tp++ = c); |
h = (h << 5) + h + (*tp++ = c); |