//generated by abstract-syntax-gen package de.peeeq.wurstscript.jassAst; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class JassProgsImpl extends JassProgs { 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) this).set(i, (JassProg) newElement); } @Override public T match(Element.Matcher matcher) { return matcher.case_JassProgs(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_JassProgs(this); } @Override public void accept(Visitor v) { v.visit(this); } @Override public void clearAttributes() { for (JassProg child : this) { child.clearAttributes(); } clearAttributesLocal(); } @Override public void clearAttributesLocal() { zzattr_getExtendsMap_state = 0; zzattr_getLine_state = 0; zzattr_getProg_state = 0; } // circular = null private int zzattr_getExtendsMap_state = 0; private java.util.Map zzattr_getExtendsMap_cache; /** */ public java.util.Map getExtendsMap() { if (zzattr_getExtendsMap_state == 0) { try { zzattr_getExtendsMap_state = 1; zzattr_getExtendsMap_cache = de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.getExtendsMap((JassProgs)this); } finally { zzattr_getExtendsMap_state = 0; } zzattr_getExtendsMap_state = 2; } else if (zzattr_getExtendsMap_state == 1) { throw new CyclicDependencyError(this, "getExtendsMap"); } return zzattr_getExtendsMap_cache; } /** */ public void addFunction(JassFunction f) { de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.addFunction((JassProgs)this, f); } /** */ public void addNative(JassNative n) { de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.addNative((JassProgs)this, n); } /** */ public void addGlobal(JassVar v) { de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.addGlobal((JassProgs)this, v); } /** */ public void addTypeDef(JassTypeDef t) { de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.addTypeDef((JassProgs)this, t); } /** */ public JassFunction getFunction(String name) { return de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.getFunction((JassProgs)this, name); } /** */ public JassNative getNative(String name) { return de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.getNative((JassProgs)this, name); } /** */ public JassVar getGlobal(String name) { return de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.getGlobal((JassProgs)this, name); } /** */ public JassTypeDef getTypeDef(String name) { return de.peeeq.wurstscript.frotty.jassAttributes.JassProgsAttr.getTypeDef((JassProgs)this, name); } // circular = null private int zzattr_getLine_state = 0; private int zzattr_getLine_cache; /** */ public int getLine() { if (zzattr_getLine_state == 0) { try { zzattr_getLine_state = 1; zzattr_getLine_cache = de.peeeq.wurstscript.frotty.jassValidator.LineMapAttr.getLine((JassProgs)this); } finally { zzattr_getLine_state = 0; } zzattr_getLine_state = 2; } else if (zzattr_getLine_state == 1) { throw new CyclicDependencyError(this, "getLine"); } return zzattr_getLine_cache; } // circular = null private int zzattr_getProg_state = 0; private JassProg zzattr_getProg_cache; /** */ public JassProg getProg() { if (zzattr_getProg_state == 0) { try { zzattr_getProg_state = 1; zzattr_getProg_cache = de.peeeq.wurstscript.frotty.jassValidator.LineMapAttr.getProg((JassProgs)this); } finally { zzattr_getProg_state = 0; } zzattr_getProg_state = 2; } else if (zzattr_getProg_state == 1) { throw new CyclicDependencyError(this, "getProg"); } return zzattr_getProg_cache; } @Override public String toString() { StringBuilder result = new StringBuilder("JassProgs("); boolean first = true; for (JassProg i : this ) { if (!first) { result.append(", "); } if (result.length() > 1000) { result.append("..."); break; } result.append(i); first = false; } result.append(")"); return result.toString(); } }