public If(If i) { this.cond = new Expression(i.getCond()); this.baseCase = new Expression(i.getBaseCase()); this.recCase = new Expression(i.getRecCase()); this.ifZero = i.getIfZero(); copyEnvironment(i); }
/** * switch case for ALL orders * * @param e the EObject w'd like to know more about */ private void execute(EObject e) { if (e instanceof Refresh) { refresh(); } else if (e instanceof Navigate) { navigateTo(((Navigate) e).getUrl()); } else if (e instanceof Store) { store((Store) e); } else if (e instanceof ReDefine) { redefine((ReDefine) e); } else if (e instanceof Delete) { delete((Delete) e); } else if (e instanceof ActionSelect) { select((ActionSelect) e); } else if (e instanceof ActionWithObject) { ActionWithObject awo = (ActionWithObject) e; execute(awo.getObject(), awo); } else if (e instanceof CheckBox) { tickBox((CheckBox) e); } else if (e instanceof Rickroll) { rickRoll(); } else if (e instanceof DoWait) { waitFor(((DoWait) e).getMillisec()); } // conditions : else if (Condition.class.isAssignableFrom(e.getClass())) { eval((Condition) e); } // structures : else if (e instanceof If) { If i = ((If) e); structureIf(i.getCond(), i.getActionThen(), i.getActionElse()); } else if (e instanceof Loop) { Loop i = (Loop) e; structureLoop(i.getCond(), i.getMilliseconds(), i.getActions()); } else if (e instanceof DoAll) { DoAll i = (DoAll) e; structureDoAll(i.getColl(), i.getTodo()); } else if (e instanceof Execute) { executeSubProcedure((Execute) e); } }