当前位置: 首页>>代码示例>>C++>>正文


C++ pprint函数代码示例

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


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

示例1: dump_upvalue

static bool dump_upvalue(struct luadebug_debugger *session, const char *option)
{
	int i;
	const char *local;
	const int index = option ? atoi(option) : -1;

	lua_getinfo(session->L, "f", &session->frame);

	if (index < 0) {
		session->user->print(session->user, "Up-values\n");
		for (i=1; (local = lua_getupvalue(session->L, -1, i)); ++i) {
			session->user->print(session->user, "  #%d\t%s = ", i, local);
			pprint(session->L, session->user, -1, false, NULL);
			lua_pop(session->L, 1);
		}
	}
	else {
		local = lua_getupvalue(session->L, -1, index);
		if (!local) {
			session->user->print(session->user, RED "invalid up-value index '%d'\n" CLEAR, index);
		}
		else {
			session->user->print(session->user, "  #%d\t%s = ", index, local);
			pprint(session->L, session->user, -1, true, NULL);
			lua_pop(session->L, 1);
		}
	}

	lua_pop(session->L, 1);
	return false;
}
开发者ID:Openwide-Ingenierie,项目名称:haka,代码行数:31,代码来源:debugger.c

示例2: pprintPrefixTree2

/* Affichage prefixe d'une expression binaire */
void pprintPrefixTree2(TreeP tree, char *op) {
  printf("(%s", op);
  pprint(getChild(tree, 0));
  printf(" ");
  pprint(getChild(tree, 1));
  printf(")");
}
开发者ID:vgramer,项目名称:TP-compil,代码行数:8,代码来源:prefixPrint.c

示例3: pprintWhile

/* Affichage d'un while do */
void pprintWhile(TreeP tree) {
  printf("(While ");
  pprint(getChild(tree, 0));
  printf(" do ");
  pprint(getChild(tree, 1));
  printf(")");
}
开发者ID:Patrate,项目名称:ProjetCompil,代码行数:8,代码来源:print.c

示例4: pprintTree2

/* Affichage d'une expression binaire */
void pprintTree2(TreeP tree, char *op) {
  printf("(");
  pprint(getChild(tree, 0));
  printf("%s", op);
  pprint(getChild(tree, 1));
  printf(")");
}
开发者ID:Patrate,项目名称:ProjetCompil,代码行数:8,代码来源:print.c

示例5: pprintList

void pprintList(TreeP tree){
  if(getChild(tree,1) != NULL){
    pprint(getChild(tree, 1));
    printf(",");
  }
  pprint(getChild(tree, 0));
}
开发者ID:Patrate,项目名称:ProjetCompil,代码行数:7,代码来源:print.c

示例6: pprintIf

/* Affichage d'un if then else */
void pprintIf(TreeP tree) {
	
	/* instruction if */
	printIndentation();
	printf("SI ");
	pprint(getChild(tree, 0));
	printf(" ALORS\n");

	/*debut du bloc d'instructions*/
	indent++;
	pprint(getChild(tree, 1));
	indent--;
	
	/* y a-t-il un bloc 'else' ? */
	if(tree->nbChildren==3){
		printf("\n");
		printIndentation();
		printf("SINON\n");
		/* debut du bloc else */
		indent++;
		pprint(getChild(tree, 2));
		indent--;
	}
	
	/* fin du dernier bloc defini */
	printf("\n");
	printIndentation();
	printf("FINDESI");

}
开发者ID:vgramer,项目名称:TP-compil,代码行数:31,代码来源:prefixPrint.c

示例7: cprint

void
cprint(Chan *c, Mntcache *m, char *s)
{
	ulong o;
	int nb, ct;
	Extent *e;

	nb = 0;
	ct = 1;
	o = 0;
	if(m->list)
		o = m->list->start;
	for(e = m->list; e; e = e->next) {
		nb += e->len;
		if(o != e->start)
			ct = 0;
		o = e->start+e->len;
	}
	pprint("%s: %#llux.%#lux %d %d %s (%d %c)\n",
	s, m->qid.path, m->qid.vers, m->type, m->dev, c->path->s, nb, ct ? 'C' : 'N');

	for(e = m->list; e; e = e->next) {
		pprint("\t%4d %5lud %4d %#p\n",
			e->bid, e->start, e->len, e->cache);
	}
}
开发者ID:99years,项目名称:plan9,代码行数:26,代码来源:cache.c

示例8: pprintNew

void pprintNew(TreeP tree){
  printf("new ");
  pprint(getChild(tree, 0));
  printf("(");
  pprint(getChild(tree, 1));
  printf(")");
}
开发者ID:Patrate,项目名称:ProjetCompil,代码行数:7,代码来源:print.c

示例9: do_disassemble

static void do_disassemble(const char *triple, const char *features,
                           unsigned char *buf, int siz) {
  LLVMDisasmContextRef D = LLVMCreateDisasmCPUFeatures(triple, "", features,
                                                       NULL, 0, NULL, NULL);
  char outline[1024];
  int pos;

  if (!D) {
    printf("ERROR: Couldn't create disassembler for triple %s\n", triple);
    return;
  }

  pos = 0;
  while (pos < siz) {
    size_t l = LLVMDisasmInstruction(D, buf + pos, siz - pos, 0, outline,
                                     sizeof(outline));
    if (!l) {
      pprint(pos, buf + pos, 1, "\t???");
      pos++;
    } else {
      pprint(pos, buf + pos, l, outline);
      pos += l;
    }
  }

  LLVMDisasmDispose(D);
}
开发者ID:jamboree,项目名称:llvm,代码行数:27,代码来源:disassemble.c

