//generated by abstract-syntax-gen package de.peeeq.wurstscript.luaAst; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class LuaExprVarAccessImpl implements LuaExprVarAccess{ LuaExprVarAccessImpl(LuaVariable var) { if (var == null) throw new IllegalArgumentException("Element var must not be null."); this.var = var; } 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 LuaExprVarAccess copy() { LuaExprVarAccess result = new LuaExprVarAccessImpl(var); return result; } @Override public LuaExprVarAccess copyWithRefs() { LuaExprVarAccess res = copy(); return res; } @Override public void clearAttributes() { clearAttributesLocal(); } @Override public void clearAttributesLocal() { } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(LuaExprAtomic.Matcher matcher) { return matcher.case_LuaExprVarAccess(this); } @Override public void match(LuaExprAtomic.MatcherVoid matcher) { matcher.case_LuaExprVarAccess(this); } @Override public T match(LuaStatement.Matcher matcher) { return matcher.case_LuaExprVarAccess(this); } @Override public void match(LuaStatement.MatcherVoid matcher) { matcher.case_LuaExprVarAccess(this); } @Override public T match(LuaExpr.Matcher matcher) { return matcher.case_LuaExprVarAccess(this); } @Override public void match(LuaExpr.MatcherVoid matcher) { matcher.case_LuaExprVarAccess(this); } @Override public T match(LuaExprVarRef.Matcher matcher) { return matcher.case_LuaExprVarAccess(this); } @Override public void match(LuaExprVarRef.MatcherVoid matcher) { matcher.case_LuaExprVarAccess(this); } @Override public T match(LuaExprOpt.Matcher matcher) { return matcher.case_LuaExprVarAccess(this); } @Override public void match(LuaExprOpt.MatcherVoid matcher) { matcher.case_LuaExprVarAccess(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_LuaExprVarAccess(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_LuaExprVarAccess(this); } @Override public String toString() { return "LuaExprVarAccess(" + var+")"; } public boolean structuralEquals(Element e) { if (e instanceof LuaExprVarAccess) { LuaExprVarAccess o = (LuaExprVarAccess) e; return this.var == o.getVar(); } else { return false; } } /** */ public void print(StringBuilder sb, int indent) { de.peeeq.wurstscript.translation.lua.printing.LuaPrinter.print((LuaExprVarAccess)this, sb, indent); } }