@Override public Declaration clone() { return (Declaration) super.clone(); }
@Override public Element getNextChild(Element child) { Element e = super.getNextChild(child); if (e != null) return e; return null; }
@Override public Element getPreviousChild(Element child) { Element e = super.getPreviousChild(child); if (e != null) return e; return null; }
@Override public boolean replaceChild(Element child, Element by) { return replaceChild(statements, Statement.class, this, child, by) || super.replaceChild(child, by); } }
Expression vr = varRef(new SimpleIdentifier(decl.resolveName())); Statement deleteStat = stat(methodCall(expr(typeRef(BridJ.class)), "delete", referenced ? methodCall(vr, "get") : vr)); deleteStat.setCommentAfter("// object would end up being deleted by the GC later, but in C++ it would be deleted here.");
public void addStatement(Statement statement) { if (statement != null) { statement.setParentElement(this); statements.add(statement); } } public void setStatements(List<Statement> statements) {
public void visitStatementDeclaration(StatementDeclaration d) { if (d.getStatement() != null) { d.getStatement().accept(this); } } }
@Override public List<Modifier> harvestModifiers() { List<Modifier> mods = super.harvestModifiers(); if (getValueType() != null) mods.addAll(getValueType().harvestModifiers()); return mods; }
@Override public boolean replaceChild(Element child, Element by) { if (child == getValueType()) { setValueType((TypeRef) by); return true; } return super.replaceChild(child, by); }
Expression vr = varRef(new SimpleIdentifier(decl.resolveName())); Statement deleteStat = stat(methodCall(expr(typeRef(BridJ.class)), "delete", referenced ? methodCall(vr, "get") : vr)); deleteStat.setCommentAfter("// object would end up being deleted by the GC later, but in C++ it would be deleted here.");
@Override public boolean replaceChild(Element child, Element by) { if (child == getValue()) { setValue((Expression)by); return true; } return super.replaceChild(child, by); }
@Override public Element getPreviousChild(Element child) { Element e = super.getPreviousChild(child); if (e != null) return e; return getPreviousSibling(statements, child); }
@Override public Element getNextChild(Element child) { Element e = super.getNextChild(child); if (e != null) return e; return getNextSibling(statements, child); }
@Override public Block clone() { return (Block)super.clone(); }
@Override public boolean replaceChild(Element child, Element by) { if (child == getExpression()) { setExpression((Expression)by); return true; } return super.replaceChild(child, by); }
@Override public Element getPreviousChild(Element child) { Element e = super.getPreviousChild(child); if (e != null) return e; e = getPreviousSibling(initStatements, child); if (e != null) return e; return getPreviousSibling(postStatements, child); } @Override
@Override public Element getNextChild(Element child) { Element e = super.getNextChild(child); if (e != null) return e; e = getNextSibling(initStatements, child); if (e != null) return e; return getNextSibling(postStatements, child); } @Override
@Override public boolean replaceChild(Element child, Element by) { if (getExpression() == child) { setExpression((Expression)by); return true; } return super.replaceChild(child, by); } }
@Override public boolean replaceChild(Element child, Element by) { if (child == getDeclaration()) { setDeclaration((VariablesDeclaration)by); return true; } if (child == getBody()) { setBody((Statement)by); return true; } return super.replaceChild(child, by); }
@Override public boolean replaceChild(Element child, Element by) { if (child == getCondition()) { setCondition((Expression)by); return true; } if (child == getBody()) { setBody((Statement)by); return true; } return super.replaceChild(child, by); } }