final InputPattern[] inputPatterns = action.getInputPatterns();
for (int i = 0; i < inputPatterns.length; i++) {
final InputPattern inputPattern = inputPatterns[i];
final String[] vars = inputPattern.getVariables();
final Expression repExpr = inputPattern.getRepeatExpr();
if (repExpr == null) {
for (int j = 0; j < vars.length; j++) {
final InputChannel channel = ((InputPort) (inputPortMap
.get(inputPattern.getPortname()))).getChannel(0); // FIXME
local.bind(vars[j], new SingleTokenReaderThunk(channel, j));
}
} else {
SimpleThunk repExprThunk = new SimpleThunk(repExpr, context,
local);
local.bind(new EnvironmentKey(inputPattern.getPortname()),
repExprThunk);
for (int j = 0; j < vars.length; j++) {
final InputChannel channel = ((InputPort) (inputPortMap
.get(inputPattern.getPortname()))).getChannel(0); // FIXME
local.bind(vars[j], new MultipleTokenReaderThunk(channel,
j, vars.length, repExprThunk, context));
}
}
}
final Decl[] decls = action.getDecls();
for (int i = 0; i < decls.length; i++) {
final Expression v = decls[i].getInitialValue();
if (v == null) {
local.bind(decls[i].getName(), null);
} else {
local.bind(decls[i].getName(), new SimpleThunk(v, context,