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

C++ declare函数代码示例

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

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



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

示例1: Operator

   FPge_expr::FPge_expr(Target* _target, int wE, int wF) :
         Operator(_target) {

      ostringstream name;

      name<<"FPge_expr_" <<wE<<"_"<<wF;
      setName(name.str());

      setCopyrightString("Fabrizio Ferrandi (2011-2017)");

      /* Set up the IO signals */

      addFPInput ("X", wE,wF);
      addFPInput ("Y", wE,wF);
      addOutput ("R", 1);

      /*	VHDL code description	*/
      manageCriticalPath(_target->localWireDelay() + _target->lutDelay());
      vhdl << tab << declare("nY",wE+wF+3) << "  <= Y"<< range(wE+wF+2,wE+wF+1) << " & not(Y"<< of(wE+wF) << ") & Y" << range(wE+wF-1,0) << ";" << endl;
      FPAdderSinglePath * value_difference = new FPAdderSinglePath(_target, wE, wF, wE, wF, wE, wF);
      value_difference->changeName(getName()+"value_difference");
      oplist.push_back(value_difference);
      inPortMap  (value_difference, "X", "X");
      inPortMap  (value_difference, "Y", "nY");
      outPortMap (value_difference, "R","valueDiff");
      vhdl << instance(value_difference, "value_difference");
      syncCycleFromSignal("valueDiff");
      setCriticalPath(value_difference->getOutputDelay("R"));

      manageCriticalPath(_target->localWireDelay() + _target->lutDelay());
      vhdl << tab << "R(0) <=   '1' when (valueDiff" << of(wE+wF) << "='0' or (valueDiff" << range(wE+wF+2,wE+wF+1) << " = \"00\")) else '0';" << endl;
   }
开发者ID:hoangt,项目名称:PandA-bambu,代码行数:32,代码来源:FPge_expr.cpp


示例2: declare

Decl&
Parser::on_type_template_parameter(Name& n)
{
  Decl& parm = build.make_type_parameter(n);
  declare(cxt, current_scope(), parm);
  return parm;
}
开发者ID:asutton,项目名称:banjo,代码行数:7,代码来源:sema-decl.cpp


示例3: declare_parms

// Create a saved scope for the function body and add the parameters 
// to it. This will allow parameter names to be looked up during
// subsequent elaboration. Note that name hiding will also be diagnosed
// later.
static void
declare_parms(Context& cxt, Term& t, Decl_list& parms)
{
  Enter_scope scope(cxt, cxt.saved_scope(t));
  for (Decl& p : parms)
    declare(cxt, p);
}
开发者ID:asutton,项目名称:banjo,代码行数:11,代码来源:sema-function.cpp


示例4: declSpecifier

DeclarationNode::DeclarationNode(DeclarationSpecifiersNode* declSpecifier , SymbolTable* _table)
	: declSpecifier(declSpecifier)
{

	declare(_table);

	nodeData = toOperations();
}
开发者ID:YutaMatsumoto,项目名称:MIPSc,代码行数:8,代码来源:DeclarationNode.cpp


示例5: declare

Decl&
Parser::on_class_declaration(Name& n, Type& t, Stmt& s)
{

  Decl& d = build.make_class_declaration(n, t, s);
  declare(cxt, current_scope(), d);
  return d;
}
开发者ID:owenstranathan,项目名称:banjo,代码行数:8,代码来源:sema-decl.cpp


示例6: declare

// Add the declaration d to the given scope.
void
declare(Context& cxt, Scope& scope, Decl& decl)
{
  if (Overload_set* ovl = scope.lookup(decl.name()))
    declare(cxt, *ovl, decl);
  else
    scope.bind(decl);
}
开发者ID:NoraAl,项目名称:banjo,代码行数:9,代码来源:declaration.cpp


示例7: declare

