csheets.core.formula.compiler
Class FormulaCompiler

java.lang.Object
  extended by csheets.core.formula.compiler.FormulaCompiler

public class FormulaCompiler
extends Object

A compiler that generates formulas from strings.

Author:
Einar Pehrson

Method Summary
 Formula compile(Cell cell, String source)
          Compiles a formula for the given cell from the given string.
static FormulaCompiler getInstance()
          Returns the singleton instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FormulaCompiler getInstance()
Returns the singleton instance.

Returns:
the singleton instance

compile

public Formula compile(Cell cell,
                       String source)
                throws FormulaCompilationException
Compiles a formula for the given cell from the given string.

Parameters:
cell - the cell for which a formula is to be generated
source - a string representing the formula to be compiled
Returns:
a list of lexical tokens
Throws:
FormulaCompilationException - if the formula could not be compiled