public class ExprParser extends ExprScanner
ASTNode
class-hierarchy from a math
formulas string representation
See
Operator
-precedence parser for the idea, how to parse the operators depending on
their precedence.Modifier and Type | Field and Description |
---|---|
static ISymbol |
DERIVATIVE |
fCurrentChar, fCurrentColumnStartPosition, fCurrentPosition, fFactory, fInputString, fOperatorString, fOperList, fPackageMode, fRecursionDepth, fToken, numFormat, rowCount, TT_ARGUMENTS_CLOSE, TT_ARGUMENTS_OPEN, TT_BLANK, TT_BLANK_BLANK, TT_BLANK_BLANK_BLANK, TT_BLANK_OPTIONAL, TT_COMMA, TT_DERIVATIVE, TT_DIGIT, TT_EOF, TT_FLOATING_POINT, TT_IDENTIFIER, TT_LIST_CLOSE, TT_LIST_OPEN, TT_NEWLINE, TT_OPERATOR, TT_PARTCLOSE, TT_PARTOPEN, TT_PERCENT, TT_PRECEDENCE_CLOSE, TT_PRECEDENCE_OPEN, TT_SLOT, TT_SLOTSEQUENCE, TT_STRING
Constructor and Description |
---|
ExprParser(EvalEngine engine) |
ExprParser(EvalEngine engine,
boolean relaxedSyntax) |
ExprParser(EvalEngine engine,
boolean relaxedSyntax,
boolean packageMode) |
ExprParser(EvalEngine engine,
IExprParserFactory factory,
boolean relaxedSyntax) |
ExprParser(EvalEngine engine,
IExprParserFactory factory,
boolean relaxedSyntax,
boolean packageMode) |
Modifier and Type | Method and Description |
---|---|
IExprParserFactory |
getFactory() |
IExpr |
parse(java.lang.String expression)
Parse the given
expression String into an IExpr. |
java.util.List<IExpr> |
parsePackage(java.lang.String expression) |
void |
setFactory(IExprParserFactory factory) |
getIdentifier, getNextToken, getNumberString, getOperator, getStringBuffer, initialize, isWhitespace, throwSyntaxError, throwSyntaxError
public static final ISymbol DERIVATIVE
public ExprParser(EvalEngine engine)
public ExprParser(EvalEngine engine, boolean relaxedSyntax) throws SyntaxError
relaxedSyntax
- if true
, use '('...')' as brackets for argumentsSyntaxError
public ExprParser(EvalEngine engine, boolean relaxedSyntax, boolean packageMode) throws SyntaxError
SyntaxError
public ExprParser(EvalEngine engine, IExprParserFactory factory, boolean relaxedSyntax) throws SyntaxError
factory
- relaxedSyntax
- if true
, use '('...')' as brackets for argumentsSyntaxError
public ExprParser(EvalEngine engine, IExprParserFactory factory, boolean relaxedSyntax, boolean packageMode) throws SyntaxError
SyntaxError
public void setFactory(IExprParserFactory factory)
public IExprParserFactory getFactory()
public IExpr parse(java.lang.String expression) throws SyntaxError
expression
String into an IExpr.expression
- a formula string which should be parsed.SyntaxError
public java.util.List<IExpr> parsePackage(java.lang.String expression) throws SyntaxError
SyntaxError