517 |
|
getE4() /* E4 -> ADDOP E5 */ |
518 |
|
/* E5 */ |
519 |
|
{ |
520 |
< |
register EPNODE *ep1; |
520 |
> |
register EPNODE *ep1, *ep2; |
521 |
|
|
522 |
|
if (nextc == '-') { |
523 |
|
scan(); |
524 |
< |
ep1 = newnode(); |
525 |
< |
#ifndef RCONST |
526 |
< |
if (isdecimal(nextc)) { |
527 |
< |
ep1->type = NUM; |
528 |
< |
ep1->v.num = -getnum(); |
529 |
< |
return(ep1); |
524 |
> |
ep2 = getE5(); |
525 |
> |
if (ep2->type == NUM) { |
526 |
> |
ep2->v.num = -ep2->v.num; |
527 |
> |
return(ep2); |
528 |
|
} |
529 |
< |
#endif |
529 |
> |
ep1 = newnode(); |
530 |
|
ep1->type = UMINUS; |
531 |
< |
addekid(ep1, getE5()); |
534 |
< |
#ifdef RCONST |
535 |
< |
if (ep1->v.kid->type == NUM) |
536 |
< |
ep1 = rconst(ep1); |
537 |
< |
#endif |
531 |
> |
addekid(ep1, ep2); |
532 |
|
return(ep1); |
533 |
|
} |
534 |
|
if (nextc == '+') |