@@ -0,0 +1,1166 @@
+package jkind.lustre.builders;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport jkind.JKindException;%0Aimport jkind.lustre.Equation;%0Aimport jkind.lustre.Expr;%0Aimport jkind.lustre.IdExpr;%0Aimport jkind.lustre.Location;%0Aimport jkind.lustre.VarDecl;%0A%0Apublic class EquationBuilder %7B%0A%09private List%3CIdExpr%3E lhs = new ArrayList%3C%3E();%0A%09private Expr expr;%0A%0A%09public EquationBuilder() %7B%0A%09%7D%0A%0A%09public EquationBuilder(Equation eq) %7B%0A%09%09lhs.addAll(eq.lhs);%0A%09%09expr = eq.expr;%0A%09%7D%0A%0A%09public EquationBuilder addLhs(IdExpr ide) %7B%0A%09%09this.lhs.add(ide);%0A%09%09return this;%0A%09%7D%0A%0A%09public EquationBuilder addLhs(String id) %7B%0A%09%09this.lhs.add(new IdExpr(id));%0A%09%09return this;%0A%09%7D%0A%0A%09public EquationBuilder addLhs(VarDecl varDecl) %7B%0A%09%09this.lhs.add(new IdExpr(varDecl.id));%0A%09%09return this;%0A%09%7D%0A%0A%09public EquationBuilder clearLhs() %7B%0A%09%09this.lhs.clear();%0A%09%09return this;%0A%09%7D%0A%0A%09public EquationBuilder setExpr(Expr expr) %7B%0A%09%09this.expr = expr;%0A%09%09return this;%0A%09%7D%0A%0A%09public Equation build() %7B%0A%09%09if (lhs.isEmpty()) %7B%0A%09%09%09throw new JKindException(%22left-hand side is empty%22);%0A%09%09%7D%0A%09%09if (expr == null) %7B%0A%09%09%09throw new JKindException(%22right-hand side is empty%22);%0A%09%09%7D%0A%09%09return new Equation(Location.NULL, lhs, expr);%0A%09%7D%0A%7D

Add EquationBuilder