📄 lexicalthread.java
字号:
package com.lexical.src;import com.lexical.src.*;public class LexicalThread implements Runnable{ private static LexicalPanel lexicalPanel; private static LexicalAnalyer lexicalAnalyer; private int sleepTime; private String fileName; public LexicalThread(LexicalPanel panel) { lexicalPanel = panel; setSleepTime(500); } public void run() { System.out.println("call lexicalThread run"); String token; lexicalAnalyer = new LexicalAnalyer(fileName); while(!(lexicalAnalyer.isOverLexicalAnaly())) { token = lexicalAnalyer.nextToken(); System.out.println("识别记号 : "+token); } System.out.println("over lexicalThread run"); } public void repaitLexicalPanel() { try{ Thread.sleep(sleepTime/2); } catch(InterruptedException e){} lexicalPanel.repaint(); try{ Thread.sleep(sleepTime/2); } catch(InterruptedException e){} } public void setFileName(String name) { fileName = name; } public void setSleepTime(int time) { sleepTime = time; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -