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

📄 token.java

📁 语法分析器
💻 JAVA
字号:
/**
 * this class is used for storage a token information form lex analysis a token
 * include three aspects information
 * 
 * @author:贺静
 * @version:1.2
 */
public class Token {
	// the line number of current token
	private int lineNum;

	// the type of current token
	private int type;

	// the name of current token
	private String name;

	public Token() {
		this.name = "";
	}

	public Token(String name, int type, int lineNum) {
		this.name = name;
		this.type = type;
		this.lineNum = lineNum;
	}

	/**
	 * @return an int as the type of the token
	 */
	public int getType() {
		return type;
	}

	/**
	 * @param lex
	 *            for change current token's type
	 */
	public void setType(int lex) {
		this.type = lex;
	}

	/**
	 * get then line number of the token
	 */
	public int getLineNum() {
		return lineNum;
	}

	/*
	 * set the line number of the token
	 */
	public void setLineNum(int lineNum) {
		this.lineNum = lineNum;
	}

	/*
	 * get the name of the token
	 */
	public String getName() {
		return name;
	}

	/*
	 * set the name of the token
	 */
	public void setName(String name) {
		this.name = name;
	}
}

⌨️ 快捷键说明

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