fr.ove.openmath.jome.ctrl.linear
Class LinearParser

java.lang.Object
  extended byfr.ove.openmath.jome.ctrl.linear.LinearParser
All Implemented Interfaces:
java.io.Serializable

public class LinearParser
extends java.lang.Object
implements java.io.Serializable

A bean which parses, more precisely tokenizes, what we can call the linear form of an expression.
For each specific token encountered, an event (@see LinearParserEvent) is fired to all the listeners (@see LinearParserListener) of the instance.
The event fired is made of 2 parts :

When the parsing starts, an event whith the identifier set to LinearParserEvent.START_EXPRESSION is fired. Similarly, when the parsing ends (the end of the linear form has been reached), an event whith the identifier set to LinearParserEvent.END_EXPRESSION is fired.
In order to make distinctions between what should be variables and special keywords, a resources file (LinearParserResources.properties) is attached to the parser. This file contains the user defined keywords.
To add your own keywords, edit this properties file with respect to the used format (see this file for further details).

Version:
1.0 27/09/1999
Author:
Ôø? 1999 DIRAT Laurent
See Also:
Serialized Form

Constructor Summary
LinearParser()
          The constructor.
 
Method Summary
 void addLinearParserListener(LinearParserListener linearParserListener)
          Registers another listener of the instance.
 void fireLinearParserEvent(LinearParserEvent linearParserEvent)
          Fires a LinearParserEvent event to registered listeners.
static void main(java.lang.String[] args)
           
 void parse(java.lang.String expression)
          Parses the specified linear form of the formula.
 void removeLinearParserListener(LinearParserListener linearParserListener)
          Removes a listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearParser

public LinearParser()
The constructor.

Method Detail

addLinearParserListener

public void addLinearParserListener(LinearParserListener linearParserListener)
Registers another listener of the instance.

Parameters:
linearParserListener - the listener to add.

removeLinearParserListener

public void removeLinearParserListener(LinearParserListener linearParserListener)
Removes a listener.

Parameters:
linearParserListener - the listener to remove.

fireLinearParserEvent

public void fireLinearParserEvent(LinearParserEvent linearParserEvent)
Fires a LinearParserEvent event to registered listeners.

Parameters:
linearParserEvent - event encapsulating relevant information.

parse

public void parse(java.lang.String expression)
Parses the specified linear form of the formula.

Parameters:
expression - the linear form of the formula.

main

public static void main(java.lang.String[] args)


Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.