//generated by abstract-syntax-gen package de.peeeq.wurstscript.jassIm; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class ImSetImpl implements ImSet{ ImSetImpl(de.peeeq.wurstscript.ast.Element trace, ImLExpr left, ImExpr right) { if (trace == null) throw new IllegalArgumentException("Element trace must not be null."); if (left == null) throw new IllegalArgumentException("Element left must not be null."); if (right == null) throw new IllegalArgumentException("Element right must not be null."); this.trace = trace; this.left = left; this.right = right; left.setParent(this); right.setParent(this); } private Element parent; public Element getParent() { return parent; } public void setParent(Element parent) { if (parent != null && this.parent != null) { throw new Error("Cannot change parent of element " + this.getClass().getSimpleName() + ", as it is already used in another tree." + "Use the copy method to create a new tree or remove the tree from its old parent or set the parent to null before moving the tree. "); } this.parent = parent; } public void replaceBy(Element other) { if (parent == null) throw new RuntimeException("Node not attached to tree."); for (int i=0; i action) { action.accept(this.left); action.accept(this.right); } public int size() { return 2; } @Override public ImSet copy() { ImSet result = new ImSetImpl(trace, (ImLExpr) this.left.copy(), (ImExpr) this.right.copy()); return result; } @Override public ImSet copyWithRefs() { ImSet res = copy(); return res; } @Override public void clearAttributes() { left.clearAttributes(); right.clearAttributes(); clearAttributesLocal(); } @Override public void clearAttributesLocal() { } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(ImStmt.Matcher matcher) { return matcher.case_ImSet(this); } @Override public void match(ImStmt.MatcherVoid matcher) { matcher.case_ImSet(this); } @Override public T match(ImVarWrite.Matcher matcher) { return matcher.case_ImSet(this); } @Override public void match(ImVarWrite.MatcherVoid matcher) { matcher.case_ImSet(this); } @Override public T match(ElementWithTrace.Matcher matcher) { return matcher.case_ImSet(this); } @Override public void match(ElementWithTrace.MatcherVoid matcher) { matcher.case_ImSet(this); } @Override public T match(ImPrintable.Matcher matcher) { return matcher.case_ImSet(this); } @Override public void match(ImPrintable.MatcherVoid matcher) { matcher.case_ImSet(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_ImSet(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_ImSet(this); } public boolean structuralEquals(Element e) { if (e instanceof ImSet) { ImSet o = (ImSet) e; return this.left.structuralEquals(o.getLeft()) && this.right.structuralEquals(o.getRight()); } else { return false; } } /** */ public void print(java.lang.Appendable sb, int indent) { de.peeeq.wurstscript.translation.imtranslation.ImPrinter.print((ImSet)this, sb, indent); } /** */ public String toString() { return de.peeeq.wurstscript.translation.imtranslation.ImPrinter.asString((ImSet)this); } /** */ public de.peeeq.wurstscript.translation.imtranslation.Flatten.Result flatten(de.peeeq.wurstscript.translation.imtranslation.ImTranslator translator, de.peeeq.wurstscript.jassIm.ImFunction f) { return de.peeeq.wurstscript.translation.imtranslation.Flatten.flatten((ImSet)this, translator, f); } /** */ public de.peeeq.wurstscript.translation.imtranslation.purity.PurityLevel attrPurity() { return de.peeeq.wurstscript.translation.imtranslation.purity.PurityLevels.calculate((ImSet)this); } /** */ public void translate(java.util.List stmts, de.peeeq.wurstscript.jassAst.JassFunction f, de.peeeq.wurstscript.translation.imtojass.ImToJassTranslator translator) { de.peeeq.wurstscript.translation.imtojass.StatementTranslation.translate((ImSet)this, stmts, f, translator); } /** */ public ImFunction getNearestFunc() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getNearestFunc((ImSet)this); } /** */ public void translateStmtToLua(java.util.List res, de.peeeq.wurstscript.translation.lua.translation.LuaTranslator tr) { de.peeeq.wurstscript.translation.lua.translation.StmtTranslation.translate((ImSet)this, res, tr); } /** */ public void runStatement(de.peeeq.wurstscript.intermediatelang.interpreter.ProgramState globalState, de.peeeq.wurstscript.intermediatelang.interpreter.LocalState localState) { de.peeeq.wurstscript.intermediatelang.interpreter.RunStatement.run((ImSet)this, globalState, localState); } /** */ public de.peeeq.wurstscript.ast.Element attrTrace() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getTrace((ImSet)this); } /** */ public ImProg attrProg() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getProg((ImSet)this); } }