Package hussam.math.operations.parser
Provides a User interface to read Expressions to be transformed into Operations. See:
Description
Package hussam.math.operations.parser Description
Provides a User interface to read Expressions to be transformed into Operations.
This package contains the tools a developer needs that will help him read expressions easily.
The user can start reading expressions easily by having an ExpressionReader. An ExpressionReader can be obtained by:
OperationReader reader = ExpressionReader.getInstance();
The reader can be used to parse mathimatical expressions:
Operation o = reader.readOperation("5+7*3+Abs (Min (x , -19))");
After having an Operation, the user can have the result:
double value = o.result();
System.out.println(value);
Note that you can access the OperatorSource used while reading to obtain all variables used in the expression:
OperatorSource source = reader.getOperatorSource();
Variable v = source.getLocalVariable("x");
v.setOperation (new ConstantNumber (10));
double value2 = o.result();
System.out.println(value2);
The expressions are parsed using the OperationsParser with
the specified default implementation MyParser. The developer can change the way the reader parses by changing the parser. ExpressionReader.getInstance(hussam.math.operations.parser.OperationsParser, hussam.math.operations.dataBase.OperatorSource) Package Specification
This package is linked direclty to the mother package operations. This package also uses the dataBase package to access OperatorSource. Related Documentation
For overviews, tutorials, examples, guides, and tool documentation, please see: