com.japisoft.formula
Class FormulaTreeBuilder

java.lang.Object
  extended bycom.japisoft.formula.FormulaTreeBuilder
All Implemented Interfaces:
FormulaParsingListener

public class FormulaTreeBuilder
extends java.lang.Object
implements FormulaParsingListener

Formula parsing builder.

This classes receives parsing events and build an inner tree once for evaluating expression quickly.

This system is very similar to the SAX even system. Thus you may change of parsing without changing the evaluation system or the contrary change the evaluation system without changing the parsing process

More information at : http://www.japisoft.com

Version:
1.1
Author:
(c) 2002-2003 JAPISOFT

Constructor Summary
FormulaTreeBuilder()
           
 
Method Summary
 void findBinaryOperator(java.lang.String op)
           
 void findEmptyFunction(java.lang.String name)
           
 void findFunction(java.lang.String functionName)
           
 void findGroup()
           
 void findList()
           
 void findNumber(java.lang.String value)
           
 void findParam()
           
 void findTernaryOperator(java.lang.String op)
           
 void findUnaryOperator(java.lang.String op)
           
 void findValue(java.lang.String value)
           
 void findVariable(java.lang.String variableName)
           
 AbstractNode getRootNode()
           
 void reset()
          Reset the listener state for a new parsing
 void setCurrentPos(int line, int column)
          Reset the current parsed location
 void setFormulaContext(FormulaContext context)
          It MUST be called before using this builder
 void setNodeFactory(NodeFactory nf)
          Reset for factory for choosing formula nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormulaTreeBuilder

public FormulaTreeBuilder()
Method Detail

setNodeFactory

public void setNodeFactory(NodeFactory nf)
Reset for factory for choosing formula nodes. It MUST be called before using this builder


setFormulaContext

public void setFormulaContext(FormulaContext context)
It MUST be called before using this builder


reset

public void reset()
Reset the listener state for a new parsing


setCurrentPos

public void setCurrentPos(int line,
                          int column)
Reset the current parsed location

Specified by:
setCurrentPos in interface FormulaParsingListener

findFunction

public void findFunction(java.lang.String functionName)
Specified by:
findFunction in interface FormulaParsingListener

findVariable

public void findVariable(java.lang.String variableName)
Specified by:
findVariable in interface FormulaParsingListener

findList

public void findList()
Specified by:
findList in interface FormulaParsingListener

findGroup

public void findGroup()
Specified by:
findGroup in interface FormulaParsingListener

findParam

public void findParam()
Specified by:
findParam in interface FormulaParsingListener

findEmptyFunction

public void findEmptyFunction(java.lang.String name)
Specified by:
findEmptyFunction in interface FormulaParsingListener

findUnaryOperator

public void findUnaryOperator(java.lang.String op)
Specified by:
findUnaryOperator in interface FormulaParsingListener

findBinaryOperator

public void findBinaryOperator(java.lang.String op)
Specified by:
findBinaryOperator in interface FormulaParsingListener

findTernaryOperator

public void findTernaryOperator(java.lang.String op)
Specified by:
findTernaryOperator in interface FormulaParsingListener

findNumber

public void findNumber(java.lang.String value)
Specified by:
findNumber in interface FormulaParsingListener

findValue

public void findValue(java.lang.String value)
Specified by:
findValue in interface FormulaParsingListener

getRootNode

public AbstractNode getRootNode()
Returns:
the parsing root node