public class Parser extends Scanner
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.fCurrentChar, fCurrentColumnStartPosition, fCurrentPosition, fFactory, fInputString, fOperatorString, fOperList, fToken, numFormat, rowCount, TT_ARGUMENTS_CLOSE, TT_ARGUMENTS_OPEN, TT_BLANK, TT_COMMA, TT_DIGIT, TT_EOF, TT_FLOATING_POINT, TT_IDENTIFIER, TT_LIST_CLOSE, TT_LIST_OPEN, TT_OPERATOR, TT_PARTCLOSE, TT_PARTOPEN, TT_PERCENT, TT_PRECEDENCE_CLOSE, TT_PRECEDENCE_OPEN, TT_SLOT, TT_SLOTSEQUENCE, TT_STRING
Constructor | Description |
---|---|
Parser() |
Instantiates a new parser.
|
Parser(boolean relaxedSyntax) |
Instantiates a new parser.
|
Parser(org.matheclipse.parser.client.ast.IParserFactory factory,
boolean relaxedSyntax) |
Instantiates a new parser.
|
Modifier and Type | Method | Description |
---|---|---|
org.matheclipse.parser.client.ast.IParserFactory |
getFactory() |
Gets the factory.
|
org.matheclipse.parser.client.ast.ASTNode |
parse(String expression) |
Parse the given
expression String into an ASTNode. |
void |
setFactory(org.matheclipse.parser.client.ast.IParserFactory factory) |
Sets the factory.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIdentifier, getNextToken, getNumberString, getOperator, getStringBuffer, initialize, throwSyntaxError, throwSyntaxError
public Parser()
public Parser(boolean relaxedSyntax) throws SyntaxError
relaxedSyntax
- if true
, use '('...')' as brackets for
argumentsSyntaxError
- the syntax errorpublic Parser(org.matheclipse.parser.client.ast.IParserFactory factory, boolean relaxedSyntax) throws SyntaxError
factory
- the factoryrelaxedSyntax
- if true
, use '('...')' as brackets for
argumentsSyntaxError
- the syntax errorpublic void setFactory(org.matheclipse.parser.client.ast.IParserFactory factory)
factory
- the new factorypublic org.matheclipse.parser.client.ast.IParserFactory getFactory()
public org.matheclipse.parser.client.ast.ASTNode parse(String expression) throws SyntaxError
expression
String into an ASTNode.expression
- a formula string which should be parsed.SyntaxError
- the syntax errorCopyright © 2021. All rights reserved.