• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rule函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rule函数的典型用法代码示例。如果您正苦于以下问题:C++ rule函数的具体用法?C++ rule怎么用?C++ rule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rule函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TRACER

// 17/04/2003, flight Barcelona-Manchester
// 03/05/2003 Manchester changed
void Inference::Data::destroy ()
{ 
  TRACER ("Inference::Data::destroy");

  ASS (this);
  ASS (_counter == 0);

  switch (rule()) 
    {
    case FORALL_AND_MINISCOPE:
    case SWAP:
      delete static_cast<Type1*>(this);
      return;

    case FORALL_OR_MINISCOPE:
      delete static_cast<ForallOrMiniscope*>(this);
      return;

    case DUMMY_QUANTIFIER_REMOVAL:
      delete static_cast<DummyQuantifierRemoval*>(this);
      return;

    case FLATTEN:
      delete static_cast<Flatten*>(this);
      return;

    default:
      ASS (false);
    }
} // Inference::Data::destroy ()
开发者ID:kdgerring,项目名称:sigma,代码行数:32,代码来源:Inference.cpp


示例2: rule

//=========================================================
bool Parser::Statement () {
    PrintRule rule("Statement");
    return rule.Accept(
        FreeStatement() ||
        (DelimitedStatement() && Expect(TokenType::Semicolon))
    );
}
开发者ID:heftyfunseeker,项目名称:cs375,代码行数:8,代码来源:User2.cpp


示例3: operator

		node operator()(token_stream *ts) {
			if( ts->end_of_input() ) {
				return node();
			}

			ts_trans tr( ts );

			std::vector<node> nodes;

			for( rule_t rule : ml_ ) {
				node n = rule(ts);

				if( n.is_null() ) {
					return node();
				}

				nodes.push_back( n );
			}

			tr.commit();


			return node(nodes, "list");

		}
开发者ID:sim82,项目名称:playground,代码行数:25,代码来源:bind.cpp


示例4: productionRule

void productionRule(){
	if(lookahead==OR){
		//printf(" %s", val);
		arraylist_add(stringArray,val);
		arraylist_add(intArray,lookahead);
		//strcpy(list[count],str); 
		match(OR);
		if(lookahead==EOLN){
			//printf(" ep");
			arraylist_add(stringArray,"Epsilon");
			arraylist_add(intArray,7);
			//strcpy(list[count],"epsilon");
		}
		rule();	productionRule();
	}
	else if(lookahead==SEMI){
		arraylist_add(finalString, stringArray);
		arraylist_add(finalInt,intArray);
		counter++;

		stringArray = arraylist_create(objEquals);
		intArray = arraylist_create(objEquals);
		return;}
	else if(lookahead==EOLN) {
		return;}
	else printf("\nPR");
}
开发者ID:pyones,项目名称:MiniCompiler,代码行数:27,代码来源:PassOne.c


示例5: copyFields

 void copyFields(const DeviceArray<PointXYZRGBL>& src, DeviceArray<PointXYZ>& dst)
 {
     //PointXYZRGBL.x (0) -> PointXYZ.x (0)
     //PointXYZRGBL.y (1) -> PointXYZ.y (1)
     //PointXYZRGBL.z (2) -> PointXYZ.z (2)
     copyFieldsEx(src, dst, rule(cp(0, 0), cp(1, 1), cp(2, 2)));
 };
开发者ID:2php,项目名称:pcl,代码行数:7,代码来源:repacks.hpp


示例6: if

value::Value* Agent::observation(
    const devs::ObservationEvent& event) const
{
    const std::string port = event.getPortName();

    if (port == "KnowledgeBase") {
        std::stringstream out;
        out << *this;
        return new value::String(out.str());
    } else if (port == "Activities") {
        std::stringstream out;
        out << activities();
        return new value::String(out.str());
    } else if ((port.compare(0, 9, "Activity_") == 0) and port.size() > 9) {
        std::string activity(port, 9, std::string::npos);
        const Activity& act(activities().get(activity)->second);
        std::stringstream out;
        out << act.state();
        return new value::String(out.str());
    } else if ((port.compare(0, 6, "Rules_") == 0) and port.size() > 6) {
        std::string rule(port, 6, std::string::npos);
        const Rule& ru(rules().get(rule));
        return new value::Boolean(ru.isAvailable());
    }
    return 0;
}
开发者ID:GG31,项目名称:packages,代码行数:26,代码来源:Agent.cpp


示例7: main

