Package picasso.parser
Class EqualsAnalyzer
- java.lang.Object
-
- picasso.parser.BinaryFunctionAnalyzer
-
- picasso.parser.EqualsAnalyzer
-
- All Implemented Interfaces:
SemanticAnalyzerInterface
public class EqualsAnalyzer extends BinaryFunctionAnalyzer
-
-
Constructor Summary
Constructors Constructor Description EqualsAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExpressionTreeNode
createBinaryFunctionNode(ExpressionTreeNode left, ExpressionTreeNode right)
Creates the specific binary function node.ExpressionTreeNode
generateExpressionTree(Stack<Token> tokens)
protected boolean
isValidOperatorToken(Token token)
Checks if the given token is of the expected type.
-
-
-
Method Detail
-
isValidOperatorToken
protected boolean isValidOperatorToken(Token token)
Description copied from class:BinaryFunctionAnalyzer
Checks if the given token is of the expected type.- Specified by:
isValidOperatorToken
in classBinaryFunctionAnalyzer
- Parameters:
token
- the token to validate- Returns:
- true if the token matches the expected type, false otherwise
-
createBinaryFunctionNode
protected ExpressionTreeNode createBinaryFunctionNode(ExpressionTreeNode left, ExpressionTreeNode right)
Description copied from class:BinaryFunctionAnalyzer
Creates the specific binary function node.- Specified by:
createBinaryFunctionNode
in classBinaryFunctionAnalyzer
- Parameters:
left
- the left operandright
- the right operand- Returns:
- the binary function node
-
generateExpressionTree
public ExpressionTreeNode generateExpressionTree(Stack<Token> tokens)
- Specified by:
generateExpressionTree
in interfaceSemanticAnalyzerInterface
- Overrides:
generateExpressionTree
in classBinaryFunctionAnalyzer
- Parameters:
tokens
- in postfix order- Returns:
- the root node for the expression represented by the top token
-
-