示例10: pprpa

        static short pprpa(
        pm_ptr pala)

/*      Print module parameter.
 *
 *      In:    nplist  =>  PM-pointer to module parameter node 
 *
 *      FV:    return  -   error severity code
 *
 *      (C)microform ab 1986-03-21 Per-Ove Agne'
 *
 *      1999-11-19 Rewritten, R. Svedin
 *
 ******************************************************!*/

  {
   PMPANO *np;             /* c-pointer to module parameter node */
   string str;
   char tmpstr[ PPLINLEN ];
   STVAR var;              /* interface struct for a parameter */
   short status;

   if ( ( status = pmgpar( pala, &np ) ) )
      {  
      return( status );    /* Error */
      }

   if ( np->noclpa != PARAM )
      {  
      return( erpush( "PM2532", "" ) );   /*Error  Not an module parameter node */
      }

   ppdecl( np->fopa_ );                   /* print formal parameter name */ 

/*
***get and print default value
*/
   if ( ( status = strvar( np->fopa_, &var ) ) != 0 )
      return( status );

   if ( var.def_va != (pm_ptr)NULL )
      {
      pprint( ":=" );
      pprex( var.def_va, PP_NOPRI );
      }

   if ( ( status = pmgstr( np->ppro_, &str ) ) != 0 )
      return( status );

   if ( strlen( str ) > 0 )
      {
      pprint( " > " );
      strcpy( tmpstr, str );
      fixsli( tmpstr );
      pprint( tmpstr );
      }

  return( 0 );
  }
开发者ID:mildred,项目名称:Varkon,代码行数:59,代码来源:pretty.c

示例11: pprintYield

void pprintYield(TreeP tree){
  printf("yield ");
  pprint(getChild(tree, 0));
  if(tree->nbChildren == 2){
    printf(":");
    pprint(getChild(tree, 1));
  }
}
开发者ID:Patrate,项目名称:ProjetCompil,代码行数:8,代码来源:print.c

示例12: event_watch

static void event_watch(event_watch_msg_t *event, tree_rd_ctx_t ctx)
{
   tree_t decl = tree_read_recall(ctx, event->index);

   printf("%s: update %s ", event->now_text, istr(tree_ident(decl)));
   printf("%s -> ", pprint(decl, &(event->last), 1));
   printf("%s\n", pprint(decl, &(event->value), 1));
}
开发者ID:a4a881d4,项目名称:nvc,代码行数:8,代码来源:shell.c

示例13: pprintDec

void pprintDec(TreeP tree){
  printf("var ");
  pprint(getChild(tree, 0));
  printf(" : ");
  pprint(getChild(tree, 1));
  pprint(getChild(tree, 2));
  printf(";\n");
  pprint(getChild(tree,3)); 
}
开发者ID:Patrate,项目名称:ProjetCompil,代码行数:9,代码来源:print.c

示例14: pprint

void pprint(BTNode* t){  
        printf("(");  
        if(t!=NULL){   
                printf("%c",t->data);  
                pprint(t->lchild);  
                pprint(t->rchild);  
        }  
        printf(")");  
}  
开发者ID:killinux,项目名称:hello,代码行数:9,代码来源:bstree.c

示例15: psymbol

static void psymbol(node s){
     assertpos(s->tag == symbol_tag,s);
     cprint(s->body.symbol.name);
     if (s->body.symbol.cprintvalue) {
	  put("\n      cprintvalue => ");
	  cprint(s->body.symbol.cprintvalue);
	  put("\n      ");
	  }
     if (s->body.symbol.Cname != NULL) {
	  put("\n      Cname => ");
	  put(s->body.symbol.Cname);
	  }
     put("\n      type => ");
     pprint(s->body.symbol.type);
     put("\n      value => ");
     if (s->body.symbol.value != NULL) {
	  node val = s->body.symbol.value;
	  if (istype(val) && val->body.type.name == s) {
	       pprint(val->body.type.definition);
	       }
	  else pprint(val);
	  }
     else {
       put("none");
       }
     put("\n      flags:");
     if (s->body.symbol.flags & macro_function_F) put(" macro-function");
     if (s->body.symbol.flags & macro_variable_F) put(" macro-variable");
     if (s->body.symbol.flags & readonly_F) put(" readonly");
     if (s->body.symbol.flags & symbol_F) put(" symbol");
     if (s->body.symbol.flags & keyword_F) put(" keyword");
     if (s->body.symbol.flags & constant_F) put(" constant");
     if (s->body.symbol.flags & defined_F) put(" initialized");
     if (s->body.symbol.flags & export_F) put(" export");
     if (s->body.symbol.flags & import_F) put(" import");
     if (s->body.symbol.flags & threadLocal_F) put(" thread");
     if (s->body.symbol.flags & const_F) put(" const");
     if (s->body.symbol.flags & global_F) put(" global");
     if (s->body.symbol.flags & literal_F) put(" literal");
     if (s->body.symbol.flags & visible_F) put(" visible");
     if ( !(s->body.symbol.flags & defined_F) && !(s->body.symbol.flags & import_F) ) put(" (never initialized)");
     if (s->body.symbol.args != NULL) {
	  put("\n      args => ");
	  cprintlist(s->body.symbol.args);
	  }
     if (s->body.symbol.body != NULL) {
	  put("\n      body => ");
	  pprint(s->body.symbol.body);
	  }
     if (s->body.symbol.export_list != NULL) {
	  put("\n      export_list => ");
	  cprintlist(s->body.symbol.export_list);
	  }
     pput("\n");
     }
开发者ID:BertiniM2,项目名称:M2,代码行数:55,代码来源:dictionary.c


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