Created
September 22, 2008 04:56
-
-
Save andreyvit/11944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.esko.dtl.core.typeinferencing.constructs.dtl; | |
import com.esko.dtl.core.ast.ArrayAccess; | |
import com.esko.dtl.core.typeinferencing.goals.ExpressionValueInfoGoal; | |
import com.esko.dtl.core.typeinferencing.goals.ValueInfoGoal; | |
import com.yoursway.sadr.core.ValueInfoContinuation; | |
import com.yoursway.sadr.engine.Continuation; | |
import com.yoursway.sadr.engine.ContinuationRequestorCalledToken; | |
import com.yoursway.sadr.engine.ContinuationScheduler; | |
import com.yoursway.sadr.engine.InfoKind; | |
import com.yoursway.sadr.engine.SubgoalRequestor; | |
public class ArrayAccessC extends DtlConstruct<ArrayAccess> { | |
ArrayAccessC(DtlStaticContext sc, ArrayAccess node) { | |
super(sc, node); | |
} | |
public ContinuationRequestorCalledToken evaluateValue(final DtlDynamicContext dc, | |
final InfoKind infoKind, ContinuationScheduler requestor, final ValueInfoContinuation continuation) { | |
final IDtlConstruct name = wrap(innerContext(), node.getName()); | |
return requestor.schedule(new Continuation() { | |
private final ValueInfoGoal nameGoal = new ExpressionValueInfoGoal(name, dc, infoKind); | |
public void provideSubgoals(SubgoalRequestor requestor) { | |
requestor.subgoal(nameGoal); | |
} | |
public void done(ContinuationScheduler requestor) { | |
continuation.consume(nameGoal.result(null).unwrapArray(), requestor); | |
} | |
}); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment