Package picasso.parser
Class SemanticAnalyzer
- java.lang.Object
-
- picasso.parser.SemanticAnalyzer
-
- All Implemented Interfaces:
SemanticAnalyzerInterface
public class SemanticAnalyzer extends Object implements SemanticAnalyzerInterface
SemanticAnalyzer calls appropriate SemanticAnalyzer for the given token
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressionTreeNode
generateExpressionTree(Stack<Token> tokens)
From a stack of tokens in postfix order, creates an expression treestatic SemanticAnalyzer
getInstance()
Make sure that there is only one semantic analyzer for the application.
-
-
-
Method Detail
-
getInstance
public static SemanticAnalyzer getInstance()
Make sure that there is only one semantic analyzer for the application.- Returns:
- the semantic analyzer
-
generateExpressionTree
public ExpressionTreeNode generateExpressionTree(Stack<Token> tokens)
From a stack of tokens in postfix order, creates an expression tree- Specified by:
generateExpressionTree
in interfaceSemanticAnalyzerInterface
- Parameters:
tokens
- in postfix order- Returns:
- the root node of the expression tree.
-
-