diff --git a/AlgebraicDataflowArchitectureModel/src/code/ast/Expression.java b/AlgebraicDataflowArchitectureModel/src/code/ast/Expression.java index d492947..efa14f3 100644 --- a/AlgebraicDataflowArchitectureModel/src/code/ast/Expression.java +++ b/AlgebraicDataflowArchitectureModel/src/code/ast/Expression.java @@ -6,4 +6,14 @@ * @author s-yamagiwa */ public abstract class Expression extends ASTNode { + /** + * Replace {@code variable} with {@code expression} in AST. + * + * @param variable The variable to be replaced + * @param expression The expression that {@code variable} is replaced to + * @return A dupulicated expression that is replaced with a given {@code expression} + * @implNote The instance of any member must be immutable + * @apiNote All variables match to the given one will be replaced with the given {@code expression} + */ + public abstract Expression replace(Variable variable, Expression expression); }