Jasmine
1.1
Super fast expression and algorithm evaluator
|
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, Exp > | exprs |
String | regex = null |
Pattern | pattern = Pattern.compile("^(" + regex + ")") |
Static Private Attributes | |
static OperatorSet | opSetExprn = null |
static OperatorSet | opSetAlgor = null |
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.
|
private |
Private constructor will create the expression set
|
private |
Private constructor will create the an operator set from another set. Extra operators can then be added.
|
private |
Add the extra operators needed for parsing algorithms.
|
private |
Add an expression to this set.
exp |
|
private |
Add the operators needed for parsing expressions.
|
package |
See if an operator exists based on its symbol
|
package |
|
static |
The parameter type determines which operator set to return. The actual operator set is created on first use.
type | EXPRESSION or ALGORITHM |
|
package |
Get the pattern for this set for the parser.
|
package |
Get the operator set regular expression
|
private |
Once all the operators have been added this will create all the regular expressions for each operator and the whole set.
|
private |
Calculates the regex for all expression symbols to be used when parsing
|
private |
Create a regular expression from a symbol. Basically prefixes reserved characters with a backslash.