All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface fr.inria.openmath.omapi.ParserHandler

public interface ParserHandler
Receives notification of OpenMath tokens events.

This is the main interface that most OpenMath applications implement: if the application needs to be informed of basic parsing events (token level), it implements this interface and registers an instance with the OpenMath parser using the setParserHandler method. The parser uses the instance to report basic parsing-related events like the start and end of elements or element contents.

The application can find the location of any event using the Locator interface supplied by the Parser through the setLocator method.

See Also:
pipeParserHandler;, debugParserHandler;, treeParserHandler;

Method Index

 o endApplication()
Receives notification of the end of an application element.
 o endAttributePairs()
Receives notification of the end of an attribute-pairs element.
 o endAttribution()
Receives notification of the end of an attribution element.
 o endBind()
Receives notification of the end of an bind element.
 o endBVars()
Receives notification of the end of an bvars element.
 o endError()
Receives notification of the end of an error element.
 o endObject()
Receives notification of the end of an object element.
 o endParse()
Receives notification of the end of parse.
 o readByteArray(byte[])
Receives notification of a byteArray element.
 o readComment(String)
Receives notification of a comment element.
 o readFloat(double)
Receives notification of a floating-point number element.
 o readInteger(BigInteger)
Receives notification of a Big Integer element.
 o readInteger(int)
Receives notification of a Integer element.
 o readPInstruction(String)
Receives notification of a processing instruction.
 o readString(String)
Receives notification of a string element.
 o readSymbol(Symbol)
Receives notification of a symbol element.
 o readVariable(String)
Receives notification of a variable element.
 o setLocator(Locator)
Receives an object for locating the origin of OpenMath parsing events.
 o startApplication()
Receives notification of the beginning of a application element.
 o startAttributePairs()
Receives notification of the beginning of an attribute-pairs element.
 o startAttribution()
Receives notification of the beginning of a attribution element.
 o startBind()
Receives notification of the beginning of a bind element.
 o startBVars()
Receives notification of the beginning of a bvar element.
 o startError()
Receives notification of the beginning of a error element.
 o startObject()
Receives notification of the beginning of a object element.
 o startParse()
Receives notification of the beginning of parse (of a set of OpenMath-objects).

Methods

 o setLocator
 public abstract void setLocator(Locator locator)
Receives an object for locating the origin of OpenMath parsing events.

OpenMath parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the ParserHandler interface.

The locator allows the application to determine the end position of any OpenMath-object related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as unsuported symbol.

Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.

Parameters:
locator - An object that can return the location of any OpenMath-object event.
See Also:
Locator
 o startParse
 public abstract void startParse() throws OMException
Receives notification of the beginning of parse (of a set of OpenMath-objects).

The OpenMath parser will invoke this method only once, before any other methods in this interface (except for setObjectLocator).

Throws: OMException
Any OpenMath exception.
 o endParse
 public abstract void endParse() throws OMException
Receives notification of the end of parse.

The OpenMath parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of the input (no more OpenMath objects).

Throws: OMException
Any OpenMath exception.
 o startObject
 public abstract void startObject() throws OMException
Receives notification of the beginning of a object element.

The Parser will invoke this method at the beginning of every object element in the OpenMath-object; there will be a corresponding endObject() event for every startObject() event The element's content will be reported, in order, before the corresponding endObject() event.

Throws: OMException
Any OpenMath exception.
See Also:
endObject
 o endObject
 public abstract void endObject() throws OMException
Receives notification of the end of an object element.

The Parser will invoke this method at the end of every object element in the OpenMath-object; there will be a corresponding startObject() event for every endObject() event.

Throws: OMException
Any OpenMath exception.
See Also:
startObject
 o startApplication
 public abstract void startApplication() throws OMException
Receives notification of the beginning of a application element.

The Parser will invoke this method at the beginning of every application element in the OpenMath-object; there will be a corresponding endApplication() event for every startApplication() event The element's content will be reported, in order, before the corresponding endApplication() event.

Throws: OMException
Any OpenMath exception.
See Also:
endApplication
 o endApplication
 public abstract void endApplication() throws OMException
Receives notification of the end of an application element.

The Parser will invoke this method at the end of every application element in the OpenMath-object; there will be a corresponding startApplication() event for every endApplication() event.

Throws: OMException
Any OpenMath exception.
See Also:
startApplication
 o startAttribution
 public abstract void startAttribution() throws OMException
Receives notification of the beginning of a attribution element.

The Parser will invoke this method at the beginning of every attribution element in the OpenMath-object; there will be a corresponding endAttribution() event for every startAttribution() event The element's content will be reported, in order, before the corresponding endAttribution() event.

Throws: OMException
Any OpenMath exception.
See Also:
endAttribution
 o startAttributePairs
 public abstract void startAttributePairs() throws OMException
Receives notification of the beginning of an attribute-pairs element.

The Parser will invoke this method at the beginning of every attribute-pairs element in the OpenMath-object; there will be a corresponding endAttribuePairs() event for every startAttributePairs() event. The element's content will be reported, in order, before the corresponding endAttributePairs() event.

