EString command = (am == null)
? (EString)EString.make(name.elem2)
: EString.fromString(am.getName());
if (name.elem1 == am_spawn) {
EDriver drv = ERT.find_driver(command);
if (drv == null) {
task = new EExecDriverTask(proc, name, command, portSetting);
} else {
task = new ESpawnDriverTask(proc, drv, command, portSetting);
}
} else if (name.elem1 == am_spawn_driver) {
EDriver drv = ERT.find_driver(command);
if (drv == null) {
throw ERT.badarg(portName, portSetting);
}
task = new ESpawnDriverTask(proc, drv, command, portSetting);