//generated by abstract-syntax-gen package de.peeeq.wurstscript.jassIm; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class ImMemberAccessImpl implements ImMemberAccess{ ImMemberAccessImpl(de.peeeq.wurstscript.ast.Element trace, ImExpr receiver, ImTypeArguments typeArguments, ImVar var, ImExprs indexes) { if (trace == null) throw new IllegalArgumentException("Element trace must not be null."); if (receiver == null) throw new IllegalArgumentException("Element receiver must not be null."); if (typeArguments == null) throw new IllegalArgumentException("Element typeArguments must not be null."); if (var == null) throw new IllegalArgumentException("Element var must not be null."); if (indexes == null) throw new IllegalArgumentException("Element indexes must not be null."); this.trace = trace; this.receiver = receiver; this.typeArguments = typeArguments; this.var = var; this.indexes = indexes; receiver.setParent(this); typeArguments.setParent(this); indexes.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.receiver); action.accept(this.typeArguments); action.accept(this.indexes); } public int size() { return 3; } @Override public ImMemberAccess copy() { ImMemberAccess result = new ImMemberAccessImpl(trace, (ImExpr) this.receiver.copy(), (ImTypeArguments) this.typeArguments.copy(), var, (ImExprs) this.indexes.copy()); return result; } @Override public ImMemberAccess copyWithRefs() { ImMemberAccess res = copy(); return res; } @Override public void clearAttributes() { receiver.clearAttributes(); typeArguments.clearAttributes(); indexes.clearAttributes(); clearAttributesLocal(); } @Override public void clearAttributesLocal() { } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(ImLExpr.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImLExpr.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ImMemberOrMethodAccess.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImMemberOrMethodAccess.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ElementWithTrace.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ElementWithTrace.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ElementWithVar.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ElementWithVar.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ImExprOpt.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImExprOpt.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ImStmt.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImStmt.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ImClassRelatedExpr.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImClassRelatedExpr.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ImPrintable.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImPrintable.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(ImExpr.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(ImExpr.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_ImMemberAccess(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_ImMemberAccess(this); } public boolean structuralEquals(Element e) { if (e instanceof ImMemberAccess) { ImMemberAccess o = (ImMemberAccess) e; return this.receiver.structuralEquals(o.getReceiver()) && this.typeArguments.structuralEquals(o.getTypeArguments()) && this.var == o.getVar() && this.indexes.structuralEquals(o.getIndexes()); } else { return false; } } /** */ public void print(java.lang.Appendable sb, int indent) { de.peeeq.wurstscript.translation.imtranslation.ImPrinter.print((ImMemberAccess)this, sb, indent); } /** */ public String toString() { return de.peeeq.wurstscript.translation.imtranslation.ImPrinter.asString((ImMemberAccess)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((ImMemberAccess)this, translator, f); } /** */ public de.peeeq.wurstscript.translation.imtranslation.Flatten.ResultL flattenL(de.peeeq.wurstscript.translation.imtranslation.ImTranslator translator, de.peeeq.wurstscript.jassIm.ImFunction f) { return de.peeeq.wurstscript.translation.imtranslation.Flatten.flattenL((ImMemberAccess)this, translator, f); } /** */ public de.peeeq.wurstscript.translation.imtranslation.purity.PurityLevel attrPurity() { return de.peeeq.wurstscript.translation.imtranslation.purity.PurityLevels.calculate((ImMemberAccess)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((ImMemberAccess)this, stmts, f, translator); } /** */ public de.peeeq.wurstscript.jassAst.JassExpr translate(de.peeeq.wurstscript.translation.imtojass.ImToJassTranslator translator) { return de.peeeq.wurstscript.translation.imtojass.ExprTranslation.translate((ImMemberAccess)this, translator); } /** */ public ImType attrTyp() { return de.peeeq.wurstscript.translation.imtojass.ImAttrType.getType((ImMemberAccess)this); } /** */ public ImFunction getNearestFunc() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getNearestFunc((ImMemberAccess)this); } /** */ public void translateStmtToLua(java.util.List res, de.peeeq.wurstscript.translation.lua.translation.LuaTranslator tr) { de.peeeq.wurstscript.translation.lua.translation.StmtTranslation.translate((ImMemberAccess)this, res, tr); } /** */ public de.peeeq.wurstscript.luaAst.LuaExpr translateToLua(de.peeeq.wurstscript.translation.lua.translation.LuaTranslator tr) { return de.peeeq.wurstscript.translation.lua.translation.ExprTranslation.translate((ImMemberAccess)this, 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((ImMemberAccess)this, globalState, localState); } /** */ public de.peeeq.wurstscript.intermediatelang.ILconst evaluate(de.peeeq.wurstscript.intermediatelang.interpreter.ProgramState globalState, de.peeeq.wurstscript.intermediatelang.interpreter.LocalState localState) { return de.peeeq.wurstscript.intermediatelang.interpreter.EvaluateExpr.eval((ImMemberAccess)this, globalState, localState); } /** */ public de.peeeq.wurstscript.intermediatelang.ILaddress evaluateLvalue(de.peeeq.wurstscript.intermediatelang.interpreter.ProgramState globalState, de.peeeq.wurstscript.intermediatelang.interpreter.LocalState localState) { return de.peeeq.wurstscript.intermediatelang.interpreter.EvaluateExpr.evaluateLvalue((ImMemberAccess)this, globalState, localState); } /** */ public de.peeeq.wurstscript.ast.Element attrTrace() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getTrace((ImMemberAccess)this); } /** */ public ImProg attrProg() { return de.peeeq.wurstscript.translation.imtojass.ImAttributes.getProg((ImMemberAccess)this); } /** */ public boolean isUsedAsLValue() { return de.peeeq.wurstscript.translation.imtranslation.LValues.isUsedAsLValue((ImMemberAccess)this); } }