Throws: OMException
Any OpenMath exception.
See Also:
endAttributePairs
 o endAttribution
 public abstract void endAttribution() throws OMException
Receives notification of the end of an attribution element.

The Parser will invoke this method at the end of every attribution element in the OpenMath-object; there will be a corresponding startAttribution() event for every endAttribution() event.

Throws: OMException
Any OpenMath exception.
See Also:
startAttribution
 o endAttributePairs
 public abstract void endAttributePairs() throws OMException
Receives notification of the end of an attribute-pairs element.

The Parser will invoke this method at the end of every attribute-pairs element in the OpenMath-object; there will be a corresponding startAttributePairs() event for every endAttributePairs() event.

Throws: OMException
Any OpenMath exception.
See Also:
startAttributePairs
 o startBind
 public abstract void startBind() throws OMException
Receives notification of the beginning of a bind element.

The Parser will invoke this method at the beginning of every bind element in the OpenMath-object; there will be a corresponding endBind() event for every startBind() event The element's content will be reported, in order, before the corresponding endBind() event.

Throws: OMException
Any OpenMath exception.
See Also:
endBind
 o startBVars
 public abstract void startBVars() throws OMException
Receives notification of the beginning of a bvar element.

The Parser will invoke this method at the beginning of every bvar element in the OpenMath-object; there will be a corresponding endBVars() event for every startBVars() event. The element's content will be reported, in order, before the corresponding endBVars() event.

Throws: OMException
Any OpenMath exception.
See Also:
endBVars
 o endBind
 public abstract void endBind() throws OMException
Receives notification of the end of an bind element.

The Parser will invoke this method at the end of every bind element in the OpenMath-object; there will be a corresponding startBind() event for every endBind() event.

Throws: OMException
Any OpenMath exception.
See Also:
startBind
 o endBVars
 public abstract void endBVars() throws OMException
Receives notification of the end of an bvars element.

The Parser will invoke this method at the end of every bvars element in the OpenMath-object; there will be a corresponding startBVars() event for every endBVars() event.

Throws: OMException
Any OpenMath exception.
See Also:
startBVars
 o startError
 public abstract void startError() throws OMException
Receives notification of the beginning of a error element.

The Parser will invoke this method at the beginning of every error element in the OpenMath-object; there will be a corresponding endError() event for every startError() event The element's content will be reported, in order, before the corresponding endError() event.

Throws: OMException
Any OpenMath exception.
See Also:
endError
 o endError
 public abstract void endError() throws OMException
Receives notification of the end of an error element.

The Parser will invoke this method at the end of every error element in the OpenMath-object; there will be a corresponding startError() event for every endError() event.

Throws: OMException
Any OpenMath exception.
See Also:
startError
 o readInteger
 public abstract void readInteger(int value) throws OMException
Receives notification of a Integer element.

The Parser will invoke this method each time a Big Integer element is parsed.

Parameters:
value - the value embedded in this Integer element.
Throws: OMException
Any OpenMath exception.
 o readInteger
 public abstract void readInteger(BigInteger value) throws OMException
Receives notification of a Big Integer element.

The Parser will invoke this method each time a Big Integer element is parsed.

Parameters:
value - the value embedded in this Integer element. This is an infinite precision integer.
Throws: OMException
Any OpenMath exception.
 o readFloat
 public abstract void readFloat(double value) throws OMException
Receives notification of a floating-point number element.

The Parser will invoke this method each time a float element is parsed.

Parameters:
value - the value embedded in this Float element.
Throws: OMException
Any OpenMath exception.
 o readString
 public abstract void readString(String value) throws OMException
Receives notification of a string element.

The Parser will invoke this method each time a string element is parsed.

Parameters:
value - the value embedded in this String element.
Throws: OMException
Any OpenMath exception.
 o readVariable
 public abstract void readVariable(String name) throws OMException
Receives notification of a variable element.

The Parser will invoke this method each time a variable element is parsed.

Parameters:
name - the name of this Variable element.
Throws: OMException
Any OpenMath exception.
 o readByteArray
 public abstract void readByteArray(byte value[]) throws OMException
Receives notification of a byteArray element.

The Parser will invoke this method each time a byteArray element is parsed.

Parameters:
value - the value embedded in this ByteArray element.
Throws: OMException
Any OpenMath exception.
 o readSymbol
 public abstract void readSymbol(Symbol value) throws OMException
Receives notification of a symbol element.

The Parser will invoke this method each time a symbol element is parsed.

Parameters:
value - the value embedded in this Symbol element.
Throws: OMException
Any OpenMath exception.
See Also:
Symbol
 o readComment
 public abstract void readComment(String value) throws OMException
Receives notification of a comment element.

The Parser will invoke this method each time a comment element is parsed.

Parameters:
value - the value embedded in this Comment element.
Throws: OMException
Any OpenMath exception.
 o readPInstruction
 public abstract void readPInstruction(String value) throws OMException
Receives notification of a processing instruction.

The Parser will invoke this method each time a processing instruction is parsed.

Parameters:
value - the value embedded in this Processing Instruction element.
Throws: OMException
Any OpenMath exception.

All Packages  Class Hierarchy  This Package  Previous  Next  Index