// Called just prior to analyzing the definition, declare all of the
// parameters into the saved function scope.
Decl&
Parser::enter_function_declaration(Decl& d)
{
  Function_decl& fn = cast<Function_decl>(d);
  for (Decl& p : fn.parameters())
    declare(cxt, p);
  return d;
}
开发者ID:asutton,项目名称:banjo,代码行数:10,代码来源:sema-function.cpp


示例8: declist

declist()
{
	extern peeksym, peekc, csym[], cval;
	auto o;

	while((o=symbol())==19 & cval<10)
		declare(cval);
	peeksym = o;
}
开发者ID:7ai,项目名称:legacy-cc,代码行数:9,代码来源:c02.c


示例9: declare_functions

void
declare_functions(node_t* node){
    //The only possible child.
    node_t* functionlist = node->children[0];
    for(int i = 0;i < functionlist->n_children; i++){
        node_t* function = functionlist->children[i];
        declare(function->children[0],0,TRUE);
    }
}
开发者ID:lionleaf,项目名称:compiler,代码行数:9,代码来源:tree.c


示例10: find

ste *symboltable::lookup(lexid * name)
{
  ste *p = find(name);
  if (p == NULL) {
    Error.Error("%s undeclared.", name->getname());
    p = declare(name, errordecl);
  }
  return (p);
}
开发者ID:bvuong,项目名称:CS259,代码行数:9,代码来源:symtab.cpp


示例11: declare

  void Interpreter::enableDynamicLookup(bool value /*=true*/) {
    m_DynamicLookupEnabled = value;

    if (isDynamicLookupEnabled()) {
     if (loadModuleForHeader("cling/Interpreter/DynamicLookupRuntimeUniverse.h")
         != kSuccess)
      declare("#include \"cling/Interpreter/DynamicLookupRuntimeUniverse.h\"");
    }
  }
开发者ID:aurelie-flandi,项目名称:root,代码行数:9,代码来源:Interpreter.cpp


示例12: init_type

PUBLIC void init_type(void)
{
     void_type = prim_type("void");
     char_type = prim_type("char");
     int_type = prim_type("integer");
     bool_type = prim_type("boolean");
     scalar_type = prim_type("*scalar*");
     string_type = prim_type("*string*");
     text_type = prim_type("text");
     err_type = prim_type("*err_type*");

     def_const("true", bool_type, "TRUE");
     def_const("false", bool_type, "FALSE");
     dummy_def = def_const("*dummy*", err_type, "");

     _input_ = declare(VAR, enter("input", BUILTIN), text_type);
     _output_ = declare(VAR, enter("output", BUILTIN), text_type);
}
开发者ID:he110world,项目名称:junk,代码行数:18,代码来源:type.c


示例13: ParseGlobalDeclarations

void ParseGlobalDeclarations()
{
	funcdecl = FALSE;
    for(;;) {
		switch(lastst) {
		case id:
		case kw_interrupt:
		case kw_pascal:
		case kw_nocall:
		case kw_oscall:
		case kw_typedef:
		case kw_byte: case kw_char: case kw_int: case kw_short: case kw_unsigned: case kw_signed:
        case kw_long: case kw_struct: case kw_union:
        case kw_enum: case kw_void:
        case kw_float: case kw_double:
                lc_static += declare(&gsyms,sc_global,lc_static,bt_struct);
				break;
		case kw_register:
				NextToken();
                error(ERR_ILLCLASS);
                lc_static += declare(&gsyms,sc_global,lc_static,bt_struct);
				break;
		case kw_private:
        case kw_static:
                NextToken();
				lc_static += declare(&gsyms,sc_static,lc_static,bt_struct);
                break;
        case kw_extern:
                NextToken();
				if (lastst==kw_pascal) {
					isPascal = TRUE;
					NextToken();
				}
				else if (lastst==kw_oscall || lastst==kw_interrupt || lastst==kw_nocall)
					NextToken();
                ++global_flag;
                declare(&gsyms,sc_external,0,bt_struct);
                --global_flag;
                break;
        default:
                return;
		}
	}
}
开发者ID:freecores,项目名称:raptor64,代码行数:44,代码来源:ParseDeclarations.c


