// Generated by delombok at Sun Apr 02 07:47:34 ICT 2017 package ast; import java.util.Collections; import java.util.List; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; import ast.Expression; import ast.Ast.*; import ast.ExpCore.ClassB; import ast.ExpCore.MCall; import ast.ExpCore.ClassB.Member; import ast.ExpCore.ClassB.MethodImplemented; import ast.ExpCore.ClassB.MethodWithType; import ast.ExpCore.ClassB.NestedClass; public interface ExpCore { <T> T accept(coreVisitors.Visitor<T> v); default String toS() { return sugarVisitors.ToFormattedText.of(this); } final class MCall implements ExpCore, HasPos, WithInner<MCall> { private final ExpCore inner; private final MethodSelector s; private final Doc doc; private final List<ExpCore> es; private final Position p; public MCall withEsi(int i, ExpCore ei) { List<ExpCore> es2 = new ArrayList<>(es); es2.set(i, ei); return this.withEs(es2); } @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.beans.ConstructorProperties({"inner", "s", "doc", "es", "p"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MCall(final ExpCore inner, final MethodSelector s, final Doc doc, final List<ExpCore> es, final Position p) { this.inner = inner; this.s = s; this.doc = doc; this.es = es; this.p = p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodSelector getS() { return this.s; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc() { return this.doc; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public List<ExpCore> getEs() { return this.es; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.MCall)) return false; final MCall other = (MCall)o; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; final java.lang.Object this$s = this.getS(); final java.lang.Object other$s = other.getS(); if (this$s == null ? other$s != null : !this$s.equals(other$s)) return false; final java.lang.Object this$doc = this.getDoc(); final java.lang.Object other$doc = other.getDoc(); if (this$doc == null ? other$doc != null : !this$doc.equals(other$doc)) return false; final java.lang.Object this$es = this.getEs(); final java.lang.Object other$es = other.getEs(); if (this$es == null ? other$es != null : !this$es.equals(other$es)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); final java.lang.Object $s = this.getS(); result = result * PRIME + ($s == null ? 0 : $s.hashCode()); final java.lang.Object $doc = this.getDoc(); result = result * PRIME + ($doc == null ? 0 : $doc.hashCode()); final java.lang.Object $es = this.getEs(); result = result * PRIME + ($es == null ? 0 : $es.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.MCall(inner=" + this.getInner() + ", s=" + this.getS() + ", doc=" + this.getDoc() + ", es=" + this.getEs() + ")"; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MCall withInner(final ExpCore inner) { return this.inner == inner ? this : new MCall(inner, this.s, this.doc, this.es, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MCall withS(final MethodSelector s) { return this.s == s ? this : new MCall(this.inner, s, this.doc, this.es, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MCall withDoc(final Doc doc) { return this.doc == doc ? this : new MCall(this.inner, this.s, doc, this.es, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MCall withEs(final List<ExpCore> es) { return this.es == es ? this : new MCall(this.inner, this.s, this.doc, es, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MCall withP(final Position p) { return this.p == p ? this : new MCall(this.inner, this.s, this.doc, this.es, p); } } final class X implements ExpCore, Ast.Atom, HasPos { private final Position p; private final String inner; public String toString() { return this.inner; } @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.beans.ConstructorProperties({"p", "inner"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public X(final Position p, final String inner) { this.p = p; this.inner = inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public String getInner() { return this.inner; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.X)) return false; final X other = (X)o; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } } final class Block implements ExpCore, HasPos, WithInner<Block> { private final Doc doc; private final List<Dec> decs; private final ExpCore inner; private final List<On> ons; private final Position p; public ExpCore getE() { return inner; } public Block withE(ExpCore e) { return this.withInner(e); } public Block withDeci(int i, Dec di) { List<Dec> decs2 = new ArrayList<>(decs); decs2.set(i, di); return this.withDecs(decs2); } public Block withDeci(int i, On oi) { List<On> ons2 = new ArrayList<>(ons); ons2.set(i, oi); return this.withOns(ons2); } @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } public static final class Dec implements WithInner<Dec> { private final Type t; private final String x; private final ExpCore inner; @java.beans.ConstructorProperties({"t", "x", "inner"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Dec(final Type t, final String x, final ExpCore inner) { this.t = t; this.x = x; this.inner = inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Type getT() { return this.t; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public String getX() { return this.x; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.Block.Dec)) return false; final Dec other = (Dec)o; final java.lang.Object this$t = this.getT(); final java.lang.Object other$t = other.getT(); if (this$t == null ? other$t != null : !this$t.equals(other$t)) return false; final java.lang.Object this$x = this.getX(); final java.lang.Object other$x = other.getX(); if (this$x == null ? other$x != null : !this$x.equals(other$x)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $t = this.getT(); result = result * PRIME + ($t == null ? 0 : $t.hashCode()); final java.lang.Object $x = this.getX(); result = result * PRIME + ($x == null ? 0 : $x.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.Block.Dec(t=" + this.getT() + ", x=" + this.getX() + ", inner=" + this.getInner() + ")"; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Dec withT(final Type t) { return this.t == t ? this : new Dec(t, this.x, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Dec withX(final String x) { return this.x == x ? this : new Dec(this.t, x, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Dec withInner(final ExpCore inner) { return this.inner == inner ? this : new Dec(this.t, this.x, inner); } } public List<String> domDecs() { List<String> dom = new java.util.ArrayList<String>(); for (Dec d : this.decs) { dom.add(d.x); } return dom; } public static final class On implements HasPos, WithInner<On> { private final SignalKind kind; private final String x; private final Type t; private final ExpCore inner; private final Position p; public ExpCore getE() { return inner; } public On withE(ExpCore e) { return this.withInner(e); } @java.beans.ConstructorProperties({"kind", "x", "t", "inner", "p"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public On(final SignalKind kind, final String x, final Type t, final ExpCore inner, final Position p) { this.kind = kind; this.x = x; this.t = t; this.inner = inner; this.p = p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public SignalKind getKind() { return this.kind; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public String getX() { return this.x; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Type getT() { return this.t; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public On withKind(final SignalKind kind) { return this.kind == kind ? this : new On(kind, this.x, this.t, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public On withX(final String x) { return this.x == x ? this : new On(this.kind, x, this.t, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public On withT(final Type t) { return this.t == t ? this : new On(this.kind, this.x, t, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public On withInner(final ExpCore inner) { return this.inner == inner ? this : new On(this.kind, this.x, this.t, inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public On withP(final Position p) { return this.p == p ? this : new On(this.kind, this.x, this.t, this.inner, p); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.Block.On)) return false; final On other = (On)o; final java.lang.Object this$kind = this.getKind(); final java.lang.Object other$kind = other.getKind(); if (this$kind == null ? other$kind != null : !this$kind.equals(other$kind)) return false; final java.lang.Object this$x = this.getX(); final java.lang.Object other$x = other.getX(); if (this$x == null ? other$x != null : !this$x.equals(other$x)) return false; final java.lang.Object this$t = this.getT(); final java.lang.Object other$t = other.getT(); if (this$t == null ? other$t != null : !this$t.equals(other$t)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $kind = this.getKind(); result = result * PRIME + ($kind == null ? 0 : $kind.hashCode()); final java.lang.Object $x = this.getX(); result = result * PRIME + ($x == null ? 0 : $x.hashCode()); final java.lang.Object $t = this.getT(); result = result * PRIME + ($t == null ? 0 : $t.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.Block.On(kind=" + this.getKind() + ", x=" + this.getX() + ", t=" + this.getT() + ", inner=" + this.getInner() + ")"; } } @java.beans.ConstructorProperties({"doc", "decs", "inner", "ons", "p"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Block(final Doc doc, final List<Dec> decs, final ExpCore inner, final List<On> ons, final Position p) { this.doc = doc; this.decs = decs; this.inner = inner; this.ons = ons; this.p = p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc() { return this.doc; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public List<Dec> getDecs() { return this.decs; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public List<On> getOns() { return this.ons; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.Block)) return false; final Block other = (Block)o; final java.lang.Object this$doc = this.getDoc(); final java.lang.Object other$doc = other.getDoc(); if (this$doc == null ? other$doc != null : !this$doc.equals(other$doc)) return false; final java.lang.Object this$decs = this.getDecs(); final java.lang.Object other$decs = other.getDecs(); if (this$decs == null ? other$decs != null : !this$decs.equals(other$decs)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; final java.lang.Object this$ons = this.getOns(); final java.lang.Object other$ons = other.getOns(); if (this$ons == null ? other$ons != null : !this$ons.equals(other$ons)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $doc = this.getDoc(); result = result * PRIME + ($doc == null ? 0 : $doc.hashCode()); final java.lang.Object $decs = this.getDecs(); result = result * PRIME + ($decs == null ? 0 : $decs.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); final java.lang.Object $ons = this.getOns(); result = result * PRIME + ($ons == null ? 0 : $ons.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.Block(doc=" + this.getDoc() + ", decs=" + this.getDecs() + ", inner=" + this.getInner() + ", ons=" + this.getOns() + ")"; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Block withDoc(final Doc doc) { return this.doc == doc ? this : new Block(doc, this.decs, this.inner, this.ons, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Block withDecs(final List<Dec> decs) { return this.decs == decs ? this : new Block(this.doc, decs, this.inner, this.ons, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Block withInner(final ExpCore inner) { return this.inner == inner ? this : new Block(this.doc, this.decs, inner, this.ons, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Block withOns(final List<On> ons) { return this.ons == ons ? this : new Block(this.doc, this.decs, this.inner, ons, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Block withP(final Position p) { return this.p == p ? this : new Block(this.doc, this.decs, this.inner, this.ons, p); } } /*@ToString(exclude ="p")*/ final class ClassB implements ExpCore, Ast.Atom, HasPos { public ClassB(Doc doc1, boolean isInterface, List<Type> supertypes, List<Member> ms, Position p, Phase phase, int uniqueId) { this.doc1 = doc1; this.isInterface = isInterface; this.supertypes = supertypes; this.ms = ms; this.p = p; this.phase = phase; this.uniqueId = uniqueId; assert isConsistent(); }//lombock fails me here :-( private final Doc doc1; private final boolean isInterface; private final List<Ast.Type> supertypes; private final List<Member> ms; private final Position p; private final Phase phase; private final int uniqueId; // In the future, we may remove members and add mwts and ns, now we add delegation constructors/getters public ClassB(Doc doc1, boolean isInterface, List<Type> supertypes, List<ClassB.MethodWithType> mwts, List<ClassB.NestedClass> ns, Position p, Phase phase, int uniqueId) { this(doc1, isInterface, supertypes, java.util.stream.Stream.concat(mwts.stream(), ns.stream()).collect(Collectors.toList()), p, phase, uniqueId); } public List<ClassB.MethodWithType> mwts() { return ms.stream().filter(e -> e instanceof ClassB.MethodWithType).map(e -> (ClassB.MethodWithType)e).collect(Collectors.toList()); } public List<ClassB.NestedClass> ns() { return ms.stream().filter(e -> e instanceof ClassB.NestedClass).map(e -> (ClassB.NestedClass)e).collect(Collectors.toList()); } public String toString() { return sugarVisitors.ToFormattedText.of(this); } public boolean isConsistent() { return _Aux.isConsistent(this); } public ClassB withMember(Member m) { return _Aux.withMember(this, m); } public Member _getMember(ast.Ast.MethodSelector ms) { return _Aux._getMember(this, ms); } public ClassB onClassNavigateToPathAndDo(List<Ast.C> cs, Function<ClassB, ClassB> op) { return _Aux.onClassNavigateToPathAndDo(this, cs, op); } public ClassB onNestedNavigateToPathAndDo(List<Ast.C> cs, Function<ClassB.NestedClass, Optional<ClassB.NestedClass>> op) { return _Aux.onNestedNavigateToPathAndDo(this, cs, op); } public ExpCore.ClassB.NestedClass getNested(List<Ast.C> cs) { return _Aux.getNested(this, cs); } public List<ExpCore.ClassB.NestedClass> getNestedList(List<Ast.C> cs) { return _Aux.getNestedList(this, cs); } public ExpCore.ClassB getClassB(List<Ast.C> cs) { return _Aux.getClassB(this, cs); } public static ExpCore.ClassB docClass(Doc d) { return new ClassB(d, false, Collections.emptyList(), Collections.emptyList(), Position.noInfo, Phase.Typed, 0); } public static ExpCore.ClassB membersClass(List<Member> ms, Position pos, Phase phase) { return new ClassB(Doc.empty(), false, Collections.emptyList(), ms, pos, phase, 0); } public List<Path> getSuperPaths() { return this.getSupertypes().stream().map(t -> t.getNT().getPath()).collect(Collectors.toList()); } @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } public static enum Phase { None, Norm, Typed, Coherent; public Phase acc(Phase that) { if (this.subtypeEq(that)) { return that; } return this; } public boolean subtypeEq(Phase that) { return this.ordinal() >= that.ordinal(); } } public interface Member extends HasPos, WithInner<Member> { <T> T match(Function<NestedClass, T> nc, Function<MethodImplemented, T> mi, Function<MethodWithType, T> mt); } public static final class NestedClass implements Member { @NonNull private final Doc doc; @NonNull private final Ast.C name; @NonNull private final ExpCore inner; private final Position p; public ExpCore getE() { return inner; } public NestedClass withE(ExpCore e) { return this.withInner(e); } public <T> T match(Function<NestedClass, T> nc, Function<MethodImplemented, T> mi, Function<MethodWithType, T> mt) { return nc.apply(this); } @java.beans.ConstructorProperties({"doc", "name", "inner", "p"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NestedClass(@NonNull final Doc doc, @NonNull final Ast.C name, @NonNull final ExpCore inner, final Position p) { if (doc == null) { throw new java.lang.NullPointerException("doc"); } if (name == null) { throw new java.lang.NullPointerException("name"); } if (inner == null) { throw new java.lang.NullPointerException("inner"); } this.doc = doc; this.name = name; this.inner = inner; this.p = p; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc() { return this.doc; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Ast.C getName() { return this.name; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NestedClass withDoc(@NonNull final Doc doc) { if (doc == null) { throw new java.lang.NullPointerException("doc"); } return this.doc == doc ? this : new NestedClass(doc, this.name, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NestedClass withName(@NonNull final Ast.C name) { if (name == null) { throw new java.lang.NullPointerException("name"); } return this.name == name ? this : new NestedClass(this.doc, name, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NestedClass withInner(@NonNull final ExpCore inner) { if (inner == null) { throw new java.lang.NullPointerException("inner"); } return this.inner == inner ? this : new NestedClass(this.doc, this.name, inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NestedClass withP(final Position p) { return this.p == p ? this : new NestedClass(this.doc, this.name, this.inner, p); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.ClassB.NestedClass)) return false; final NestedClass other = (NestedClass)o; final java.lang.Object this$doc = this.getDoc(); final java.lang.Object other$doc = other.getDoc(); if (this$doc == null ? other$doc != null : !this$doc.equals(other$doc)) return false; final java.lang.Object this$name = this.getName(); final java.lang.Object other$name = other.getName(); if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $doc = this.getDoc(); result = result * PRIME + ($doc == null ? 0 : $doc.hashCode()); final java.lang.Object $name = this.getName(); result = result * PRIME + ($name == null ? 0 : $name.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.ClassB.NestedClass(doc=" + this.getDoc() + ", name=" + this.getName() + ", inner=" + this.getInner() + ")"; } } /*,"mt"*//*,"mt"*/ public static final class MethodImplemented implements Member { @NonNull private final Doc doc; @NonNull private final MethodSelector s; @NonNull private final ExpCore inner; private final Position p; public ExpCore getE() { return inner; } public MethodImplemented withE(ExpCore e) { return this.withInner(e); } public <T> T match(Function<NestedClass, T> nc, Function<MethodImplemented, T> mi, Function<MethodWithType, T> mt) { return mi.apply(this); } @java.beans.ConstructorProperties({"doc", "s", "inner", "p"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodImplemented(@NonNull final Doc doc, @NonNull final MethodSelector s, @NonNull final ExpCore inner, final Position p) { if (doc == null) { throw new java.lang.NullPointerException("doc"); } if (s == null) { throw new java.lang.NullPointerException("s"); } if (inner == null) { throw new java.lang.NullPointerException("inner"); } this.doc = doc; this.s = s; this.inner = inner; this.p = p; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc() { return this.doc; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodSelector getS() { return this.s; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodImplemented withDoc(@NonNull final Doc doc) { if (doc == null) { throw new java.lang.NullPointerException("doc"); } return this.doc == doc ? this : new MethodImplemented(doc, this.s, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodImplemented withS(@NonNull final MethodSelector s) { if (s == null) { throw new java.lang.NullPointerException("s"); } return this.s == s ? this : new MethodImplemented(this.doc, s, this.inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodImplemented withInner(@NonNull final ExpCore inner) { if (inner == null) { throw new java.lang.NullPointerException("inner"); } return this.inner == inner ? this : new MethodImplemented(this.doc, this.s, inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodImplemented withP(final Position p) { return this.p == p ? this : new MethodImplemented(this.doc, this.s, this.inner, p); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.ClassB.MethodImplemented)) return false; final MethodImplemented other = (MethodImplemented)o; final java.lang.Object this$doc = this.getDoc(); final java.lang.Object other$doc = other.getDoc(); if (this$doc == null ? other$doc != null : !this$doc.equals(other$doc)) return false; final java.lang.Object this$s = this.getS(); final java.lang.Object other$s = other.getS(); if (this$s == null ? other$s != null : !this$s.equals(other$s)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $doc = this.getDoc(); result = result * PRIME + ($doc == null ? 0 : $doc.hashCode()); final java.lang.Object $s = this.getS(); result = result * PRIME + ($s == null ? 0 : $s.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.ClassB.MethodImplemented(doc=" + this.getDoc() + ", s=" + this.getS() + ", inner=" + this.getInner() + ")"; } } public static final class MethodWithType implements Member { @NonNull private final Doc doc; @NonNull private final MethodSelector ms; @NonNull private final MethodType mt; @NonNull private final Optional<ExpCore> _inner; private final Position p; public ExpCore getInner() { return _inner.get(); }//and boom if there is not public MethodWithType withInner(ExpCore e) { return this.with_inner(Optional.of(e)); } public <T> T match(Function<NestedClass, T> nc, Function<MethodImplemented, T> mi, Function<MethodWithType, T> mt) { return mt.apply(this); } @java.beans.ConstructorProperties({"doc", "ms", "mt", "_inner", "p"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodWithType(@NonNull final Doc doc, @NonNull final MethodSelector ms, @NonNull final MethodType mt, @NonNull final Optional<ExpCore> _inner, final Position p) { if (doc == null) { throw new java.lang.NullPointerException("doc"); } if (ms == null) { throw new java.lang.NullPointerException("ms"); } if (mt == null) { throw new java.lang.NullPointerException("mt"); } if (_inner == null) { throw new java.lang.NullPointerException("_inner"); } this.doc = doc; this.ms = ms; this.mt = mt; this._inner = _inner; this.p = p; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc() { return this.doc; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodSelector getMs() { return this.ms; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodType getMt() { return this.mt; } @NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Optional<ExpCore> get_inner() { return this._inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodWithType withDoc(@NonNull final Doc doc) { if (doc == null) { throw new java.lang.NullPointerException("doc"); } return this.doc == doc ? this : new MethodWithType(doc, this.ms, this.mt, this._inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodWithType withMs(@NonNull final MethodSelector ms) { if (ms == null) { throw new java.lang.NullPointerException("ms"); } return this.ms == ms ? this : new MethodWithType(this.doc, ms, this.mt, this._inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodWithType withMt(@NonNull final MethodType mt) { if (mt == null) { throw new java.lang.NullPointerException("mt"); } return this.mt == mt ? this : new MethodWithType(this.doc, this.ms, mt, this._inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodWithType with_inner(@NonNull final Optional<ExpCore> _inner) { if (_inner == null) { throw new java.lang.NullPointerException("_inner"); } return this._inner == _inner ? this : new MethodWithType(this.doc, this.ms, this.mt, _inner, this.p); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodWithType withP(final Position p) { return this.p == p ? this : new MethodWithType(this.doc, this.ms, this.mt, this._inner, p); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.ClassB.MethodWithType)) return false; final MethodWithType other = (MethodWithType)o; final java.lang.Object this$doc = this.getDoc(); final java.lang.Object other$doc = other.getDoc(); if (this$doc == null ? other$doc != null : !this$doc.equals(other$doc)) return false; final java.lang.Object this$ms = this.getMs(); final java.lang.Object other$ms = other.getMs(); if (this$ms == null ? other$ms != null : !this$ms.equals(other$ms)) return false; final java.lang.Object this$mt = this.getMt(); final java.lang.Object other$mt = other.getMt(); if (this$mt == null ? other$mt != null : !this$mt.equals(other$mt)) return false; final java.lang.Object this$_inner = this.get_inner(); final java.lang.Object other$_inner = other.get_inner(); if (this$_inner == null ? other$_inner != null : !this$_inner.equals(other$_inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $doc = this.getDoc(); result = result * PRIME + ($doc == null ? 0 : $doc.hashCode()); final java.lang.Object $ms = this.getMs(); result = result * PRIME + ($ms == null ? 0 : $ms.hashCode()); final java.lang.Object $mt = this.getMt(); result = result * PRIME + ($mt == null ? 0 : $mt.hashCode()); final java.lang.Object $_inner = this.get_inner(); result = result * PRIME + ($_inner == null ? 0 : $_inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.ClassB.MethodWithType(doc=" + this.getDoc() + ", ms=" + this.getMs() + ", mt=" + this.getMt() + ", _inner=" + this.get_inner() + ")"; } } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc1() { return this.doc1; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean isInterface() { return this.isInterface; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public List<Ast.Type> getSupertypes() { return this.supertypes; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public List<Member> getMs() { return this.ms; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Phase getPhase() { return this.phase; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int getUniqueId() { return this.uniqueId; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withDoc1(final Doc doc1) { return this.doc1 == doc1 ? this : new ClassB(doc1, this.isInterface, this.supertypes, this.ms, this.p, this.phase, this.uniqueId); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withInterface(final boolean isInterface) { return this.isInterface == isInterface ? this : new ClassB(this.doc1, isInterface, this.supertypes, this.ms, this.p, this.phase, this.uniqueId); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withSupertypes(final List<Ast.Type> supertypes) { return this.supertypes == supertypes ? this : new ClassB(this.doc1, this.isInterface, supertypes, this.ms, this.p, this.phase, this.uniqueId); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withMs(final List<Member> ms) { return this.ms == ms ? this : new ClassB(this.doc1, this.isInterface, this.supertypes, ms, this.p, this.phase, this.uniqueId); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withP(final Position p) { return this.p == p ? this : new ClassB(this.doc1, this.isInterface, this.supertypes, this.ms, p, this.phase, this.uniqueId); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withPhase(final Phase phase) { return this.phase == phase ? this : new ClassB(this.doc1, this.isInterface, this.supertypes, this.ms, this.p, phase, this.uniqueId); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ClassB withUniqueId(final int uniqueId) { return this.uniqueId == uniqueId ? this : new ClassB(this.doc1, this.isInterface, this.supertypes, this.ms, this.p, this.phase, uniqueId); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.ClassB)) return false; final ClassB other = (ClassB)o; final java.lang.Object this$doc1 = this.getDoc1(); final java.lang.Object other$doc1 = other.getDoc1(); if (this$doc1 == null ? other$doc1 != null : !this$doc1.equals(other$doc1)) return false; if (this.isInterface() != other.isInterface()) return false; final java.lang.Object this$supertypes = this.getSupertypes(); final java.lang.Object other$supertypes = other.getSupertypes(); if (this$supertypes == null ? other$supertypes != null : !this$supertypes.equals(other$supertypes)) return false; final java.lang.Object this$ms = this.getMs(); final java.lang.Object other$ms = other.getMs(); if (this$ms == null ? other$ms != null : !this$ms.equals(other$ms)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $doc1 = this.getDoc1(); result = result * PRIME + ($doc1 == null ? 0 : $doc1.hashCode()); result = result * PRIME + (this.isInterface() ? 79 : 97); final java.lang.Object $supertypes = this.getSupertypes(); result = result * PRIME + ($supertypes == null ? 0 : $supertypes.hashCode()); final java.lang.Object $ms = this.getMs(); result = result * PRIME + ($ms == null ? 0 : $ms.hashCode()); return result; } } final class _void implements ExpCore, Ast.Atom { @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public _void() { } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore._void)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore._void()"; } } final class EPath implements ExpCore, HasPos, Atom { private final Position p; private final Ast.Path inner; public String toString() { return this.getInner().toString(); } public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } public static EPath wrap(Ast.Path p) { return new EPath(Position.noInfo, p); } @java.beans.ConstructorProperties({"p", "inner"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public EPath(final Position p, final Ast.Path inner) { this.p = p; this.inner = inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Position getP() { return this.p; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Ast.Path getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public EPath withP(final Position p) { return this.p == p ? this : new EPath(p, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public EPath withInner(final Ast.Path inner) { return this.inner == inner ? this : new EPath(this.p, inner); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.EPath)) return false; final EPath other = (EPath)o; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } } final class WalkBy implements ExpCore { @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public WalkBy() { } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.WalkBy)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.WalkBy()"; } } final class Using implements ExpCore, WithInner<Using> { private final Path path; private final MethodSelector s; private final Doc doc; private final List<ExpCore> es; private final ExpCore inner; public Using(Path path, MethodSelector s, Doc doc, List<ExpCore> es, ExpCore inner) { this.path = path; this.s = s; this.doc = doc; this.es = es; this.inner = inner; assert s.getNames().size() == es.size(); } public Using withEsi(int i, ExpCore ei) { List<ExpCore> es2 = new ArrayList<>(es); es2.set(i, ei); return this.withEs(es2); } @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Path getPath() { return this.path; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public MethodSelector getS() { return this.s; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Doc getDoc() { return this.doc; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public List<ExpCore> getEs() { return this.es; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.Using)) return false; final Using other = (Using)o; final java.lang.Object this$path = this.getPath(); final java.lang.Object other$path = other.getPath(); if (this$path == null ? other$path != null : !this$path.equals(other$path)) return false; final java.lang.Object this$s = this.getS(); final java.lang.Object other$s = other.getS(); if (this$s == null ? other$s != null : !this$s.equals(other$s)) return false; final java.lang.Object this$doc = this.getDoc(); final java.lang.Object other$doc = other.getDoc(); if (this$doc == null ? other$doc != null : !this$doc.equals(other$doc)) return false; final java.lang.Object this$es = this.getEs(); final java.lang.Object other$es = other.getEs(); if (this$es == null ? other$es != null : !this$es.equals(other$es)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $path = this.getPath(); result = result * PRIME + ($path == null ? 0 : $path.hashCode()); final java.lang.Object $s = this.getS(); result = result * PRIME + ($s == null ? 0 : $s.hashCode()); final java.lang.Object $doc = this.getDoc(); result = result * PRIME + ($doc == null ? 0 : $doc.hashCode()); final java.lang.Object $es = this.getEs(); result = result * PRIME + ($es == null ? 0 : $es.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.Using(path=" + this.getPath() + ", s=" + this.getS() + ", doc=" + this.getDoc() + ", es=" + this.getEs() + ", inner=" + this.getInner() + ")"; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Using withPath(final Path path) { return this.path == path ? this : new Using(path, this.s, this.doc, this.es, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Using withS(final MethodSelector s) { return this.s == s ? this : new Using(this.path, s, this.doc, this.es, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Using withDoc(final Doc doc) { return this.doc == doc ? this : new Using(this.path, this.s, doc, this.es, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Using withEs(final List<ExpCore> es) { return this.es == es ? this : new Using(this.path, this.s, this.doc, es, this.inner); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Using withInner(final ExpCore inner) { return this.inner == inner ? this : new Using(this.path, this.s, this.doc, this.es, inner); } } final class Signal implements ExpCore, WithInner<Signal> { private final SignalKind kind; private final ExpCore inner; private final NormType typeOut; private final NormType typeIn; @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.beans.ConstructorProperties({"kind", "inner", "typeOut", "typeIn"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Signal(final SignalKind kind, final ExpCore inner, final NormType typeOut, final NormType typeIn) { this.kind = kind; this.inner = inner; this.typeOut = typeOut; this.typeIn = typeIn; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public SignalKind getKind() { return this.kind; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NormType getTypeOut() { return this.typeOut; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public NormType getTypeIn() { return this.typeIn; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Signal withKind(final SignalKind kind) { return this.kind == kind ? this : new Signal(kind, this.inner, this.typeOut, this.typeIn); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Signal withInner(final ExpCore inner) { return this.inner == inner ? this : new Signal(this.kind, inner, this.typeOut, this.typeIn); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Signal withTypeOut(final NormType typeOut) { return this.typeOut == typeOut ? this : new Signal(this.kind, this.inner, typeOut, this.typeIn); } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Signal withTypeIn(final NormType typeIn) { return this.typeIn == typeIn ? this : new Signal(this.kind, this.inner, this.typeOut, typeIn); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.Signal)) return false; final Signal other = (Signal)o; final java.lang.Object this$kind = this.getKind(); final java.lang.Object other$kind = other.getKind(); if (this$kind == null ? other$kind != null : !this$kind.equals(other$kind)) return false; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $kind = this.getKind(); result = result * PRIME + ($kind == null ? 0 : $kind.hashCode()); final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.Signal(kind=" + this.getKind() + ", inner=" + this.getInner() + ")"; } } final class Loop implements ExpCore, WithInner<Loop> { private final ExpCore inner; @Override public <T> T accept(coreVisitors.Visitor<T> v) { return v.visit(this); } @java.beans.ConstructorProperties({"inner"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Loop(final ExpCore inner) { this.inner = inner; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public ExpCore getInner() { return this.inner; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ExpCore.Loop)) return false; final Loop other = (Loop)o; final java.lang.Object this$inner = this.getInner(); final java.lang.Object other$inner = other.getInner(); if (this$inner == null ? other$inner != null : !this$inner.equals(other$inner)) return false; return true; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $inner = this.getInner(); result = result * PRIME + ($inner == null ? 0 : $inner.hashCode()); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ExpCore.Loop(inner=" + this.getInner() + ")"; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public Loop withInner(final ExpCore inner) { return this.inner == inner ? this : new Loop(inner); } } interface WithInner<T> { ExpCore getInner(); T withInner(ExpCore e); } } class _Aux { static ClassB wrapCast(ExpCore e) { try { return (ClassB)e; } catch (ClassCastException cce) { throw new ErrorMessage.PathMetaOrNonExistant(true, null, null, null, null); } } static void checkIndex(int index) { if (index == -1) { throw new ErrorMessage.PathMetaOrNonExistant(false, null, null, null, null); } } static ClassB onNestedNavigateToPathAndDo(ClassB cb, List<Ast.C> cs, Function<NestedClass, Optional<NestedClass>> op) { assert !cs.isEmpty(); assert cb != null; List<Member> newMs = new ArrayList<>(cb.getMs()); Ast.C nName = cs.get(0); int index = getIndex(newMs, nName); checkIndex(index); NestedClass nc = (NestedClass)newMs.get(index); if (cs.size() > 1) { nc = nc.withInner(onNestedNavigateToPathAndDo(wrapCast(nc.getInner()), cs.subList(1, cs.size()), op)); newMs.set(index, nc); return cb.withMs(newMs); } assert cs.size() == 1; Optional<NestedClass> optNc = op.apply(nc); if (optNc.isPresent()) { newMs.set(index, optNc.get()); } else { newMs.remove(index); } return cb.withMs(newMs); } static ClassB onClassNavigateToPathAndDo(ClassB cb, List<Ast.C> cs, Function<ClassB, ClassB> op) { if (cs.isEmpty()) { return op.apply(cb); } List<Member> newMs = new ArrayList<>(cb.getMs()); Ast.C nName = cs.get(0); int index = getIndex(newMs, nName); checkIndex(index); NestedClass nc = (NestedClass)newMs.get(index); if (cs.size() > 1) { nc = nc.withInner(onClassNavigateToPathAndDo(wrapCast(nc.getInner()), cs.subList(1, cs.size()), op)); newMs.set(index, nc); return cb.withMs(newMs); } assert cs.size() == 1; ClassB newCb = op.apply(wrapCast(nc.getInner())); newMs.set(index, nc.withInner(newCb)); return cb.withMs(newMs); } static int getIndex(List<ExpCore.ClassB.Member> map, ast.Ast.MethodSelector elem) { int i = -1; for (ExpCore.ClassB.Member m : map) { i++; if (m.match(nc -> false, mi -> mi.getS().equals(elem), mt -> mt.getMs().equals(elem))) { return i; } } return -1; } static int getIndex(List<ExpCore.ClassB.Member> map, Ast.C elem) { int i = -1; for (ExpCore.ClassB.Member m : map) { i++; if (m.match(nc -> nc.getName().equals(elem), mi -> false, mt -> false)) { return i; } } return -1; } static int getIndex(List<ExpCore.ClassB.Member> map, ExpCore.ClassB.Member elem) { return elem.match(nc -> getIndex(map, nc.getName()), mi -> getIndex(map, mi.getS()), mt -> getIndex(map, mt.getMs())); } static ExpCore.ClassB.NestedClass getNested(ExpCore.ClassB cb, List<Ast.C> cs) { assert !cs.isEmpty(); Ast.C nName = cs.get(0); int index = getIndex(cb.getMs(), nName); checkIndex(index); NestedClass nc = (NestedClass)cb.getMs().get(index); if (cs.size() == 1) { return nc; } return getNested(wrapCast(nc.getInner()), cs.subList(1, cs.size())); } static List<ExpCore.ClassB.NestedClass> getNestedList(ExpCore.ClassB cb, List<Ast.C> cs) { assert !cs.isEmpty(); List<ExpCore.ClassB.NestedClass> result = new ArrayList<>(); getNestedList(cb, cs, result); return result; } static void getNestedList(ExpCore.ClassB cb, List<Ast.C> cs, List<ExpCore.ClassB.NestedClass> result) { Ast.C nName = cs.get(0); int index = getIndex(cb.getMs(), nName); checkIndex(index); NestedClass nc = (NestedClass)cb.getMs().get(index); result.add(nc); if (cs.size() != 1) { getNestedList(wrapCast(nc.getInner()), cs.subList(1, cs.size()), result); } } static ExpCore.ClassB getClassB(ExpCore.ClassB cb, List<Ast.C> cs) { if (cs.isEmpty()) { return cb; } return wrapCast(getNested(cb, cs).getInner()); } static ClassB withMember(ClassB cb, Member m) { assert cb.isConsistent(); List<Member> newMs = new java.util.ArrayList<>(cb.getMs()); int index = _Aux.getIndex(newMs, m); if (index == -1) { newMs.add(m); } else { newMs.set(index, m); } ClassB result = cb.withMs(newMs); return result; } static ClassB.Member _getMember(ClassB cb, ast.Ast.MethodSelector ms) { assert cb.isConsistent(); int index = _Aux.getIndex(cb.getMs(), ms); if (index == -1) { return null; } return cb.getMs().get(index); } static boolean isConsistent(ClassB cb) { int countWalkBy = 0; HashSet<String> keys = new HashSet<String>(); for (Member m : cb.getMs()) { if (m instanceof MethodWithType) { MethodWithType mwt = (MethodWithType)m; String key = mwt.getMs().toString(); assert !keys.contains(key); keys.add(key); //assert mwt.getMt().getTDocs().size() == mwt.getMt().getTs().size(); } if (m instanceof NestedClass) { NestedClass nc = (NestedClass)m; String key = nc.getName().toString(); assert !keys.contains(key); keys.add(key); if (nc.getInner() instanceof ExpCore.WalkBy) { countWalkBy += 1; } } if (m instanceof MethodImplemented) { MethodImplemented mi = (MethodImplemented)m; String key = mi.getS().toString(); assert !keys.contains(key); keys.add(key); } } //TODO: re enable with new TS/reduction //assert (cb.getPhase()==ast.ExpCore.ClassB.Phase.None && cb.getUniqueId().isEmpty()) // || ((cb.getPhase()!=ast.ExpCore.ClassB.Phase.None && !cb.getUniqueId().isEmpty()) ); assert countWalkBy <= 1 : cb; return true; } }