version 1.4, 1997/07/21 23:18:45 |
version 1.5, 2000/07/25 19:28:30 |
|
|
* the above 3 cases are similar in that they |
* the above 3 cases are similar in that they |
* are special characters that also end tokens. |
* are special characters that also end tokens. |
*/ |
*/ |
endtok: if (sp > tok) { |
endtok: if (sp > tok) { |
*sp = EOS; |
*sp = EOS; |
token = YES; |
token = YES; |
sp = tok; |
sp = tok; |
|
|
sp = tok; |
sp = tok; |
} |
} |
else if (sp != tok || begtoken(c)) { |
else if (sp != tok || begtoken(c)) { |
*sp++ = c; |
if (sp >= tok + sizeof tok) { |
|
/* hell... truncate it */ |
|
if (sp == tok + sizeof(tok)) |
|
*sp = '\0'; |
|
sp++; |
|
} else |
|
*sp++ = c; |
token = YES; |
token = YES; |
} |
} |
continue; |
continue; |
|
|
return; |
return; |
if (iswhite(c)) |
if (iswhite(c)) |
break; |
break; |
*sp++ = c; |
if (sp >= tok + sizeof(tok)) { |
|
/* hell... truncate it */ |
|
if (sp == tok + sizeof(tok)) |
|
*sp = '\0'; |
|
sp++; |
|
} else |
|
*sp++ = c; |
} |
} |
*sp = EOS; |
*sp = EOS; |
if (memcmp(tok, "define", 6)) /* only interested in #define's */ |
if (memcmp(tok, "define", 6)) /* only interested in #define's */ |
|
|
break; |
break; |
} |
} |
for (sp = tok;;) { /* get next token */ |
for (sp = tok;;) { /* get next token */ |
*sp++ = c; |
if (sp >= tok + sizeof tok) { |
|
/* hell... truncate it */ |
|
if (sp == tok + sizeof(tok)) |
|
*sp = '\0'; |
|
sp++; |
|
} else |
|
*sp++ = c; |
if (GETC(==, EOF)) |
if (GETC(==, EOF)) |
return; |
return; |
/* |
/* |
|
|
if (c == '{') /* it was "struct {" */ |
if (c == '{') /* it was "struct {" */ |
return (YES); |
return (YES); |
for (sp = tok;;) { /* get next token */ |
for (sp = tok;;) { /* get next token */ |
*sp++ = c; |
if (sp >= tok + sizeof tok) { |
|
/* hell... truncate it */ |
|
if (sp == tok + sizeof(tok)) |
|
*sp = '\0'; |
|
sp++; |
|
} else |
|
*sp++ = c; |
if (GETC(==, EOF)) |
if (GETC(==, EOF)) |
return (NO); |
return (NO); |
if (!intoken(c)) |
if (!intoken(c)) |