示例14: prim_type

PRIVATE type prim_type(char *name)
{
     ident sym = enter(name, BUILTIN);
     type p = alloc_type();

     p->x_kind = PRIMTYPE;
     p->x_name = sym;
     declare(TYPE, sym, p);
     return p;
}     
开发者ID:he110world,项目名称:junk,代码行数:10,代码来源:type.c


示例15: elem

 NodePtr elem()
 {
     NodePtr e = simpleelem();
     if (e != NULL) return e;
     if (e = comment()) return e;
     if (e = declare()) return e;
     if (e = text()) return e;
     if (e = fullelem()) return e;
     return e;
 }
开发者ID:GHScan,项目名称:DailyProjects,代码行数:10,代码来源:test.cpp


示例16: ParseStructMembers

void ParseStructMembers(TYP *tp, int ztype)
{
    int slc;

    slc = 0;
    tp->val_flag = 1;
//	tp->val_flag = FALSE;
    while( lastst != end) {
        if(ztype == bt_struct)
            slc += declare(&(tp->lst),sc_member,slc,ztype);
        else
            slc = imax(slc,declare(&tp->lst,sc_member,0,ztype));
    }
    bit_offset = 0;
    bit_next = 0;
    bit_width = -1;
    tp->size = tp->alignment ? tp->alignment : slc;
    NextToken();
}
开发者ID:syfar,项目名称:Cores,代码行数:19,代码来源:ParseStructDeclaration.c


示例17: declare

/********************
  class symboltable
  ********************/
symboltable::symboltable()
{
  constdecl *temp;
  int i = 0;
  for (i = 0; i < MAXSCOPES; i++) {
    scopes[i] = 0;
    scopestack[i] = NULL;
  }
  curscope = 0;
  scopedepth = 0;

  /* enter useful stuff. */
  declare(ltable.enter("boolean"), booltype);
  temp = new constdecl(1, booltype);
  declare(ltable.enter("true"), temp);
  temp = new constdecl(0, booltype);
  declare(ltable.enter("false"), temp);
  ::offset = 0;
}
开发者ID:bvuong,项目名称:CS259,代码行数:22,代码来源:symtab.cpp


示例18: declare_tree

//Recursivly walk a tree looking for VARIABLE nodes
int32_t
declare_tree(node_t *node){
    if(node->type.index == VARIABLE){
        declare(node,next_stack_offset, FALSE);   
        next_stack_offset -= 4;
    }
    for(int i = 0; i < node->n_children; i++){
        node_t* child = node->children[i];
        declare_tree(child); 
    }
}
开发者ID:lionleaf,项目名称:compiler,代码行数:12,代码来源:tree.c


示例19: take_decl_specs

Decl&
Parser::on_variable_declaration(Name& n, Type& t, Def& d)
{
  Decl* ret;
  if (parsing_nonstatic_member())
    ret = &cxt.make_field_declaration(n, t, d);
  else
    ret = &cxt.make_variable_declaration(n, t, d);
  ret->spec_ = take_decl_specs();
  declare(cxt, *ret);
  return *ret;
}
开发者ID:asutton,项目名称:banjo,代码行数:12,代码来源:sema-decl.cpp


示例20: mConfigFile

CSMPrefs::State::State (const Files::ConfigurationManager& configurationManager)
: mConfigFile ("openmw-cs.cfg"), mConfigurationManager (configurationManager),
  mCurrentCategory (mCategories.end())
{
    if (sThis)
        throw std::logic_error ("An instance of CSMPRefs::State already exists");

    load();
    declare();

    sThis = this;
}
开发者ID:Salgat,项目名称:openmw,代码行数:12,代码来源:state.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ declareControl函数代码示例发布时间:2022-05-30
下一篇:
C++ decisionLevel函数代码示例发布时间: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