Class Parser<NumberT>
java.lang.Object
dk.jonaslindstrom.arithmeticparser.Parser<NumberT>
- Type Parameters:
NumberT
-
This class parses arithmetic expressions into reverse polish notation which makes them easy to
evaluate. It supports basic arithmetic (+, -, *, /, ^) and parenthesis. It also supports user
defined functions and variables to be assigned during evaluation.
-
Constructor Summary
ConstructorsConstructorDescriptionParser
(List<String> operators, NumberParser<NumberT> parser) Create a new operator recognizing the given operators and using the given parser to convert numbers into the desired type. -
Method Summary
-
Constructor Details
-
Parser
Create a new operator recognizing the given operators and using the given parser to convert numbers into the desired type. Operators should be ordered with the least precedent first.- Parameters:
operators
-parser
-
-
-
Method Details
-
getDefault
Return the default parser.- Returns:
-
parse
public List<Token> parse(String infix, List<String> variables, List<String> functions) throws ParseException Parse the given expression given lists of names of user defined variables and functions.- Parameters:
infix
-variables
-functions
-- Returns:
- Throws:
ParseException
-