=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/pexpr_body.c,v retrieving revision 1.2 retrieving revision 1.8 diff -u -p -r1.2 -r1.8 --- OpenXM_contrib2/asir2000/io/pexpr_body.c 2004/03/26 08:25:36 1.2 +++ OpenXM_contrib2/asir2000/io/pexpr_body.c 2005/01/17 07:43:24 1.8 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.1 2004/03/17 03:22:47 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.7 2004/12/18 16:50:10 saito Exp $ */ #define PRINTHAT (fortran_output?PUTS("**"):PUTS("^")) @@ -11,6 +11,7 @@ void PRINTR(); void PRINTLIST(); void PRINTVECT(); void PRINTMAT(); +void PRINTIMAT(); /* IMAT */ void PRINTSTR(); void PRINTCOMP(); void PRINTDP(); @@ -19,6 +20,7 @@ void PRINTGF2MAT(); void PRINTGFMMAT(); void PRINTBYTEARRAY(); void PRINTQUOTE(); +void PRINTQUOTEARG(); void PRINTERR(); void PRINTCPLX(); void PRINTLM(); @@ -34,16 +36,15 @@ void PRINTSF(); void PRINTSYMBOL(); void PRINTRANGE(); void PRINTTB(); +void PRINTDPV(); void PRINTFNODE(); void PRINTBF(); +void PRINTDAlg(); void PRINTEXPR(vl,p) VL vl; Obj p; { -#if defined(FPRINT) - if ( asir_texmacs && !user_print_function ) printf("\2verbatim:"); -#endif if ( !p ) { PRINTR(vl,(R)p); } else @@ -60,6 +61,10 @@ Obj p; PRINTVECT(vl,(VECT)p); break; case O_MAT: PRINTMAT(vl,(MAT)p); break; +/* IMAT */ + case O_IMAT: + PRINTIMAT(vl,(IMAT)p); break; +/* IMAT */ case O_STR: PRINTSTR((STRING)p); break; case O_COMP: @@ -82,19 +87,19 @@ Obj p; PRINTBYTEARRAY(vl,(BYTEARRAY)p); break; case O_QUOTE: PRINTQUOTE(vl,(QUOTE)p); break; + case O_QUOTEARG: + PRINTQUOTEARG(vl,(QUOTEARG)p); break; case O_SYMBOL: PRINTSYMBOL((SYMBOL)p); break; case O_RANGE: PRINTRANGE(vl,(RANGE)p); break; case O_TB: PRINTTB(vl,(TB)p); break; + case O_DPV: + PRINTDPV(vl,(DPV)p); break; default: break; } -#if defined(FPRINT) - if ( asir_texmacs && !user_print_function ) - { putchar('\5'); fflush(stdout); } -#endif } #if defined(FPRINT) @@ -239,6 +244,21 @@ VECT vect; } } +void PRINTDPV(vl,d) +VL vl; +DPV d; +{ + int i; + DP *ptr; + + PUTS("modvect("); + for ( i = 0, ptr = BDY(d); i < d->len; i++ ) { + if ( i != 0 ) PUTS(","); + PRINTEXPR(vl,(Obj)ptr[i]); + } + PUTS(")"); +} + void PRINTMAT(vl,mat) VL vl; MAT mat; @@ -275,6 +295,49 @@ MAT mat; } } +/* IMAT */ +#if !defined(CPRINT) +void PRINTIMAT(vl,xmat) +VL vl; +IMAT xmat; +{ + int i,j,c; + int row, col, cr; + IMATC Im; + IENT ent; + + row = xmat->row; + col = xmat->col; + Im = (pointer)xmat->root; + if ( xmat->clen == 0 ) { + for(j = 0; j< row; j++) { + PUTS("( "); + for(i = 0; i < col; i++) PUTS("0 "); + PUTS(")"); + if ( j < row - 1 ) PUTS("\n"); + } + return; + } + c = -1; + GetNextIent(&Im, &ent, &c); + for(j = 0; j < row; j++) { + PUTS("( "); + for(i = 0; i < col; i++) { + cr = j * col + i; + if( ent.cr == cr ) { + PRINTEXPR(vl, (pointer)ent.body); PUTS(" "); + GetNextIent(&Im, &ent, &c); + } else { + PUTS("0 "); + } + } + PUTS(")"); + if ( j < row - 1 ) PUTS("\n"); + } +} +#endif +/* IMAT */ + void PRINTLIST(vl,list) VL vl; LIST list; @@ -579,6 +642,9 @@ void PRINTNUM(q) Num q; { char real_format[20]; + DAlg d; + DP nm; + Q dn; if ( !q ) { PUTS("0"); @@ -800,6 +866,19 @@ Num q; case N_GFSN: PRINTUM(BDY((GFSN)q)); break; + case N_DA: + d = (DAlg)q; + nm = d->nm; + dn = d->dn; + if ( SGN((Q)dn) == -1 ) PUTS("-"); + PUTS("("); + PRINTDP(CO,((DAlg)q)->nm); + PUTS(")"); + if ( !UNIN(NM(dn)) ) { + PUTS("/"); + PRINTN(NM(dn)); + } + break; } } @@ -978,6 +1057,13 @@ QUOTE quote; } else { PUTS("<...quoted...>"); } +} + +void PRINTQUOTEARG(vl,quote) +VL vl; +QUOTEARG quote; +{ + PUTS("<...quoted...>"); } void PRINTTB(VL vl,TB p)