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


C++ PrintNode函数代码示例

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


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

示例1: PrintNode

void PrintNode(PNode *Tree){
	if (*Tree){
		printf("Элемент: ");
		PrintData(&(*Tree)->data);
		if ((*Tree)->left){
			printf(" Л: ");
			PrintData(&(*Tree)->left->data);
		}
		else
			printf(" Л: *");
		
		if ((*Tree)->right){
			printf(" П: ");
			PrintData(&(*Tree)->right->data);
		}
		else 
			printf(" П: *");
		printf("\n");
		if ((*Tree)->left){
			PrintNode(&(*Tree)->left);
		}
		if ((*Tree)->right){
			PrintNode(&((*Tree)->right));
		}
	}
}
开发者ID:CheretaevIvan,项目名称:VisualStudioProjects,代码行数:26,代码来源:search_tree.cpp

示例2: PrintProc

PRIVATE inline void PrintProc(GBUF *out, UNUSED(Node *node), procNode *u, UNUSED(int offset), UNUSED(Bool norecurse))
{
     gbputs("Proc:\n  ", out);
     PrintNode(out, u->decl, 2);
     gbputs("\n  ", out);
     PrintNode(out, u->body, 2);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:7,代码来源:print-ast.c

示例3: main

 int main()
 {
	 root = NULL;
	 root2 = NULL;
	 int randomData = 0;

	 srand(time(NULL));

	 for (int i = 0; i<30; ++i)
	 {
		 randomData = rand()%1000;
		 BinarySearchTreeCreate(&root,randomData);
		 BinaryTreeCreate(&root2,randomData);
	 }

	 bool isBinarySearchTree = BinarySearchTreeTest(root,0,1000);
	 bool isBinarySearchTree2 = BinarySearchTreeTest(root2,0,1000);

	 PrintNode(root);
	 printf("\n%s\n", isBinarySearchTree ? "The tree is a binary search tree.\n" :
			 	 	 	 	 	 	 	   "The tree is not a binary search tree.\n");
	 PrintNode(root2);
	 printf("\n%s\n", isBinarySearchTree2 ? "The tree is binary a search tree." :
			 	 	 	 	 	 	 	    "The tree is not a binary search tree.");
 }
开发者ID:EmirKalaci,项目名称:BinarySearchTreeTest,代码行数:25,代码来源:main.c

示例4: PrintConstructor

PRIVATE inline void PrintConstructor(GBUF *out, UNUSED(Node *node), constructorNode *u, int offset, UNUSED(Bool norecurse))
{
     gbprintf(out, "Constructor: List: exprs");
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->type, offset + 2);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->initializerlist, offset + 2);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:8,代码来源:print-ast.c

示例5: PrintDo

PRIVATE inline void PrintDo(GBUF *out, Node *node, DoNode *u, int offset, UNUSED(Bool norecurse))
{
     gbprintf(out, "Do: (%d) ", node->print_uid);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->stmt, offset + 2);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->expr, offset + 2);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:8,代码来源:print-ast.c

示例6: PrintIf

PRIVATE inline void PrintIf(GBUF *out, UNUSED(Node *node), IfNode *u, int offset, UNUSED(Bool norecurse))
{
     gbputs("If: ", out);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->expr, offset + 2);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->stmt, offset + 2);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:8,代码来源:print-ast.c

示例7: PrintEngel

/*
**    PrintEngel() prints a commutator using the following rule for
**    Engel relations:
**                              [u, n v]
*/
static void     PrintEngel(node *l, node *r, node *e) {
	fprintf(OutFp, "[");
	PrintNode(l);
	fprintf(OutFp, ", ");
	PrintNode(e);
	fprintf(OutFp, " ");
	PrintNode(r);
	fprintf(OutFp, "]");
}
开发者ID:gap-packages,项目名称:nq,代码行数:14,代码来源:presentation.c

示例8: PrintWhileStatement

void
PrintWhileStatement(const CodeSource &src, const WhileStatementNode *node,
                    Printer pr, int tabDepth)
{
    pr("while (");
    PrintNode(src, node->condition(), pr, tabDepth+1);
    pr(")\n");
    PrintTabDepth(tabDepth+1, pr);
    PrintNode(src, node->body(), pr, tabDepth+1);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:10,代码来源:syntax_tree_inlines.hpp

示例9: PrintWithStatement

void
PrintWithStatement(const CodeSource &src, const WithStatementNode *node,
                   Printer pr, int tabDepth)
{
    pr("with (");
    PrintNode(src, node->value(), pr, tabDepth);
    pr(")\n");
    PrintTabDepth(tabDepth+1, pr);
    PrintNode(src, node->body(), pr, tabDepth+1);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:10,代码来源:syntax_tree_inlines.hpp

示例10: PrintGetElementExpression

void
PrintGetElementExpression(const CodeSource &src,
                          const GetElementExpressionNode *node,
                          Printer pr, int tabDepth)
{
    PrintNode(src, node->object(), pr, tabDepth);
    pr("[");
    PrintNode(src, node->element(), pr, tabDepth);
    pr("]");
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:10,代码来源:syntax_tree_inlines.hpp

示例11: PrintConditionalExpression

void
PrintConditionalExpression(const CodeSource &src,
                           const ConditionalExpressionNode *node,
                           Printer pr, int tabDepth)
{
    PrintNode(src, node->condition(), pr, tabDepth);
    pr(" ? ");
    PrintNode(src, node->trueExpression(), pr, tabDepth);
    pr(" : ");
    PrintNode(src, node->falseExpression(), pr, tabDepth);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:11,代码来源:syntax_tree_inlines.hpp

示例12: PrintEdge

	void PrintEdge(SGEdge* E)
	{	
		if(E!=NULL)
		{
			cout<<"Print SGEdge from -> to (Routed="<<E->checkRouted()<<", Enable="<<E->checkEnable()<<" TurnRect="<<E->checkTurnRect()<<")\n";
			PrintNode(E->getFromNode());
			PrintNode(E->getToNode());
		}
		else
		{	cout<<"NULL\n";
		}
	}
开发者ID:3vikasvicky,项目名称:TOB-RSMT,代码行数:12,代码来源:auxiliary.cpp

示例13: PrintFor

PRIVATE inline void PrintFor(GBUF *out, Node *node, ForNode *u, int offset, UNUSED(Bool norecurse))
{
     gbprintf(out, "For: (%d) ", node->print_uid);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->init, offset + 2);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->cond, offset + 2);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->next, offset + 2);
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->stmt, offset + 2);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:12,代码来源:print-ast.c

示例14: PrintForInStatement

void
PrintForInStatement(const CodeSource &src, const ForInStatementNode *node,
                    Printer pr, int tabDepth)
{
    pr("for (");
    PrintNode(src, node->lhs(), pr, tabDepth);
    pr(" in ");
    PrintNode(src, node->object(), pr, tabDepth);
    pr(")\n");
    PrintTabDepth(tabDepth+1, pr);
    PrintNode(src, node->body(), pr, tabDepth+1);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:12,代码来源:syntax_tree_inlines.hpp

示例15: PrintReturn

PRIVATE inline void PrintReturn(GBUF *out, UNUSED(Node *node), ReturnNode *u, int offset, Bool UNUSED(norecurse))
{
     gbputs("Return: ", out);
#if 0
     if (u->expr) {
	  PrintCRSpaces(out, offset + 2);
	  PrintNode(out, NodeDataType(u->expr), offset + 2);
     }
#endif
     PrintCRSpaces(out, offset + 2);
     PrintNode(out, u->expr, offset + 2);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:12,代码来源:print-ast.c


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