Jasmine  1.1
Super fast expression and algorithm evaluator
 All Classes Functions
org.quark.jasmine.OperatorSet Class Reference

Static Public Member Functions

static OperatorSet getOperatorSet (int type)
 

Static Public Attributes

static final int EXPRESSION = 0
 
static final int ALGORITHM = 1
 

Package Functions

String getRegex ()
 
Pattern getPattern ()
 
boolean expExists (String symbol)
 
Exp getExp (String symbol)
 

Private Member Functions

 OperatorSet ()
 
 OperatorSet (OperatorSet set)
 
void makeRegex ()
 
void addAlgorithmOperators ()
 
void addOperators ()
 
void addExp (Exp exp)
 
String regexFromSymbol (String symbol)
 
String regexFromExpressions ()
 

Private Attributes

TreeMap< String, Expexprs
 
String regex = null
 
Pattern pattern = Pattern.compile("^(" + regex + ")")
 

Static Private Attributes

static OperatorSet opSetExprn = null
 
static OperatorSet opSetAlgor = null
 

Detailed Description

Defines the operators that are used when compiling expressions and algorithms.

This class allows to to create two 'operating set singletons' one for expressions and another for algorithms.

Author
Peter Lager

Constructor & Destructor Documentation

org.quark.jasmine.OperatorSet.OperatorSet ( )
private

Private constructor will create the expression set

org.quark.jasmine.OperatorSet.OperatorSet ( OperatorSet  set)
private

Private constructor will create the an operator set from another set. Extra operators can then be added.

Member Function Documentation

void org.quark.jasmine.OperatorSet.addAlgorithmOperators ( )
private

Add the extra operators needed for parsing algorithms.

void org.quark.jasmine.OperatorSet.addExp ( Exp  exp)
private

Add an expression to this set.

Parameters
exp
void org.quark.jasmine.OperatorSet.addOperators ( )
private

Add the operators needed for parsing expressions.

boolean org.quark.jasmine.OperatorSet.expExists ( String  symbol)
package

See if an operator exists based on its symbol

Exp org.quark.jasmine.OperatorSet.getExp ( String  symbol)
package

Create and return an Exp object based on its symbol. If the symbol can't be found it returns null

static OperatorSet org.quark.jasmine.OperatorSet.getOperatorSet ( int  type)
static

The parameter type determines which operator set to return. The actual operator set is created on first use.

Parameters
typeEXPRESSION or ALGORITHM
Returns
the appropriate operator set.
Pattern org.quark.jasmine.OperatorSet.getPattern ( )
package

Get the pattern for this set for the parser.

Returns
String org.quark.jasmine.OperatorSet.getRegex ( )
package

Get the operator set regular expression

Returns
void org.quark.jasmine.OperatorSet.makeRegex ( )
private

Once all the operators have been added this will create all the regular expressions for each operator and the whole set.

String org.quark.jasmine.OperatorSet.regexFromExpressions ( )
private

Calculates the regex for all expression symbols to be used when parsing

String org.quark.jasmine.OperatorSet.regexFromSymbol ( String  symbol)
private

Create a regular expression from a symbol. Basically prefixes reserved characters with a backslash.


The documentation for this class was generated from the following file: