version 1.13, 2001/10/09 01:36:20 |
version 1.17, 2004/02/09 08:23:30 |
|
|
* OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY |
* OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY |
* 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/io/cpexpr.c,v 1.12 2001/09/03 07:01:08 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/io/cpexpr.c,v 1.16 2003/12/25 02:40:24 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#include "al.h" |
#include "al.h" |
#include "base.h" |
#include "base.h" |
|
#if PARI |
|
#include "genpari.h" |
|
#endif |
|
|
extern int hex_output,fortran_output,double_output,real_digit; |
extern int hex_output,fortran_output,double_output,real_digit; |
|
|
Line 78 extern int hex_output,fortran_output,double_output,rea |
|
Line 81 extern int hex_output,fortran_output,double_output,rea |
|
#define PRINTGFMMAT length_gfmmat |
#define PRINTGFMMAT length_gfmmat |
#define PRINTBYTEARRAY length_bytearray |
#define PRINTBYTEARRAY length_bytearray |
#define PRINTQUOTE length_QUOTE |
#define PRINTQUOTE length_QUOTE |
|
#define PRINTSYMBOL length_SYMBOL |
|
#define PRINTRANGE length_RANGE |
#define PRINTERR length_err |
#define PRINTERR length_err |
#define PRINTLF length_lf |
#define PRINTLF length_lf |
#define PRINTLOP length_lop |
#define PRINTLOP length_lop |
Line 105 void PRINTGF2MAT(); |
|
Line 110 void PRINTGF2MAT(); |
|
void PRINTGFMMAT(); |
void PRINTGFMMAT(); |
void PRINTBYTEARRAY(); |
void PRINTBYTEARRAY(); |
void PRINTQUOTE(); |
void PRINTQUOTE(); |
|
void PRINTSYMBOL(); |
|
void PRINTRANGE(); |
void PRINTERR(); |
void PRINTERR(); |
void PRINTCPLX(); |
void PRINTCPLX(); |
void PRINTLM(); |
void PRINTLM(); |
Line 127 int estimate_length(VL vl,pointer p) |
|
Line 134 int estimate_length(VL vl,pointer p) |
|
return total_length; |
return total_length; |
} |
} |
|
|
#if PARI |
#if defined(PARI) |
void PRINTBF(BF a) |
void PRINTBF(BF a) |
{ |
{ |
char *str; |
char *str; |
char *GENtostr(); |
|
char *GENtostr0(); |
char *GENtostr0(); |
void myoutbrute(); |
void myoutbrute(); |
|
|
Line 187 void PRINTEXPR(VL vl,pointer p) |
|
Line 193 void PRINTEXPR(VL vl,pointer p) |
|
PRINTBYTEARRAY(vl,(BYTEARRAY)p); break; |
PRINTBYTEARRAY(vl,(BYTEARRAY)p); break; |
case O_QUOTE: |
case O_QUOTE: |
PRINTQUOTE(vl,(QUOTE)p); break; |
PRINTQUOTE(vl,(QUOTE)p); break; |
|
case O_SYMBOL: |
|
PRINTSYMBOL((SYMBOL)p); break; |
|
case O_RANGE: |
|
PRINTRANGE(vl,(RANGE)p); break; |
default: |
default: |
break; |
break; |
} |
} |
Line 228 void PRINTNUM(Num q) |
|
Line 238 void PRINTNUM(Num q) |
|
case N_A: |
case N_A: |
PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); |
PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); |
break; |
break; |
#if PARI |
#if defined(PARI) |
case N_B: |
case N_B: |
PRINTBF((BF)q); break; |
PRINTBF((BF)q); break; |
#endif |
#endif |
Line 338 void PRINTV(VL vl,V v) |
|
Line 348 void PRINTV(VL vl,V v) |
|
else if ( (vid)v->attr == V_PF ) { |
else if ( (vid)v->attr == V_PF ) { |
pf = ((PFINS)v->priv)->pf; ad = ((PFINS)v->priv)->ad; |
pf = ((PFINS)v->priv)->pf; ad = ((PFINS)v->priv)->ad; |
if ( !strcmp(NAME(pf),"pow") ) { |
if ( !strcmp(NAME(pf),"pow") ) { |
PUTS("("); PRINTR(vl,(R)ad[0].arg); PUTS(")"); PRINTHAT; PUTS("("); |
PUTS("(("); PRINTR(vl,(R)ad[0].arg); PUTS(")"); PRINTHAT; PUTS("("); |
PRINTR(vl,(R)ad[1].arg); PUTS(")"); |
PRINTR(vl,(R)ad[1].arg); PUTS("))"); |
} else if ( !pf->argc ) |
} else if ( !pf->argc ) |
PUTS(NAME(pf)); |
PUTS(NAME(pf)); |
else { |
else { |
Line 537 void PRINTQUOTE(VL vl,QUOTE quote) |
|
Line 547 void PRINTQUOTE(VL vl,QUOTE quote) |
|
{ |
{ |
/* <...quoted...> */ |
/* <...quoted...> */ |
total_length += 20; |
total_length += 20; |
|
} |
|
|
|
void PRINTSYMBOL(SYMBOL sym) |
|
{ |
|
total_length += strlen(sym->name); |
|
} |
|
|
|
void PRINTRANGE(VL vl,RANGE r) |
|
{ |
|
PUTS("range("); PRINTEXPR(vl,r->start); |
|
PUTS(","); PRINTEXPR(vl,r->end); PUTS(")"); |
} |
} |
|
|
void PRINTERR(VL vl,ERR e) |
void PRINTERR(VL vl,ERR e) |