version 1.17, 1999/09/14 08:35:16 |
version 1.18, 1999/11/17 15:34:13 |
|
|
extern int optind; |
extern int optind; |
extern char *optarg; |
extern char *optarg; |
|
|
void macro(); |
static void macro __P((void)); |
void initkwds(); |
static void initkwds __P((void)); |
|
static ndptr inspect __P((char *)); |
|
static int do_look_ahead __P((int, const char *)); |
|
|
|
int main __P((int, char *[])); |
|
|
int |
int |
main(argc,argv) |
main(argc,argv) |
int argc; |
int argc; |
|
|
return 0; |
return 0; |
} |
} |
|
|
ndptr inspect(); |
|
|
|
/* |
/* |
* Look ahead (at most MAXCCHARS characters) for `token'. |
* Look ahead (at most MAXCCHARS characters) for `token'. |
* (on input `t == token[0]') |
* (on input `t == token[0]') |
|
|
* Returns 1 if `token' present; copied to output. |
* Returns 1 if `token' present; copied to output. |
* 0 if `token' not found; all characters pushed back |
* 0 if `token' not found; all characters pushed back |
*/ |
*/ |
int |
static int |
do_look_ahead(t, token) |
do_look_ahead(t, token) |
int t; |
int t; |
char *token; |
const char *token; |
{ |
{ |
int i; |
int i; |
|
|
|
|
/* |
/* |
* macro - the work horse.. |
* macro - the work horse.. |
*/ |
*/ |
void |
static void |
macro() |
macro() |
{ |
{ |
char token[MAXTOK], chars[2]; |
char token[MAXTOK], chars[2]; |
|
|
errx(1, "internal stack overflow"); |
errx(1, "internal stack overflow"); |
|
|
if (CALTYP == MACRTYPE) |
if (CALTYP == MACRTYPE) |
expand((char **) mstack+fp+1, sp-fp); |
expand((const char **) mstack+fp+1, sp-fp); |
else |
else |
eval((char **) mstack+fp+1, sp-fp, CALTYP); |
eval((const char **) mstack+fp+1, sp-fp, CALTYP); |
|
|
ep = PREVEP; /* flush strspace */ |
ep = PREVEP; /* flush strspace */ |
sp = PREVSP; /* previous sp.. */ |
sp = PREVSP; /* previous sp.. */ |
|
|
* consider only those starting with _ or A-Za-z. This is a |
* consider only those starting with _ or A-Za-z. This is a |
* combo with lookup to speed things up. |
* combo with lookup to speed things up. |
*/ |
*/ |
ndptr |
static ndptr |
inspect(tp) |
inspect(tp) |
char *tp; |
char *tp; |
{ |
{ |
|
|
* keyword strings, since we simply use the static pointers |
* keyword strings, since we simply use the static pointers |
* within keywrds block. |
* within keywrds block. |
*/ |
*/ |
void |
static void |
initkwds() |
initkwds() |
{ |
{ |
size_t i; |
size_t i; |