int main(int argc, char *argv[])
{
  extern const char*	resstr[];
  bool	res;

  if (argc == 2)
    {
      pushStream(argv[1]);
      saveContext();
      s_ctx		oLocalCtx = {{NULL, 0}, NULL};
      /*res = rule(csv, csv);*/
      /*res = rule(ini, ini, &oLocalCtx) && readEOF();*/
//      res = rule(debug, debug, &oLocalCtx);
      printf("%d\n", getPos());
      /*res = rule(lisp, s_expression, &oLocalCtx);*/
      /*double i = 1;
      while (i < 10000000)
	{
      */
      res = rule(expression, expression, &oLocalCtx);
	  /*i = i + 1;
	}*/
      printf("[%s]\n", resstr[getPos() == (int)strlen(argv[1])]);

      /*
      popStream();
      pushStream(argv[2]);
      res = rule(debug, debug);
      printf("[%s]\n", resstr[getPos() == (int)strlen(argv[2])]);
      */
    }
  return 0;
}
开发者ID:SkinyMonkey,项目名称:CParsing,代码行数:33,代码来源:main.c


示例8: rules

static
void
rules(T_PTR_tree entry) {
  size_t i, j, k, nbr_rules;

  if (entry) {
	/* We allocate memory for the transitions */
	nbr_rules = tree_nbrsubtrees(entry);
	sys->limits.nbr_rules = nbr_rules;
	sys->transition = (transition_t *)xmalloc(nbr_rules*sizeof(transition_t));
	for (i = 0; i < nbr_rules; i++) {
		/* We allocate memory for each gd_cmd of each transition */
		sys->transition[i].cmd_for_place = (gd_command_t *)xmalloc(nbr_var*sizeof(gd_command_t));
		/* Default, guard = 0,\infty and delta = 0 */
		for (j = 0; j < nbr_var; j++) {
			ist_assign_values_to_interval(&sys->transition[i].cmd_for_place[j].guard, 0L,  INFINITY);
			sys->transition[i].cmd_for_place[j].delta = 0L;
			/* In the case of places merged the genuine system is the abstraction of itself */
			sys->transition[i].cmd_for_place[j].places_abstracted=1;
		}
		for (k = 0; k < MAXNBTRANS; ++k){
			/* We allocate memory for each transfert */
			sys->transition[i].transfers[k].origin = (integer16 *)xmalloc(nbr_var*sizeof(integer16));
			/* We initialize the origin vector */
			for (j = 0; j < nbr_var; j++) 
				sys->transition[i].transfers[k].origin[j] = 0;
		}
	}
	for (nbrcmd = 0 ; nbrcmd < nbr_rules ; nbrcmd++) {
		rule(tree_subtree(entry,nbrcmd));
	}
  }
}
开发者ID:cryptica,项目名称:mist,代码行数:33,代码来源:codegenrules.c


示例9: rule

void AdBlockIcon::popupBlocked(const QString &ruleString, const QUrl &url)
{
  int index = ruleString.lastIndexOf(QLatin1String(" ("));

  const QString subscriptionName = ruleString.left(index);
  const QString filter = ruleString.mid(index + 2, ruleString.size() - index - 3);
  AdBlockSubscription* subscription = AdBlockManager::instance()->subscriptionByName(subscriptionName);
  if (filter.isEmpty() || !subscription) {
    return;
  }

  AdBlockRule rule(filter, subscription);

  QPair<AdBlockRule, QUrl> pair;
  pair.first = rule;
  pair.second = url;
  m_blockedPopups.append(pair);

  //!** FIXME
  //    mApp->desktopNotifications()->showNotification(QPixmap(":images/images/adblock_big.png"), tr("Blocked popup window"), tr("AdBlock blocked unwanted popup window."));

  if (!m_flashTimer) {
    m_flashTimer = new QTimer(this);
  }

  if (m_flashTimer->isActive()) {
    stopAnimation();
  }

  m_flashTimer->setInterval(500);
  m_flashTimer->start();

  connect(m_flashTimer, SIGNAL(timeout()), this, SLOT(animateIcon()));
}
开发者ID:DanMan,项目名称:quiterss,代码行数:34,代码来源:adblockicon.cpp


示例10: Match

int Match(Player p,FONT *font3)
{
    BITMAP *end_=0;
    FILE *fp=fopen("ending.txt", "r");
    if(fp==0)
    {
        printf("The file didn't open.\n");
        return 0;
    }
    while(!feof(fp))
    {
        int de=0;
        char ch=' ',com=' ',rules[30]=" ",attribute[18]="",condition[18]="";
        fscanf(fp,"%s",rules);
        if(feof(fp))break;
        while(ch!='\n')
        {
            if(feof(fp))break;
            if(ch=='(' && de==0)
            {
                if(feof(fp))break;
                fscanf(fp,"%s %c %s",attribute,&com,condition);
                condition[strlen(condition)-1]='\0';
                if(Rematch(p,attribute,com,condition)==0)
                {
                    de=1;
                }
            }
            fscanf(fp,"%c",&ch);
        }
        if(de==0)
        {
            rule(&end_,rules);
            textprintf_ex(screen, font3, 50, 25,makecol(0,0,0), makecol(255,255,255),"You become a %s",rules);
            rest(10000);
            Write_Story(rules,p.name);
            destroy_bitmap(end_);
            return 1;
        }
    }
    rule(&end_,"nobody");
    textprintf_ex(screen, font3, 50, 25,makecol(0,0,0), makecol(255,255,255),"You become nobody");
    Write_Story("nobody",p.name);
    rest(10000);
    return 1;
}
开发者ID:eunice730711,项目名称:Princessmaker_GAME,代码行数:46,代码来源:data.cpp


