本文整理汇总了C++中declare函数的典型用法代码示例。如果您正苦于以下问题:C++ declare函数的具体用法?C++ declare怎么用?C++ declare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了declare函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: declare
Decl&
Parser::on_type_template_parameter(Name& n)
{
Decl& parm = build.make_type_parameter(n);
declare(cxt, current_scope(), parm);
return parm;
}
示例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);
}
示例4: declSpecifier
DeclarationNode::DeclarationNode(DeclarationSpecifiersNode* declSpecifier , SymbolTable* _table)
: declSpecifier(declSpecifier)
{
declare(_table);
nodeData = toOperations();
}
示例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;
}
示例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);
}
示例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;
}
示例8: declist
declist()
{
extern peeksym, peekc, csym[], cval;
auto o;
while((o=symbol())==19 & cval<10)
declare(cval);
peeksym = o;
}
示例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);
}
}
示例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);
}
示例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\"");
}
}
示例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);
}
示例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;
}
}
}
示例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;
}
示例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;
}