Package nz.org.riskscape.rl.ast
Class ExpressionConverter<T>
java.lang.Object
nz.org.riskscape.rl.ast.ExpressionConverter<T>
- Type Parameters:
T
- data passed around to assist with conversion
- All Implemented Interfaces:
ExpressionVisitor<T,
Expression>
- Direct Known Subclasses:
ParameterReplacer
A ExpressionVisitor
for converting expressions in some way.
For simple expressions this implementation will return the simple expression.
For complex expressions a new instance of the expression is returned with converted sub expressions.
By default, any tokens associated with the AST will no longer share the same source - if they need to be in agreement, then the tokens can be 'normalized' by re-parsing the expression
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvisit
(BinaryOperation expression, T data) visit
(BracketedExpression expression, T data) visit
(FunctionCall expression, T data) visit
(ListDeclaration expression, T data) visit
(ParameterToken parameterToken, T data) visit
(PropertyAccess expression, T data) visit
(SelectAllExpression expression, T data) visit
(StructDeclaration expression, T data)
-
Constructor Details
-
ExpressionConverter
public ExpressionConverter()
-
-
Method Details
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-
visit
- Specified by:
visit
in interfaceExpressionVisitor<T,
Expression>
-