=================================================================== RCS file: /home/cvs/OpenXM/src/OpenMath/OM2OXM.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -p -r1.1.1.1 -r1.2 --- OpenXM/src/OpenMath/OM2OXM.java 1999/11/02 11:52:34 1.1.1.1 +++ OpenXM/src/OpenMath/OM2OXM.java 1999/11/04 19:36:41 1.2 @@ -1,5 +1,5 @@ /** - * OM2OXM.java + * $OpenXM$ * * このクラスでは以下の BNF で表される構文解析を実装している * expr -> stag [expr | immediate]* etag @@ -62,7 +62,7 @@ final class OM2OXM implements Runnable{ case OpenXM.OX_DATA: tmp = asir.receiveCMO(); - System.out.println("=> "+ CMO2OM(tmp) +""); + System.out.println("=> "+ CMO2OM(tmp)); break; } @@ -71,6 +71,10 @@ final class OM2OXM implements Runnable{ } public static String CMO2OM(CMO cmo){ + return ""+ CMO2OM_sub(cmo) +""; + } + + private static String CMO2OM_sub(CMO cmo){ String ret = ""; switch(cmo.getDISCRIMINATOR()){ @@ -89,7 +93,7 @@ final class OM2OXM implements Runnable{ case CMO.CMO_MONOMIAL32: ret += ""; - ret += CMO2OM(((CMO_MONOMIAL32)cmo).getCoefficient()); + ret += CMO2OM_sub(((CMO_MONOMIAL32)cmo).getCoefficient()); for(int i=0;i<((CMO_MONOMIAL32)cmo).getDegree().length;i++){ ret += ""+ ((CMO_MONOMIAL32)cmo).getDegree()[i] +""; } @@ -101,8 +105,9 @@ final class OM2OXM implements Runnable{ case CMO.CMO_QQ: return ""+ - CMO2OM(((CMO_QQ)cmo).getBunshi()) + CMO2OM(((CMO_QQ)cmo).getBunbo()) - +""; + CMO2OM_sub(((CMO_QQ)cmo).getBunshi())+ + CMO2OM_sub(((CMO_QQ)cmo).getBunbo())+ + ""; case CMO.CMO_ZERO: return " 0 "; @@ -116,10 +121,11 @@ final class OM2OXM implements Runnable{ case CMO.CMO_DISTRIBUTED_POLYNOMIAL: ret += ""; - ret += CMO2OM(((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getRing()); + ret += CMO2OM_sub(((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getRing()); ret += ""; - for(int i=0;i<((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getMonomials().length;i++){ - ret += CMO2OM(((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getMonomials()[i]); + for(int i=0;i<((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getMonomials().length; + i++){ + ret += CMO2OM_sub(((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getMonomials()[i]); } ret += ""; return ret;