Package picasso.parser
Class ExpressionTreeGenerator
- java.lang.Object
-
- picasso.parser.ExpressionTreeGenerator
-
public class ExpressionTreeGenerator extends Object
Parses a string into an expression tree based on rules for arithmetic.
-
-
Constructor Summary
Constructors Constructor Description ExpressionTreeGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stack<Token>
infixToPostfix(String infix)
This method converts the String infix expression to a Stack of tokens, which are in postfix.ExpressionTreeNode
makeExpression(String infix)
Converts the given string into expression tree for easier manipulation.
-
-
-
Method Detail
-
makeExpression
public ExpressionTreeNode makeExpression(String infix)
Converts the given string into expression tree for easier manipulation.- Parameters:
infix
- - a non-empty expression to parse.- Returns:
- ExpressionTreeNode representing the root node of the given infix formula
-
-