The lowest level
of feature provides a very light and direct encapsulation of the basic
OpenMath C library. Here is:
-
You can read OpenMath tokens through the OmInputDevice
class.
-
You can write OpenMath tokens through the OmOutputDevice
class.
-
You can use IO physical streams (files or strings) through the
OmStream
class, which is specialized in OmInputFileStream, OmInputStringStream,
OmOutputFileStream, OmOutputStringStream.
Remarks:
The OmInputDevice and OmOutputDevice
corresponds to the OMdev structure in the C library.
The
OmStream corresponds to the
OMIO structure in the
C library.
The high structured level
The highest level of feature provides a structured object model to define
and manipulate OpenMath objects as
tree nodes.
There are two kinds of nodes specialized from OmNode:
-
Leaves specialized from OmFinalNode which correspond to the basic
OpenMath objects with no children:
-> standard BigInteger,
ByteArray,
Float,
Integer,
PInstruction,
String,
WString,
Symbol,
Variable
-
Nodes which correspond to the compound OpenMath objects and can have children
(however some constraint rules may apply):
-> standard Application,
Binding,
Error
-> library specific Object,
Document
The OpenMath
attributions as defined in the Standard are provided
here as lists of attributes associated to
OmNode objects. Thus
there is no specific class to represent attributions, the user simply append/remove
attributes pairs (symbol,value) through the
OmNode interface.
To take comments into account, the (non perfect) choice has been
made to associate a list of comments to each OmNode object. By
convention, comments are considered to be located before the object
while parsing or printing OpenMath files. If this constraint of prefixing
is not respected, then some loss of comments may be observed. For critical
cases about perfect parsing of comments the low structured level may be
preferable.
There exists three main operations on OmNode objects:
-
You can read structured OpenMath objects by using the OmNode::resurrect
method.
-
You can write structured OpenMath objects by using the OmNode::hibernate
method.
-
You can collect comments by using the OmCommentCollector
class.
Note that