Package picasso.parser
Class UnaryOperationAnalyzer
- java.lang.Object
-
- picasso.parser.UnaryOperationAnalyzer
-
- All Implemented Interfaces:
SemanticAnalyzerInterface
- Direct Known Subclasses:
NegationAnalyzer
public abstract class UnaryOperationAnalyzer extends Object implements SemanticAnalyzerInterface
Abstract class that parses an operation that one expressions as parameters.
-
-
Constructor Summary
Constructors Constructor Description UnaryOperationAnalyzer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExpressionTreeNodegenerateExpressionTree(Stack<Token> tokens)protected abstract ExpressionTreeNodenewUnaryNode(ExpressionTreeNode paramETN)Abstract method that allows child classes to provide the expression tree nodes for the unary operator.
-
-
-
Method Detail
-
generateExpressionTree
public ExpressionTreeNode generateExpressionTree(Stack<Token> tokens)
- Specified by:
generateExpressionTreein interfaceSemanticAnalyzerInterface- Parameters:
tokens- in postfix order- Returns:
- the root node for the expression represented by the top token
-
newUnaryNode
protected abstract ExpressionTreeNode newUnaryNode(ExpressionTreeNode paramETN)
Abstract method that allows child classes to provide the expression tree nodes for the unary operator.- Parameters:
expression- expression tree node.- Returns:
- The expression tree node for the unary operator.
-
-