version 1.4, 2000/11/08 08:02:52 |
version 1.6, 2001/08/20 09:03:27 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/arith.c,v 1.3 2000/08/22 05:04:25 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/arith.c,v 1.5 2000/12/11 09:28:03 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 83 struct oAFUNC afunc[] = { |
|
Line 83 struct oAFUNC afunc[] = { |
|
/* O_F=14 */ {notdef,notdef,notdef,notdef,notdef,notdef,(int(*)())notdef}, |
/* O_F=14 */ {notdef,notdef,notdef,notdef,notdef,notdef,(int(*)())notdef}, |
/* O_GFMMAT=15 */ {notdef,notdef,notdef,notdef,notdef,notdef,(int(*)())notdef}, |
/* O_GFMMAT=15 */ {notdef,notdef,notdef,notdef,notdef,notdef,(int(*)())notdef}, |
/* O_BYTEARRAY=16 */ {notdef,notdef,notdef,notdef,notdef,notdef,compbytearray}, |
/* O_BYTEARRAY=16 */ {notdef,notdef,notdef,notdef,notdef,notdef,compbytearray}, |
|
/* O_QUOTE=17 */ {addquote,subquote,mulquote,divquote,pwrquote,chsgnquote,(int(*)())notdef}, |
}; |
}; |
|
|
void arf_init() { |
void arf_init() { |
|
|
|
|
if ( !a ) |
if ( !a ) |
*r = 0; |
*r = 0; |
|
else if ( OID(a) == O_QUOTE ) |
|
(*(afunc[O_QUOTE].pwr))(vl,a,e,r); |
else if ( !e ) |
else if ( !e ) |
*r = (pointer)ONE; |
*r = (pointer)ONE; |
else if ( (OID(e) <= O_N) && INT(e) ) { |
else if ( (OID(e) <= O_N) && INT(e) ) { |
|
|
return -1; |
return -1; |
else if ( !b ) |
else if ( !b ) |
return 1; |
return 1; |
for ( i = 0, an = BDY(a); an; i++, an = NEXT(an) ); |
for ( an = BDY(a), bn = BDY(b); an && bn; an = NEXT(an), bn = NEXT(bn) ); |
for ( an = BDY(b); an; i--, an = NEXT(an) ); |
if ( an && !bn ) |
if ( i ) |
return 1; |
return i > 0 ? 1 : -1; |
else if ( !an && bn ) |
|
return -1; |
for ( an = BDY(a), bn = BDY(b); an; an = NEXT(an), bn = NEXT(bn) ) |
for ( an = BDY(a), bn = BDY(b); an; an = NEXT(an), bn = NEXT(bn) ) |
if ( t = arf_comp(vl,BDY(an),BDY(bn)) ) |
if ( t = arf_comp(vl,BDY(an),BDY(bn)) ) |
return t; |
return t; |