=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/pexpr_body.c,v retrieving revision 1.5 retrieving revision 1.9 diff -u -p -r1.5 -r1.9 --- OpenXM_contrib2/asir2000/io/pexpr_body.c 2004/12/02 13:48:43 1.5 +++ OpenXM_contrib2/asir2000/io/pexpr_body.c 2005/09/28 08:08:34 1.9 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.4 2004/07/13 07:59:54 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.8 2005/01/17 07:43:24 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(); @@ -44,9 +45,6 @@ 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 @@ -63,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: @@ -98,10 +100,6 @@ Obj p; default: break; } -#if defined(FPRINT) - if ( asir_texmacs && !user_print_function ) - { putchar('\5'); fflush(stdout); } -#endif } #if defined(FPRINT) @@ -297,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; @@ -512,6 +553,14 @@ void PRINTFNODE(FNODE f,int paren) PRINTFNODE((FNODE)FA1(f),1); PUTS(((ARF)FA0(f))->name); PRINTFNODE((FNODE)FA2(f),1); + break; + case I_NARYOP: + t = (NODE)FA1(f); + PRINTFNODE((FNODE)BDY(t),1); + for ( t = NEXT(t); t; t = NEXT(t) ) { + PUTS(((ARF)FA0(f))->name); + PRINTFNODE((FNODE)BDY(t),1); + } break; case I_COP: switch( (cid)FA0(f) ) {