1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
32 |
|
|
33 |
|
#define isdecimal(c) (isdigit(c) || (c) == '.') |
34 |
|
|
35 |
< |
extern double atof(), pow(); |
35 |
> |
#ifndef atof |
36 |
> |
extern double atof(); |
37 |
> |
#endif |
38 |
> |
extern double pow(); |
39 |
|
extern char *fgets(), *savestr(); |
40 |
|
extern char *emalloc(), *ecalloc(); |
41 |
|
extern EPNODE *curfunc; |
136 |
|
case VAR: |
137 |
|
varfree(epar->v.ln); |
138 |
|
break; |
136 |
– |
#endif |
139 |
|
|
140 |
|
case SYM: |
141 |
|
freestr(epar->v.name); |
142 |
|
break; |
143 |
+ |
#endif |
144 |
|
|
145 |
|
case NUM: |
146 |
|
case CHAN: |
437 |
|
} |
438 |
|
|
439 |
|
|
440 |
+ |
#if defined(VARIABLE) || defined(FUNCTION) |
441 |
|
char * |
442 |
|
getname() /* scan an identifier */ |
443 |
|
{ |
448 |
|
for (i = 0; i < MAXWORD && isid(lnext); i++, lnext = scan()) |
449 |
|
str[i] = lnext; |
450 |
|
str[i] = '\0'; |
451 |
+ |
while (isid(lnext)) /* skip rest of name */ |
452 |
+ |
lnext = scan(); |
453 |
|
|
454 |
|
return(str); |
455 |
|
} |
456 |
+ |
#endif |
457 |
|
|
458 |
|
|
459 |
|
int |
591 |
|
ep2->v.num = -ep2->v.num; |
592 |
|
return(ep2); |
593 |
|
} |
594 |
+ |
if (ep2->type == UMINUS) { /* don't generate -(-E5) */ |
595 |
+ |
efree((char *)ep2); |
596 |
+ |
return(ep2->v.kid); |
597 |
+ |
} |
598 |
|
ep1 = newnode(); |
599 |
|
ep1->type = UMINUS; |
600 |
|
addekid(ep1, ep2); |
638 |
|
#endif |
639 |
|
|
640 |
|
#if defined(VARIABLE) || defined(FUNCTION) |
641 |
< |
if (isalpha(nextc)) { |
641 |
> |
if (isalpha(nextc) || nextc == CNTXMARK) { |
642 |
|
nam = getname(); |
643 |
|
#if defined(VARIABLE) && defined(FUNCTION) |
644 |
|
ep1 = NULL; |
755 |
|
|
756 |
|
if (ep->type != VAR) |
757 |
|
return(0); |
758 |
< |
dp = ep->v.ln->def; |
759 |
< |
if (dp != NULL && dp->type != ':') |
760 |
< |
return(0); |
761 |
< |
if ((dp == NULL || dp->v.kid->type != FUNC) |
762 |
< |
&& ((lp = liblookup(ep->v.ln->name)) == NULL |
752 |
< |
|| lp->atyp != ':')) |
753 |
< |
return(0); |
754 |
< |
return(1); |
758 |
> |
if ((dp = ep->v.ln->def) != NULL && dp->v.kid->type == FUNC) |
759 |
> |
return(dp->type == ':'); |
760 |
> |
if ((lp = ep->v.ln->lib) != NULL) |
761 |
> |
return(lp->atyp == ':'); |
762 |
> |
return(0); |
763 |
|
} |
764 |
|
#endif |
765 |
|
#endif |