Package com.ezylang.evalex.parser
Class ShuntingYardConverter
- java.lang.Object
-
- com.ezylang.evalex.parser.ShuntingYardConverter
-
public class ShuntingYardConverter extends java.lang.ObjectThe shunting yard algorithm can be used to convert a mathematical expression from an infix notation into either a postfix notation (RPN, reverse polish notation), or into an abstract syntax tree (AST).Here it is used to parse and convert a list of already parsed expression tokens into an AST.
- See Also:
- Shunting yard algorithm, Abstract syntax tree
-
-
Constructor Summary
Constructors Constructor Description ShuntingYardConverter(java.lang.String originalExpression, java.util.List<Token> expressionTokens, ExpressionConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ASTNodetoAbstractSyntaxTree()
-
-
-
Constructor Detail
-
ShuntingYardConverter
public ShuntingYardConverter(java.lang.String originalExpression, java.util.List<Token> expressionTokens, ExpressionConfiguration configuration)
-
-
Method Detail
-
toAbstractSyntaxTree
public ASTNode toAbstractSyntaxTree() throws ParseException
- Throws:
ParseException
-
-