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

📄 token.h

📁 Compiler with latex grammar
💻 H
字号:
#ifndef TOKEN_H
#define TOKEN_H

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <string>

using namespace std;

class Token{
private:
	int tipo;
	string lexema;
	int linea;
    
public:
	Token()
	{
		tipo=-1;
		linea = -1;
	}
	Token(int tip, string lexe,int lin){
		tipo=tip;
		lexema=lexe;
		linea=lin;
	}
	int getTipo()
	{	return tipo;	}
	string getLexema()
	{	return lexema;	}
	int getLinea()
	{	return linea;	}
	bool operator < ( Token &tmp )
	{
		return tmp.getLexema().compare(lexema) < 0 ;
	}
	
	void Imprimir()
	{
		cout<<"Token :"<<lexema;
		
		if( tipo>=100 && tipo<500 )
			cout<<"\t Palabra Reservada"<<endl;
		else if( tipo>=500 )
			cout<<"\t Simbolos Puntuacion"<<endl;
		else
			cout<<"\t Otro "<<endl;
	}
};

#endif

⌨️ 快捷键说明

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