version 1.6, 1999/11/14 22:57:44 |
version 1.8, 1999/11/15 23:13:21 |
|
|
/** |
/** |
* $OpenXM: OpenXM/src/OpenMath/OM2OXM.java,v 1.5 1999/11/12 11:36:09 tam Exp $ |
* $OpenXM: OpenXM/src/OpenMath/OM2OXM.java,v 1.7 1999/11/15 06:19:26 tam Exp $ |
* |
* |
* $B$3$N%/%i%9$G$O0J2<$N(B BNF $B$GI=$5$l$k9=J82r@O$r<BAu$7$F$$$k(B |
* $B$3$N%/%i%9$G$O0J2<$N(B BNF $B$GI=$5$l$k9=J82r@O$r<BAu$7$F$$$k(B |
* expr -> stag [expr | immediate]* etag |
* expr -> stag [expr | immediate]* etag |
Line 39 final class OM2OXM implements Runnable{ |
|
Line 39 final class OM2OXM implements Runnable{ |
|
private int token = TT_NULL; |
private int token = TT_NULL; |
private boolean lexPushbackFlag = false; |
private boolean lexPushbackFlag = false; |
private OpenXM asir; // for debug |
private OpenXM asir; // for debug |
private boolean debug = true; |
private boolean debug = false; |
|
|
// Token Type for lexical analyzer |
// Token Type for lexical analyzer |
final static int TT_NULL = 0; |
final static int TT_NULL = 0; |
Line 131 final class OM2OXM implements Runnable{ |
|
Line 131 final class OM2OXM implements Runnable{ |
|
ret += "</OMA></OMA>"; |
ret += "</OMA></OMA>"; |
return ret; |
return ret; |
|
|
|
case CMO.CMO_BIGFLOAT: |
|
ret += "<OMA><OMS name=\"times\" cd=\"basic\"/>"; |
|
ret += CMO2OM_sub(((CMO_BIGFLOAT)cmo).getSyosubu()); |
|
ret += "<OMA><OMS name=\"power\" cd=\"basic\"/>"; |
|
ret += "<OMI>2</OMI>"; |
|
ret += CMO2OM_sub(((CMO_BIGFLOAT)cmo).getShisubu()); |
|
ret += "</OMA></OMA>"; |
|
return ret; |
|
|
case CMO.CMO_INDETERMINATE: |
case CMO.CMO_INDETERMINATE: |
return "<OMV name=\""+ ((CMO_INDETERMINATE)cmo).getString() +"\"/>"; |
return "<OMV name=\""+ ((CMO_INDETERMINATE)cmo).getString() +"\"/>"; |
|
|
/* |
/* |
case CMO.CMO_TREE: |
case CMO.CMO_TREE: |
return "<OMA><OMS name=\""+ "\"/>"+ |
return "<OMA><OMS name=\""+ ((CMO_TREE)cmo).getName() +"\" cdname=\""+ |
"</OMA>"; |
((CMO_TREE)cmo).getCDName() +"\"/>" + "</OMA>"; |
*/ |
*/ |
|
|
default: |
default: |
Line 428 final class OM2OXM implements Runnable{ |
|
Line 437 final class OM2OXM implements Runnable{ |
|
return new CMO_MONOMIAL32(array,(CMO_ZZ)degree.elementAt(0)); |
return new CMO_MONOMIAL32(array,(CMO_ZZ)degree.elementAt(0)); |
} |
} |
|
|
private CMO parse_objects() throws IOException{ |
private CMO_LIST parse_objects() throws IOException{ |
// $B2r@O$5$l$?(B object $B$r(B LIST $B$GJV$9(B |
// $B2r@O$5$l$?(B object $B$r(B LIST $B$GJV$9(B |
Vector objects = new Vector(); |
Vector objects = new Vector(); |
CMO[] array; |
CMO[] array; |
Line 443 final class OM2OXM implements Runnable{ |
|
Line 452 final class OM2OXM implements Runnable{ |
|
array = new CMO[objects.size()]; |
array = new CMO[objects.size()]; |
objects.copyInto((Object[])array); |
objects.copyInto((Object[])array); |
|
|
System.out.println("debug :"+ new CMO_LIST(array)); |
debug("debug :"+ new CMO_LIST(array)); |
return new CMO_LIST(array); |
return new CMO_LIST(array); |
} |
} |
|
|