lexicalanalyzer2.java
来自「java写的词法分析器」· Java 代码 · 共 24 行
JAVA
24 行
package lexicalanalyzer2;import java.io.*;/** * Title: Main * Description: Main part of the type of token * Copyright: Copyright (c) 2004 15th,Oct * Company: B02251132 * @author: ZengBo Huang * @version 1.0 */public class lexicalanalyzer2 {//This is the main part public static void main(String[] args)throws IOException{ check chk=new check();//Create the new check class PrintWriter out=new PrintWriter(new FileWriter("text2.txt"),true);//This is a output file while(chk.getforward()<chk.getchrnum()){ token temptkn; temptkn=chk.nexttoken();//Get the class token's nexttoken System.out.println(temptkn.toString());//Output the toString out.println(temptkn.toString());//Output into the file } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?