PtParser parser = new PtParser();
Map map = parser.generateAssignmentMap(expression);
for (Iterator names = map.keySet().iterator(); names.hasNext();) {
String name = (String) names.next();
ASTPtAssignmentNode node = (ASTPtAssignmentNode) map.get(name);
// Parse the destination specification first.
String completeDestinationSpec = node.getIdentifier();
int openParen = completeDestinationSpec.indexOf("(");
if (openParen > 0) {
// A channel is being specified.
int closeParen = completeDestinationSpec.indexOf(")");
if (closeParen < openParen) {
throw new IllegalActionException(this,
"Malformed action: expected destination = "
+ "expression. Got: "
+ completeDestinationSpec);
}
_destinationNames.add(completeDestinationSpec.substring(0,
openParen).trim());
String channelSpec = completeDestinationSpec.substring(
openParen + 1, closeParen);
try {
_numbers.add(Integer.valueOf(channelSpec));
} catch (NumberFormatException ex) {
throw new IllegalActionException(this,
"Malformed action: expected destination = "
+ "expression. Got: "
+ completeDestinationSpec);
}
} else {
// No channel is specified.
_destinationNames.add(completeDestinationSpec);
_numbers.add(null);
}
// Parse the expression
_parseTrees.add(node.getExpressionTree());
}
}