// Generic function to handle all infix operators but the last one in the precedence hierarchy. : '(' E ')' Condition* InfixOperator(const char** str, Condition(*nextPart(const char**)), int(*operators)(const char**)) { Condition* t = nextPart(str); Condition* t1; Condition* mid; int op; while ((op = operators(str))) { scan(str); t1 = nextPart(str); if (t1 == 0) { if(t) freeTree(t); return 0; } mid = (Condition*)FCEU_dmalloc(sizeof(Condition)); if (!mid) return NULL; memset(mid, 0, sizeof(Condition)); mid->lhs = t; mid->rhs = t1; mid->op = op; t = mid; } return t; }
void djvColorProfileTest::run(int &, char **) { DJV_DEBUG("djvColorProfileTest::run"); ctors(); operators(); }
void djvColorTest::run(int &, char **) { DJV_DEBUG("djvColorTest::run"); ctors(); members(); operators(); }
int main() { unit_test::timeout(); assignment(); named_functions(); operators(); return fail; }
void djvOpenGlImageTest::run(int &, char **) { DJV_DEBUG("djvOpenGlImageTest::run"); ctors(); members(); operators(); }
void djvSpeedTest::run(int &, char **) { DJV_DEBUG("djvSpeedTest::run"); ctors(); members(); convert(); operators(); }
InputParameters validParams<CoupledAux>() { InputParameters params = validParams<AuxKernel>(); MooseEnum operators("+ - * /", "+"); params.addRequiredCoupledVar("coupled", "Coupled Value for Calculation"); params.addParam<Real>("value", 0.0, "A value to use in the binary arithmetic operation of this coupled auxkernel"); params.addParam<MooseEnum>("operator", operators, "The binary operator to use in the calculation"); return params; }
bool ValueProcessor::needsProcessing(const TokenList &value) const { TokenList::const_iterator i; const Token *t; string operators("+-*/"); for (i = value.begin(); i != value.end(); i++) { // variable if ((*i).type == Token::ATKEYWORD || // url (*i).type == Token::URL || // operator operators.find(*i) != string::npos) { return true; } else { if (*i == "~") { if ((*++i).type == Token::STRING) return true; else i--; } else if ((*i).type == Token::IDENTIFIER || (*i).type == Token::OTHER) { // function t = &(*i); i++; if (i != value.end() && (*i).type == Token::PAREN_OPEN && functionExists((*t).c_str())) { return true; } else i--; } } } return false; }
Plan* Step::linkable(Requirement* req, Plan* plan) { ; if(!(operators()->additions()->memberOf(req->condition())) || (req->step()->precedes(this, plan->constraints()))) { return 0; } Link* link = new Link(this,req->step(), req->condition()); Constrain* constraint = new Constrain(this, req->step()); SLBag<Constrain,ConstComp>* constraints = new SLBag<Constrain, ConstComp>; SLBag<Link,LinkComp>* new_link = new SLBag<Link, LinkComp>(*plan->links()); new_link->addMember(link); constraints->addMember(constraint); return new Plan(plan->steps(), link->conflicts(plan)->append(plan->conflicts()), plan->constraints()->adjoin(constraints), new_link, plan->requirements()->rest(), plan->operators()); }
REQUIRE(description.mutexGroups().size() == 8u); REQUIRE(description.mutexGroups()[0].facts().size() == 9u); CHECK(&description.mutexGroups()[0].facts()[0].value() == &description.variables()[0].values()[0]); REQUIRE(description.mutexGroups()[7].facts().size() == 2u); CHECK(&description.mutexGroups()[7].facts()[1].value() == &description.variables()[34].values()[1]); REQUIRE(description.initialState().facts().size() == 37u); CHECK(&description.initialState().facts()[0].value() == &description.variables()[0].values()[8]); CHECK(&description.initialState().facts()[36].value() == &description.variables()[36].values()[1]); REQUIRE(description.goal().facts().size() == 2u); CHECK(&description.goal().facts()[0].value() == &description.variables()[6].values()[0]); CHECK(&description.goal().facts()[1].value() == &description.variables()[7].values()[0]); REQUIRE(description.operators().size() == 34u); CHECK(description.operators()[0].predicate().name() == "activate-trans"); REQUIRE(description.operators()[0].predicate().arguments().size() == 5u); CHECK(description.operators()[0].predicate().arguments()[0] == "philosopher-0"); CHECK(description.operators()[0].predicate().arguments()[4] == "state-3"); REQUIRE(description.operators()[0].preconditions().size() == 3u); CHECK(&description.operators()[0].preconditions()[0].value() == &description.variables()[4].values()[4]); CHECK(&description.operators()[0].preconditions()[1].value() == &description.variables()[16].values()[1]); CHECK(&description.operators()[0].preconditions()[2].value() == &description.variables()[0].values()[8]); REQUIRE(description.operators()[0].effects().size() == 1u); REQUIRE(description.operators()[0].effects()[0].conditions().size() == 0u); CHECK(&description.operators()[0].effects()[0].postcondition().value() == &description.variables()[0].values()[0]); CHECK(description.operators()[33].predicate().name() == "queue-write"); REQUIRE(description.operators()[33].predicate().arguments().size() == 4u); CHECK(description.operators()[33].predicate().arguments()[0] == "philosopher-1"); CHECK(description.operators()[33].predicate().arguments()[3] == "fork");
bool expression_calc::is_operator( const std::string& s ) { return prio( s ) < strlen( operators() ); }
void MainWindow::createActions() { // file updateAction = new QAction(trUtf8("Обновить"), this); updateAction->setShortcut(tr("F5")); connect(updateAction, SIGNAL(triggered()), this, SLOT(update())); loadServicesAction = new QAction(trUtf8("Загрузка услуг"), this); connect(loadServicesAction, SIGNAL(triggered()), this, SLOT(loadServices())); loadServicesMtsAction = new QAction(trUtf8("Загрузка услуг MTC"), this); connect(loadServicesMtsAction, SIGNAL(triggered()), this, SLOT(loadServicesMts())); loadPaysAction = new QAction(trUtf8("Загрузка платежей"), this); connect(loadPaysAction, SIGNAL(triggered()), this, SLOT(loadPays())); exitAction = new QAction(trUtf8("Выход"), this); exitAction->setShortcut(tr("Ctrl+Q")); exitAction->setStatusTip(trUtf8("Выйти из программы")); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); // refs clientsAction = new QAction(trUtf8("Клиенты"), this); // clientsAction->setStatusTip(trUtf8("Информация по клиентам")); connect(clientsAction, SIGNAL(triggered()), this, SLOT(clients())); abonentTypesAction = new QAction(trUtf8("Типы абонентов"), this); // abonentTypesAction->setStatusTip(trUtf8("Информация по клиентам")); connect(abonentTypesAction, SIGNAL(triggered()), this, SLOT(abonentTypes())); tplansAction = new QAction(trUtf8("Тарифные планы"), this); // tplansAction->setStatusTip(trUtf8("Информация по клиентам")); connect(tplansAction, SIGNAL(triggered()), this, SLOT(tplans())); operatorsAction = new QAction(trUtf8("Операторы"), this); operatorsAction->setStatusTip(trUtf8("Операторы")); connect(operatorsAction, SIGNAL(triggered()), this, SLOT(operators())); servicesAction = new QAction(trUtf8("Услуги"), this); // tplansAction->setStatusTip(trUtf8("Информация по клиентам")); connect(servicesAction, SIGNAL(triggered()), this, SLOT(services())); paysAction = new QAction(trUtf8("Платежи"), this); paysAction->setStatusTip(trUtf8("Информация по платежам")); connect(paysAction, SIGNAL(triggered()), this, SLOT(pays())); correctionsAction = new QAction(trUtf8("Корректировки"), this); connect(correctionsAction, SIGNAL(triggered()), this, SLOT(corrections())); arcsAction = new QAction(trUtf8("Архив"), this); arcsAction->setStatusTip(trUtf8("Архив")); arcsAction->setEnabled(userGr_ == 0); connect(arcsAction, SIGNAL(triggered()), this, SLOT(arcs())); // operations calc4abonentsAction = new QAction(trUtf8("1 Рассчет по абонентам"), this); connect(calc4abonentsAction, SIGNAL(triggered()), this, SLOT(calc4abonents())); calc4clientsAction = new QAction(trUtf8("2 Рассчет по клиентам (+счета)"), this); connect(calc4clientsAction, SIGNAL(triggered()), this, SLOT(calc4clients())); files4clientsAction = new QAction(trUtf8("Счета по по клиентам"), this); connect(files4clientsAction, SIGNAL(triggered()), this, SLOT(files4clients())); // reports noAbonentsAction = new QAction(trUtf8("Начисления без абонентов"), this); connect(noAbonentsAction, SIGNAL(triggered()), this, SLOT(noAbonents())); noAccrualsAction = new QAction(trUtf8("Абоненты без начислений"), this); connect(noAccrualsAction, SIGNAL(triggered()), this, SLOT(noAccruals())); aboutAction = new QAction(tr("&About"), this); aboutAction->setStatusTip(tr("Show the application's About box")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); }