//generated by abstract-syntax-gen package de.peeeq.wurstscript.jassAst; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class JassProgImpl implements JassProg{ JassProgImpl(JassTypeDefs defs, JassVars globals, JassNatives natives, JassFunctions functions) { if (defs == null) throw new IllegalArgumentException("Element defs must not be null."); if (globals == null) throw new IllegalArgumentException("Element globals must not be null."); if (natives == null) throw new IllegalArgumentException("Element natives must not be null."); if (functions == null) throw new IllegalArgumentException("Element functions must not be null."); this.defs = defs; this.globals = globals; this.natives = natives; this.functions = functions; defs.setParent(this); globals.setParent(this); natives.setParent(this); functions.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.defs); action.accept(this.globals); action.accept(this.natives); action.accept(this.functions); } public int size() { return 4; } @Override public JassProg copy() { JassProg result = new JassProgImpl((JassTypeDefs) this.defs.copy(), (JassVars) this.globals.copy(), (JassNatives) this.natives.copy(), (JassFunctions) this.functions.copy()); return result; } @Override public JassProg copyWithRefs() { JassProg res = copy(); return res; } @Override public void clearAttributes() { defs.clearAttributes(); globals.clearAttributes(); natives.clearAttributes(); functions.clearAttributes(); clearAttributesLocal(); } @Override public void clearAttributesLocal() { zzattr_getLine_state = 0; zzattr_getProg_state = 0; zzattr_attrLineMap_state = 0; zzattr_attrIgnoredVariables_state = 0; zzattr_attrComments_state = 0; zzattr_attrIgnoredFunctions_state = 0; } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(JassScope.Matcher matcher) { return matcher.case_JassProg(this); } @Override public void match(JassScope.MatcherVoid matcher) { matcher.case_JassProg(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_JassProg(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_JassProg(this); } @Override public String toString() { return "JassProg(" + defs + ", " +globals + ", " +natives + ", " +functions+")"; } public boolean structuralEquals(Element e) { if (e instanceof JassProg) { JassProg o = (JassProg) e; return this.defs.structuralEquals(o.getDefs()) && this.globals.structuralEquals(o.getGlobals()) && this.natives.structuralEquals(o.getNatives()) && this.functions.structuralEquals(o.getFunctions()); } else { return false; } } /** */ public void validate() { de.peeeq.wurstscript.frotty.jassValidator.JassValidator.validate((JassProg)this); } // 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((JassProg)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((JassProg)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; } // circular = null private int zzattr_attrLineMap_state = 0; private java.util.Map zzattr_attrLineMap_cache; /** */ public java.util.Map attrLineMap() { if (zzattr_attrLineMap_state == 0) { try { zzattr_attrLineMap_state = 1; zzattr_attrLineMap_cache = de.peeeq.wurstscript.frotty.jassValidator.LineMapAttr.get((JassProg)this); } finally { zzattr_attrLineMap_state = 0; } zzattr_attrLineMap_state = 2; } else if (zzattr_attrLineMap_state == 1) { throw new CyclicDependencyError(this, "attrLineMap"); } return zzattr_attrLineMap_cache; } // circular = null private int zzattr_attrIgnoredVariables_state = 0; private java.util.Set zzattr_attrIgnoredVariables_cache; /** */ public java.util.Set attrIgnoredVariables() { if (zzattr_attrIgnoredVariables_state == 0) { try { zzattr_attrIgnoredVariables_state = 1; zzattr_attrIgnoredVariables_cache = de.peeeq.wurstscript.attributes.JassAttributes.attrIgnoredVariables((JassProg)this); } finally { zzattr_attrIgnoredVariables_state = 0; } zzattr_attrIgnoredVariables_state = 2; } else if (zzattr_attrIgnoredVariables_state == 1) { throw new CyclicDependencyError(this, "attrIgnoredVariables"); } return zzattr_attrIgnoredVariables_cache; } // circular = null private int zzattr_attrComments_state = 0; private java.util.Map zzattr_attrComments_cache; /** */ public java.util.Map attrComments() { if (zzattr_attrComments_state == 0) { try { zzattr_attrComments_state = 1; zzattr_attrComments_cache = de.peeeq.wurstscript.attributes.JassAttributes.attrComments((JassProg)this); } finally { zzattr_attrComments_state = 0; } zzattr_attrComments_state = 2; } else if (zzattr_attrComments_state == 1) { throw new CyclicDependencyError(this, "attrComments"); } return zzattr_attrComments_cache; } // circular = null private int zzattr_attrIgnoredFunctions_state = 0; private java.util.Set zzattr_attrIgnoredFunctions_cache; /** */ public java.util.Set attrIgnoredFunctions() { if (zzattr_attrIgnoredFunctions_state == 0) { try { zzattr_attrIgnoredFunctions_state = 1; zzattr_attrIgnoredFunctions_cache = de.peeeq.wurstscript.attributes.JassAttributes.attrIgnoredFunctions((JassProg)this); } finally { zzattr_attrIgnoredFunctions_state = 0; } zzattr_attrIgnoredFunctions_state = 2; } else if (zzattr_attrIgnoredFunctions_state == 1) { throw new CyclicDependencyError(this, "attrIgnoredFunctions"); } return zzattr_attrIgnoredFunctions_cache; } }