org.matheclipse.parser.client
Class Parser
- java.lang.Object
-
- org.matheclipse.parser.client.Scanner
-
- org.matheclipse.parser.client.Parser
-
public class Parser extends Scanner
Create an expression of theASTNodeclass-hierarchy from a math formulas string representation See Operator -precedence parser for the idea, how to parse the operators depending on their precedence.
-
-
Field Summary
Fields Modifier and Type Field and Description static SymbolNodeDERIVATIVE-
Fields inherited from class org.matheclipse.parser.client.Scanner
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_OPERATOR, TT_PARTCLOSE, TT_PARTOPEN, TT_PERCENT, TT_PRECEDENCE_CLOSE, TT_PRECEDENCE_OPEN, TT_SLOT, TT_SLOTSEQUENCE, TT_STRING
-
-
Constructor Summary
Constructors Constructor and Description Parser()Parser(boolean relaxedSyntax)Parser(boolean relaxedSyntax, boolean packageMode)Parser(IParserFactory factory, boolean relaxedSyntax)Parser(IParserFactory factory, boolean relaxedSyntax, boolean packageMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IParserFactorygetFactory()ASTNodeparse(java.lang.String expression)Parse the givenexpressionString into an ASTNode.java.util.List<ASTNode>parseList(java.lang.String expression)voidsetFactory(IParserFactory factory)
-
-
-
Field Detail
-
DERIVATIVE
public static final SymbolNode DERIVATIVE
-
-
Constructor Detail
-
Parser
public Parser()
-
Parser
public Parser(boolean relaxedSyntax) throws SyntaxError- Parameters:
relaxedSyntax- iftrue, use '('...')' as brackets for arguments- Throws:
SyntaxError
-
Parser
public Parser(boolean relaxedSyntax, boolean packageMode) throws SyntaxError- Throws:
SyntaxError
-
Parser
public Parser(IParserFactory factory, boolean relaxedSyntax) throws SyntaxError
- Parameters:
factory-relaxedSyntax- iftrue, use '('...')' as brackets for arguments- Throws:
SyntaxError
-
Parser
public Parser(IParserFactory factory, boolean relaxedSyntax, boolean packageMode) throws SyntaxError
- Throws:
SyntaxError
-
-
Method Detail
-
setFactory
public void setFactory(IParserFactory factory)
-
getFactory
public IParserFactory getFactory()
-
parse
public ASTNode parse(java.lang.String expression) throws SyntaxError
Parse the givenexpressionString into an ASTNode.- Parameters:
expression- a formula string which should be parsed.- Returns:
- the parsed ASTNode representation of the given formula string
- Throws:
SyntaxError
-
parseList
public java.util.List<ASTNode> parseList(java.lang.String expression) throws SyntaxError
- Throws:
SyntaxError
-
-
DMelt 3.0 © DataMelt by jWork.ORG