public class ExprParserFactory extends java.lang.Object implements IExprParserFactory
Modifier and Type | Field and Description |
---|---|
static int |
DIVIDE_PRECEDENCE |
static ExprParserFactory |
MMA_STYLE_FACTORY |
static int |
PLUS_PRECEDENCE |
static int |
POWER_PRECEDENCE |
static ExprParserFactory |
RELAXED_STYLE_FACTORY |
static int |
TIMES_PRECEDENCE |
DEFAULT_OPERATOR_CHARACTERS
Constructor and Description |
---|
ExprParserFactory()
Create a default ASTNode factory
|
Modifier and Type | Method and Description |
---|---|
static void |
addOperator(java.util.Map<java.lang.String,AbstractExprOperator> operatorMap,
java.util.Map<java.lang.String,java.util.ArrayList<AbstractExprOperator>> operatorTokenStartSet,
java.lang.String operatorStr,
java.lang.String headStr,
AbstractExprOperator oper) |
static InfixExprOperator |
createInfixOperator(java.lang.String operatorStr,
java.lang.String headStr,
int precedence,
int grouping) |
static PostfixExprOperator |
createPostfixOperator(java.lang.String operatorStr,
java.lang.String headStr,
int precedence) |
static PrefixExprOperator |
createPrefixOperator(java.lang.String operatorStr,
java.lang.String headStr,
int precedence) |
AbstractExprOperator |
get(java.lang.String identifier)
Get the operator for a given identifier string like Times, Plus, Sin,...
|
java.util.Map<java.lang.String,AbstractExprOperator> |
getIdentifier2OperatorMap()
public Map
|
java.util.Map<java.lang.String,java.util.ArrayList<AbstractExprOperator>> |
getOperator2ListMap()
Get the operator-string to possible operator-list map
|
java.lang.String |
getOperatorCharacters()
The set of characters, which could form an operator
|
java.util.List<AbstractExprOperator> |
getOperatorList(java.lang.String key)
Get the operator-list for a given operator-string
|
boolean |
isValidIdentifier(java.lang.String identifier)
Check if the identifier name is valid.
|
public static final int PLUS_PRECEDENCE
public static final int TIMES_PRECEDENCE
public static final int DIVIDE_PRECEDENCE
public static final int POWER_PRECEDENCE
public static final ExprParserFactory MMA_STYLE_FACTORY
public static final ExprParserFactory RELAXED_STYLE_FACTORY
public static void addOperator(java.util.Map<java.lang.String,AbstractExprOperator> operatorMap, java.util.Map<java.lang.String,java.util.ArrayList<AbstractExprOperator>> operatorTokenStartSet, java.lang.String operatorStr, java.lang.String headStr, AbstractExprOperator oper)
public java.lang.String getOperatorCharacters()
IExprParserFactory
getOperatorCharacters
in interface IExprParserFactory
public java.util.Map<java.lang.String,AbstractExprOperator> getIdentifier2OperatorMap()
getIdentifier2OperatorMap
in interface IExprParserFactory
public AbstractExprOperator get(java.lang.String identifier)
IExprParserFactory
get
in interface IExprParserFactory
public java.util.Map<java.lang.String,java.util.ArrayList<AbstractExprOperator>> getOperator2ListMap()
IExprParserFactory
getOperator2ListMap
in interface IExprParserFactory
public java.util.List<AbstractExprOperator> getOperatorList(java.lang.String key)
IExprParserFactory
getOperatorList
in interface IExprParserFactory
public static InfixExprOperator createInfixOperator(java.lang.String operatorStr, java.lang.String headStr, int precedence, int grouping)
public static PrefixExprOperator createPrefixOperator(java.lang.String operatorStr, java.lang.String headStr, int precedence)
public static PostfixExprOperator createPostfixOperator(java.lang.String operatorStr, java.lang.String headStr, int precedence)
public boolean isValidIdentifier(java.lang.String identifier)
IExprParserFactory
isValidIdentifier
in interface IExprParserFactory
identifier
- the currently parsed identifierfalse
if the identifier is not valid (in this case the parser creates a SyntaxError exception);
otherwise return true