ASTNodeFactory
public interface IParserFactory
Modifier and Type | Field | Description |
---|---|---|
static String |
DEFAULT_OPERATOR_CHARACTERS |
The default set of characters, which could form an operator.
|
Modifier and Type | Method | Description |
---|---|---|
FunctionNode |
createAST(ASTNode headExpr) |
Creates a new function with no arguments from the given header expression
.
|
ASTNode |
createDouble(String doubleString) |
Create an double node from the given double value string.
|
FractionNode |
createFraction(IntegerNode numerator,
IntegerNode denominator) |
Create a "fractional" number.
|
FunctionNode |
createFunction(SymbolNode head) |
Creates a new function with head
head and 0 arguments. |
FunctionNode |
createFunction(SymbolNode head,
ASTNode arg0) |
Creates a new function with head
head and 1 argument. |
FunctionNode |
createFunction(SymbolNode head,
ASTNode arg0,
ASTNode arg1) |
Creates a new function with head
head and 2 arguments. |
IntegerNode |
createInteger(int integerValue) |
Create an integer node from the given value.
|
IntegerNode |
createInteger(String integerString,
int numberFormat) |
Create an integer node from the given string.
|
PatternNode |
createPattern(SymbolNode patternName,
ASTNode check) |
Create a pattern from the given symbol node.
|
StringNode |
createString(StringBuffer buffer) |
Create a string node from the scanned double quoted string.
|
SymbolNode |
createSymbol(String symbolName) |
Create a symbol from the scanned identifier string.
|
Operator |
get(String identifier) |
Get the operator for a given identifier string like Times, Plus, Sin,...
|
Map<String,Operator> |
getIdentifier2OperatorMap() |
Get the identifier to operator map.
|
Map<String,ArrayList<Operator>> |
getOperator2ListMap() |
Get the operator-string to possible operator-list map.
|
String |
getOperatorCharacters() |
The set of characters, which could form an operator.
|
List<Operator> |
getOperatorList(String operatorString) |
Get the operator-list for a given operator-string.
|
boolean |
isValidIdentifier(String identifier) |
Check if the identifier name is valid.
|
static final String DEFAULT_OPERATOR_CHARACTERS
String getOperatorCharacters()
Map<String,Operator> getIdentifier2OperatorMap()
Map<String,ArrayList<Operator>> getOperator2ListMap()
Operator get(String identifier)
identifier
- the identifierList<Operator> getOperatorList(String operatorString)
operatorString
- the operator stringFunctionNode createFunction(SymbolNode head)
head
and 0 arguments.head
- the headFunctionNode createFunction(SymbolNode head, ASTNode arg0)
head
and 1 argument.head
- the headarg0
- the arg 0FunctionNode createFunction(SymbolNode head, ASTNode arg0, ASTNode arg1)
head
and 2 arguments.head
- the headarg0
- the arg 0arg1
- the arg 1FunctionNode createAST(ASTNode headExpr)
headExpr
- the head exprASTNode createDouble(String doubleString)
doubleString
- the double stringIntegerNode createInteger(String integerString, int numberFormat)
integerString
- the integer number represented as a StringnumberFormat
- the format of the number (usually 10)IntegerNode createInteger(int integerValue)
integerValue
- the integer number's valueFractionNode createFraction(IntegerNode numerator, IntegerNode denominator)
numerator
- numerator of the fractional numberdenominator
- denominator of the fractional numberPatternNode createPattern(SymbolNode patternName, ASTNode check)
patternName
- the pattern namecheck
- the checkStringNode createString(StringBuffer buffer)
buffer
- the bufferSymbolNode createSymbol(String symbolName)
symbolName
- the symbol nameboolean isValidIdentifier(String identifier)
identifier
- the currently parsed identifierfalse
if the identifier is not valid (in this case
the parser creates a SyntaxError exception); otherwise return
true
Copyright © 2018. All rights reserved.