org.matheclipse.parser.client.ast
Interface IParserFactory
-
- All Known Implementing Classes:
- ASTNodeFactory
public interface IParserFactoryFactory for creating the ASTNodes from the parser
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringDEFAULT_OPERATOR_CHARACTERSThe default set of characters, which could form an operator
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description FunctionNodecreateAST(ASTNode headExpr)Creates a new function with no arguments from the given header expression .ASTNodecreateDouble(java.lang.String doubleString)Create an double node from the given double value stringFractionNodecreateFraction(IntegerNode numerator, IntegerNode denominator)Create a "fractional" numberFunctionNodecreateFunction(SymbolNode head)Creates a new function with headheadand 0 arguments.FunctionNodecreateFunction(SymbolNode head, ASTNode arg0)Creates a new function with headheadand 1 argument.FunctionNodecreateFunction(SymbolNode head, ASTNode arg0, ASTNode arg1)Creates a new function with headheadand 2 arguments.IntegerNodecreateInteger(int integerValue)Create an integer node from the given valueIntegerNodecreateInteger(java.lang.String integerString, int numberFormat)Create an integer node from the given stringPatternNodecreatePattern(SymbolNode patternName, ASTNode check)Create a pattern from the given symbol node (i.e.PatternNodecreatePattern(SymbolNode patternName, ASTNode check, boolean optional)Create a pattern from the given symbol nodePatternNodecreatePattern2(SymbolNode patternName, ASTNode check)Create a pattern from the given symbol node (i.e.PatternNodecreatePattern3(SymbolNode patternName, ASTNode check)Create a pattern from the given symbol node (i.e.StringNodecreateString(java.lang.StringBuffer buffer)Create a string node from the scanned double quoted stringSymbolNodecreateSymbol(java.lang.String symbolName)Create a symbol from the scanned identifier stringOperatorget(java.lang.String identifier)Get the operator for a given identifier string like Times, Plus, Sin,...java.util.Map<java.lang.String,Operator>getIdentifier2OperatorMap()Get the identifier to operator mapjava.util.Map<java.lang.String,java.util.ArrayList<Operator>>getOperator2ListMap()Get the operator-string to possible operator-list mapjava.lang.StringgetOperatorCharacters()The set of characters, which could form an operatorjava.util.List<Operator>getOperatorList(java.lang.String operatorString)Get the operator-list for a given operator-stringbooleanisValidIdentifier(java.lang.String identifier)Check if the identifier name is valid.
-
-
-
Field Detail
-
DEFAULT_OPERATOR_CHARACTERS
static final java.lang.String DEFAULT_OPERATOR_CHARACTERS
The default set of characters, which could form an operator- See Also:
- Constant Field Values
-
-
Method Detail
-
getOperatorCharacters
java.lang.String getOperatorCharacters()
The set of characters, which could form an operator
-
getIdentifier2OperatorMap
java.util.Map<java.lang.String,Operator> getIdentifier2OperatorMap()
Get the identifier to operator map- Returns:
- the map which stores the Operators for a given head string like Times, Plus, Sin,...
-
getOperator2ListMap
java.util.Map<java.lang.String,java.util.ArrayList<Operator>> getOperator2ListMap()
Get the operator-string to possible operator-list map- Returns:
- the map which stores the operator-list for a given operator string like *, +, ==...
-
get
Operator get(java.lang.String identifier)
Get the operator for a given identifier string like Times, Plus, Sin,...- Parameters:
identifier-- Returns:
-
getOperatorList
java.util.List<Operator> getOperatorList(java.lang.String operatorString)
Get the operator-list for a given operator-string- Returns:
- the operator-list for a given operator string like *, +, ==...
-
createFunction
FunctionNode createFunction(SymbolNode head)
Creates a new function with headheadand 0 arguments.
-
createFunction
FunctionNode createFunction(SymbolNode head, ASTNode arg0)
Creates a new function with headheadand 1 argument.
-
createFunction
FunctionNode createFunction(SymbolNode head, ASTNode arg0, ASTNode arg1)
Creates a new function with headheadand 2 arguments.
-
createAST
FunctionNode createAST(ASTNode headExpr)
Creates a new function with no arguments from the given header expression .
-
createDouble
ASTNode createDouble(java.lang.String doubleString)
Create an double node from the given double value string- Parameters:
doubleString-- Returns:
-
createInteger
IntegerNode createInteger(java.lang.String integerString, int numberFormat)
Create an integer node from the given string- Parameters:
integerString- the integer number represented as a StringnumberFormat- the format of the number (usually 10)- Returns:
- IInteger
-
createInteger
IntegerNode createInteger(int integerValue)
Create an integer node from the given value- Parameters:
integerValue- the integer number's value- Returns:
- IInteger
-
createFraction
FractionNode createFraction(IntegerNode numerator, IntegerNode denominator)
Create a "fractional" number- Parameters:
numerator- numerator of the fractional numberdenominator- denominator of the fractional number- Returns:
- IFraction
-
createPattern
PatternNode createPattern(SymbolNode patternName, ASTNode check)
Create a pattern from the given symbol node (i.e._orx_)- Parameters:
patternName-- Returns:
- Object
-
createPattern2
PatternNode createPattern2(SymbolNode patternName, ASTNode check)
Create a pattern from the given symbol node (i.e.__orx__)- Parameters:
patternName-- Returns:
- Object
-
createPattern3
PatternNode createPattern3(SymbolNode patternName, ASTNode check)
Create a pattern from the given symbol node (i.e.___orx___)- Parameters:
patternName-- Returns:
- Object
-
createPattern
PatternNode createPattern(SymbolNode patternName, ASTNode check, boolean optional)
Create a pattern from the given symbol node- Parameters:
patternName-- Returns:
- Object
-
createString
StringNode createString(java.lang.StringBuffer buffer)
Create a string node from the scanned double quoted string- Parameters:
symbolName-- Returns:
-
createSymbol
SymbolNode createSymbol(java.lang.String symbolName)
Create a symbol from the scanned identifier string- Parameters:
symbolName-- Returns:
-
isValidIdentifier
boolean isValidIdentifier(java.lang.String identifier)
Check if the identifier name is valid.- Parameters:
identifier- the currently parsed identifier- Returns:
falseif the identifier is not valid (in this case the parser creates a SyntaxError exception); otherwise returntrue
-
-
DMelt 3.0 © DataMelt by jWork.ORG