checkid.c

来自「北京航空航天大学计算机系要求的编译器大作业。大概6000行代码。」· C语言 代码 · 共 45 行

C
45
字号
/***************************************
By BHU 35060122 Peng Hui;
2008.02
description:
A small compiler to translate a C program to 80X80 Assembly Code
***************************************/


#include"Global.h"

Table*CheckId(char *id,Table *head,int l)
 {
	 Table *temp;

	 if(head == NULL)
	 {
		 return NULL;
	 }
		
	 temp = head->next;
	 if(head == head1)
	 {
//		 temp = head;
		 while(temp != NULL && strcmp(temp->name,"main") != 0)
		 {
			 if(strcmp(id,temp->name) == 0 && temp->lev == l)
				 return temp;
			 else
				 temp = temp->next;
		 }
	 }
	 else
	 {
//		temp =temp->next;
		while(temp != NULL && temp->kind != FUNC)
		{
			if(strcmp(id,temp->name) == 0 && temp->lev == l)
				return temp;
			else
				temp = temp->next;
		}
	}
	 return NULL;
 }

⌨️ 快捷键说明

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