示例11: copyFields

 void copyFields(const DeviceArray<Normal>& src, DeviceArray<PointNormal>& dst)
 {
     //PointXYZ.normal_x (0)  -> PointNormal.normal_x (4)
     //PointXYZ.normal_y (1)  -> PointNormal.normal_y (5)
     //PointXYZ.normal_z (2)  -> PointNormal.normal_z (6)
     //PointXYZ.curvature (4) -> PointNormal.curvature (8)
     copyFieldsEx(src, dst, rule(cp(0, 4), cp(1, 5), cp(2, 6), cp(4,8)));
 };
开发者ID:nttputus,项目名称:PCL,代码行数:8,代码来源:repacks.hpp


示例12: main

int main() {
	while(1) {
		system("cls");
		MAP();
		rule();
	}
	return 0;
}
开发者ID:DJH0319,项目名称:c2018,代码行数:8,代码来源:migong.cpp


示例13: rule

void LabelWidget::setExpandsToFitLines(bool expand)
{
    d->vertExpand = expand;
    if(expand)
    {
        rule().setInput(Rule::Height, *d->height);
    }
    redraw();
}
开发者ID:gnuzinho,项目名称:Doomsday-Engine,代码行数:9,代码来源:labelwidget.cpp


示例14: qCDebug

void RuleNode::removeOldInputArtifact(Artifact *artifact)
{
    if (m_oldInputArtifacts.remove(artifact)) {
        qCDebug(lcBuildGraph) << "remove old input" << artifact->filePath()
                              << "from rule" << rule()->toString();
        m_oldInputArtifacts.insert(nullptr);
    }
    if (m_oldExplicitlyDependsOn.remove(artifact)) {
        qCDebug(lcBuildGraph) << "remove old explicitlyDependsOn" << artifact->filePath()
                              << "from rule" << rule()->toString();
        m_oldExplicitlyDependsOn.insert(nullptr);
    }
    if (m_oldAuxiliaryInputs.remove(artifact)) {
        qCDebug(lcBuildGraph) << "remove old auxiliaryInput" << artifact->filePath()
                              << "from rule" << rule()->toString();
        m_oldAuxiliaryInputs.insert(nullptr);
    }
}
开发者ID:BumblingCoder,项目名称:qbs,代码行数:18,代码来源:rulenode.cpp


示例15: rule_list

rule_list()
#endif
{
	zzRULE;
	zzBLOCK(zztasp1);
	zzMake0;
	{
	if ( (setwd1[LA(1)]&0x8) ) {
		rule();
		zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;  
		{
			zzBLOCK(zztasp2);
			zzMake0;
			{
			while ( (setwd1[LA(1)]&0x10) ) {
				rule();
				{nfa_node *t1;
					t1 = new_nfa_node();
					(t1)->trans[0]=zzaRet.l;
					(t1)->trans[1]=zzaArg(zztasp2,1 ).l;
					/* all accept nodes "dead ends" */
					zzaRet.l=t1; zzaRet.r=NULL;
				}
				zzLOOP(zztasp2);
			}
			zzEXIT(zztasp2);
			}
		}
	}
	else {
		if ( (setwd1[LA(1)]&0x20) ) {
			zzaRet.l = new_nfa_node(); zzaRet.r = NULL;
			warning("no regular expressions", zzline);
		}
		else {zzFAIL(1,zzerr2,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
	}
	zzEXIT(zztasp1);
	return;
fail:
	zzEXIT(zztasp1);
	zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
	zzresynch(setwd1, 0x40);
	}
}
开发者ID:Hensinzzx,项目名称:DDD,代码行数:44,代码来源:dlg_p.c


示例16: num_opnds

//-----------------------------cmp---------------------------------------------
uint MachNode::cmp( const Node &node ) const {
  MachNode& n = *((Node&)node).as_Mach();
  uint no = num_opnds();
  if( no != n.num_opnds() ) return 0;
  if( rule() != n.rule() ) return 0;
  for( uint i=0; i<no; i++ )    // All operands must match
    if( !_opnds[i]->cmp( *n._opnds[i] ) )
      return 0;                 // mis-matched operands
  return 1;                     // match
}
开发者ID:gaoxiaojun,项目名称:dync,代码行数:11,代码来源:machnode.cpp



注:本文中的rule函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rules函数代码示例发布时间:2022-05-30
下一篇:
C++ ruby_xfree函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap