欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

lab4

程序员文章站 2024-02-09 18:09:58
...
int f(int x,int y)
{
	x=5;
	return x;
}
TreeNode * newNode(NodeKind kind)
{
	TreeNode * t = (TreeNode *)malloc(sizeof(TreeNode));
	int i;
	if (t == NULL)
	{
		;
	}
	else {
		for (i = 0; i<4; i++)
		{
			t->child[i] = NULL;
		}
		t->sibling = NULL;
		t->nodekind = kind;
 
		t->lineno = lineno;
		if (kind == OpK || kind == IntK || kind == IdK)
		{
			if (kind == IdK)
				t->attr.name = "";
		}
		if (kind == ConstK)
			t->attr.val = 0;
	}
	return t;
}
void match(TokenType expected){
    if(token==expected)
        token=GetToken();
    else
        printf("unexpected token");
}
相关标签: 编译原理