===================================================================
RCS file: /home/cvs/OpenXM/src/OpenMath/OM2OXM.java,v
retrieving revision 1.21
retrieving revision 1.26
diff -u -p -r1.21 -r1.26
--- OpenXM/src/OpenMath/OM2OXM.java 2000/03/14 05:10:37 1.21
+++ OpenXM/src/OpenMath/OM2OXM.java 2000/10/11 08:32:13 1.26
@@ -1,6 +1,8 @@
+/*
+ * $OpenXM: OpenXM/src/OpenMath/OM2OXM.java,v 1.25 2000/09/13 06:44:55 tam Exp $
+ */
+
/**
- * $OpenXM: OpenXM/src/OpenMath/OM2OXM.java,v 1.20 2000/03/14 05:02:34 tam Exp $
- *
* このクラスでは以下の BNF で表される構文解析を実装している
* expr -> stag [expr | immediate]* etag
* immediate -> INTEGER
@@ -31,7 +33,7 @@
import java.io.*;
import java.net.*;
import java.util.Vector;
-import JP.ac.kobe_u.math.tam.OpenXM.*;
+import ORG.openxm.tam.*;
final class OM2OXM implements Runnable{
private PushbackInputStream is;
@@ -52,19 +54,12 @@ final class OM2OXM implements Runnable{
//サーバ側から送信された文字列を受信します。
try{
while(true){
- CMO tmp;
+ OXmessage message = asir.receive();
- switch(asir.receiveOXtag()){
- case OpenXM.OX_COMMAND:
- asir.receiveSM();
+ if(message.getTag() == OXmessage.OX_DATA){
+ System.err.println("=> "+ CMO2OM((CMO)message.getBody()));
break;
-
- case OpenXM.OX_DATA:
- tmp = asir.receiveCMO();
- System.out.println("=> "+ CMO2OM(tmp));
- break;
}
-
}
}catch(IOException e){}
}
@@ -83,7 +78,7 @@ final class OM2OXM implements Runnable{
case CMO.INT32:
return ""+ ((CMO_INT32)cmo).intValue() +"";
- // case CMO.CMO_DATUM:
+ // case CMO.DATUM:
case CMO.STRING:
return ""+ ((CMO_STRING)cmo).getString() +"";
@@ -100,7 +95,7 @@ final class OM2OXM implements Runnable{
ret += "";
return ret;
- case CMO.CMO_MONOMIAL32:
+ case CMO.MONOMIAL32:
ret += "";
ret += CMO2OM_sub(((CMO_MONOMIAL32)cmo).getCoefficient());
for(int i=0;i<((CMO_MONOMIAL32)cmo).getDegree().length;i++){
@@ -109,29 +104,29 @@ final class OM2OXM implements Runnable{
ret += "";
return ret;
- case CMO.CMO_ZZ:
+ case CMO.ZZ:
return ""+ ((CMO_ZZ)cmo).BigIntValue() +"";
- case CMO.CMO_QQ:
+ case CMO.QQ:
return ""+
CMO2OM_sub(((CMO_QQ)cmo).getBunshi())+
CMO2OM_sub(((CMO_QQ)cmo).getBunbo())+
"";
- case CMO.CMO_ZERO:
+ case CMO.ZERO:
return " 0 ";
- // case CMO.CMO_DMS:
+ // case CMO.DMS:
- case CMO.CMO_DMS_GENERIC:
+ case CMO.DMS_GENERIC:
ret += "";
ret += "2";
return ret;
- case CMO.CMO_RECURSIVE_POLYNOMIAL:
+ case CMO.RECURSIVE_POLYNOMIAL:
return CMO2OM_CoefficientOfRecursivePOLYNOMIAL(((CMO_RECURSIVE_POLYNOMIAL)cmo).getPolynomial(),((CMO_RECURSIVE_POLYNOMIAL)cmo).getVariables());
- case CMO.CMO_DISTRIBUTED_POLYNOMIAL:
+ case CMO.DISTRIBUTED_POLYNOMIAL:
ret += "";
ret += CMO2OM_sub(((CMO_DISTRIBUTED_POLYNOMIAL)cmo).getRing());
ret += "";
@@ -144,7 +139,7 @@ final class OM2OXM implements Runnable{
//case CMO.POLYNOMIAL_IN_ONE_VARIABLE:
- case CMO.CMO_BIGFLOAT:
+ case CMO.BIGFLOAT:
ret += "";
ret += CMO2OM_sub(((CMO_BIGFLOAT)cmo).getSyosubu());
ret += "";
@@ -153,10 +148,10 @@ final class OM2OXM implements Runnable{
ret += "";
return ret;
- case CMO.CMO_INDETERMINATE:
+ case CMO.INDETERMINATE:
return "";
- case CMO.CMO_TREE:
+ case CMO.TREE:
ret += "";
for(int i=0;i<((CMO_TREE)cmo).getLeaves().getElements().length;i++){
@@ -757,7 +752,7 @@ final class OM2OXM implements Runnable{
for(int i=0;i