Search in sources :

Example 1 with AbstractOperation

use of org.whole.lang.operations.AbstractOperation in project whole by wholeplatform.

the class JavaStoreBuilder method addSubtree.

// NB devono essere 3 addSubtree
public Expression addSubtree(IVisitor visitor, SameStageFragment fragment, String type) {
    int parentNestingSize = initNestingSize();
    IVisitor v = ((AbstractOperation) visitor.getOperation()).getVisitor(fragment.wGetRoot(), visitor.getOperation().getStage());
    v.visit(fragment.wGetRoot());
    MethodInvocation callExp2 = newFactoryInvocation(v, "makeRootEntity");
    callExp2.arguments().add(getExpression());
    MethodInvocation callExp = newFactoryInvocation(visitor, "create" + type);
    callExp.arguments().add(callExp2);
    return addSubtree(parentNestingSize, type, callExp);
}
Also used : AbstractOperation(org.whole.lang.operations.AbstractOperation) IVisitor(org.whole.lang.visitors.IVisitor) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation)

Example 2 with AbstractOperation

use of org.whole.lang.operations.AbstractOperation in project whole by wholeplatform.

the class JavaStoreBuilder method addSubtree.

public Expression addSubtree(IVisitor visitor, StageUpFragment fragment, String type) {
    int parentNestingSize = initNestingSize();
    IVisitor v = ((AbstractOperation) visitor.getOperation()).getVisitor(fragment.wGetRoot(), 1);
    v.visit(fragment.wGetRoot());
    MethodInvocation callExp2 = newFactoryInvocation(v, "makeRootEntity");
    callExp2.arguments().add(getExpression());
    MethodInvocation callExp = newFactoryInvocation(visitor, "create" + type);
    callExp.arguments().add(callExp2);
    return addSubtree(parentNestingSize, type, callExp);
}
Also used : AbstractOperation(org.whole.lang.operations.AbstractOperation) IVisitor(org.whole.lang.visitors.IVisitor) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation)

Example 3 with AbstractOperation

use of org.whole.lang.operations.AbstractOperation in project whole by wholeplatform.

the class JavaStoreBuilder method addSubtree.

public Expression addSubtree(IVisitor visitor, StageDownFragment fragment, String type) {
    int parentNestingSize = initNestingSize();
    IVisitor v = ((AbstractOperation) visitor.getOperation()).getVisitor(fragment.wGetRoot(), 0);
    v.visit(fragment.wGetRoot());
    MethodInvocation callExp2 = newFactoryInvocation(v, "makeRootEntity");
    callExp2.arguments().add(getExpression());
    MethodInvocation callExp = newFactoryInvocation(visitor, "create" + type);
    callExp.arguments().add(callExp2);
    return addSubtree(parentNestingSize, type, callExp);
}
Also used : AbstractOperation(org.whole.lang.operations.AbstractOperation) IVisitor(org.whole.lang.visitors.IVisitor) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation)

Aggregations

MethodInvocation (org.eclipse.jdt.core.dom.MethodInvocation)3 AbstractOperation (org.whole.lang.operations.AbstractOperation)3 IVisitor (org.whole.lang.visitors.IVisitor)3