⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.h

📁 大学期间写的一个简单的词法分析器,通过输入符合自定义语法规则的程序,得到分析的二元组
💻 H
字号:
#include "iostream.h"
template<class type> class listnode 
{
	public:
		type data;
		listnode<type> *link;
		listnode();
};
template<class type> listnode<type>::listnode()
{
	link=NULL;
}
template<class type> class list
{
	public:
	list();
	void insert(type value);
    listnode<type> *first,*last;
};
template<class type> list<type>::list()
{
	first=last=NULL;
}
template<class type> void list<type>::insert(type value)
{
	if(first==NULL)
	{
		first=new listnode<type>;
		first->data=value;
		last=first;
		last->link=NULL;
	}
	else 
	{
      listnode<type> *newnode=new listnode<type>;
	  newnode->data=value;	  
	  last->link=newnode;
	  last=last->link;
	  last->link=NULL;
	}
}

⌨️ 快捷键说明

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