main.c

来自「SRI international 发布的OAA框架软件」· C语言 代码 · 共 33 行

C
33
字号
#include "stdpccts.h"
typedef AST SORAST;
#include "sorcerer.h"

main()
{
	AST *root=NULL;
	STreeParser tparser;
	STreeParserInit(&tparser);

	ANTLR(stat(&root), stdin);	/* get the tree to walk with SORCERER */
	printf("input tree:"); lisp(root); printf("\n");
	gen_stat(&tparser, &root);
}

#ifdef __STDC__
lisp(SORAST *tree)
#else
lisp(tree)
SORAST *tree;
#endif
{
	while ( tree!= NULL )
	{
		if ( tree->down != NULL ) printf(" (");
		printf(" %s", tree->text);
		lisp(tree->down);
		if ( tree->down != NULL ) printf(" )");;
		tree = tree->right;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?