//generated by abstract-syntax-gen package de.peeeq.wurstscript.jassIm; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class ImVarImpl implements ImVar{ ImVarImpl(de.peeeq.wurstscript.ast.Element trace, ImType type, String name, boolean isBJ) { if (trace == null) throw new IllegalArgumentException("Element trace must not be null."); if (type == null) throw new IllegalArgumentException("Element type must not be null."); if (name == null) throw new IllegalArgumentException("Element name must not be null."); this.trace = trace; this.type = type; this.name = name; this.isBJ = isBJ; } 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) { } public int size() { return 0; } @Override public ImVar copy() { ImVar result = new ImVarImpl(trace, type, name, isBJ); return result; } @Override public ImVar copyWithRefs() { ImVar res = copy(); return res; } @Override public void clearAttributes() { clearAttributesLocal(); } @Override public void clearAttributesLocal() { zzattr_attrWrites_state = 0; zzattr_attrReads_state = 0; } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(JassImElementWithName.Matcher matcher) { return matcher.case_ImVar(this); } @Override public void match(JassImElementWithName.MatcherVoid matcher) { matcher.case_ImVar(this); } @Override public T match(ElementWithTrace.Matcher matcher) { return matcher.case_ImVar(this); } @Override public void match(ElementWithTrace.MatcherVoid matcher) { matcher.case_ImVar(this); } @Override public T match(ImPrintable.Matcher matcher) { return matcher.case_ImVar(this); } @Override public void match(ImPrintable.MatcherVoid matcher) { matcher.case_ImVar(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_ImVar(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_ImVar(this); } public boolean structuralEquals(Element e) { if (e instanceof ImVar) { ImVar o = (ImVar) e; return this.type == o.getType() && java.util.Objects.equals(name, o.getName()) && java.util.Objects.equals(isBJ, o.getIsBJ()); } else { return false; } } /** */ public void print(java.lang.Appendable sb, int indent) { de.peeeq.wurstscript.translation.imtranslation.ImPrinter.print((ImVar)this, sb, indent); } /** */ public String toString() { return de.peeeq.wurstscript.translation.imtranslation.ImPrinter.asString((ImVar)this); } /** */ public ImFunction getNearestFunc() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getNearestFunc((ImVar)this); } /** */ public boolean isGlobal() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.isGlobal((ImVar)this); } /** */ public de.peeeq.wurstscript.ast.Element attrTrace() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getTrace((ImVar)this); } /** */ public ImProg attrProg() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getProg((ImVar)this); } // circular = null private int zzattr_attrWrites_state = 0; private java.util.Collection zzattr_attrWrites_cache; /** */ public java.util.Collection attrWrites() { if (zzattr_attrWrites_state == 0) { try { zzattr_attrWrites_state = 1; zzattr_attrWrites_cache = de.peeeq.wurstscript.translation.imoptimizer.VariableUses.getVarWrites((ImVar)this); } finally { zzattr_attrWrites_state = 0; } zzattr_attrWrites_state = 2; } else if (zzattr_attrWrites_state == 1) { throw new CyclicDependencyError(this, "attrWrites"); } return zzattr_attrWrites_cache; } // circular = null private int zzattr_attrReads_state = 0; private java.util.Collection zzattr_attrReads_cache; /** */ public java.util.Collection attrReads() { if (zzattr_attrReads_state == 0) { try { zzattr_attrReads_state = 1; zzattr_attrReads_cache = de.peeeq.wurstscript.translation.imoptimizer.VariableUses.getVarReads((ImVar)this); } finally { zzattr_attrReads_state = 0; } zzattr_attrReads_state = 2; } else if (zzattr_attrReads_state == 1) { throw new CyclicDependencyError(this, "attrReads"); } return zzattr_attrReads_cache; } }