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_CONSTANT, TT_DIGIT, TT_EOF, TT_FLOATING_POINT, TT_OPERATOR, TT_PRECEDENCE_CLOSE, TT_PRECEDENCE_OPEN| Constructor and Description |
|---|
Parser() |
Parser(boolean relaxedSyntax) |
Parser(IParserFactory factory,
boolean relaxedSyntax) |
| Modifier and Type | Method and Description |
|---|---|
IParserFactory |
getFactory() |
ASTNode |
parse(String expression)
Parse the given
expression String into an ASTNode. |
void |
setFactory(IParserFactory factory) |
getIdentifier, getNextToken, getNumberString, getOperator, getStringBuffer, initialize, throwSyntaxError, throwSyntaxErrorpublic Parser()
public Parser(boolean relaxedSyntax)
throws SyntaxError
SyntaxErrorpublic Parser(IParserFactory factory, boolean relaxedSyntax) throws SyntaxError
SyntaxErrorpublic void setFactory(IParserFactory factory)
public IParserFactory getFactory()
public ASTNode parse(String expression) throws SyntaxError
expression String into an ASTNode.expression - a formula string which should be parsed.SyntaxErrorCopyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.