java词法分析器(25) System.out.println("[INFOR]关键字表已创建!"); this.ReserveFile = ReserveFile; }
/** * @param inw * @return boolean * @roseuid 3D9BAE4702AD */ public boolean isKeyWord(String inw) { String resWord; //查找hash表 for (Enumeration e = this.KWHash.elements(); e.hasMoreElements(); ) { resWord = (String) e.nextElement(); if (resWord.equalsIgnoreCase(inw)) { return true; } } return false; }
/** * @roseuid 3D9BAE7303D3 */ public void initKeyWordTable() { KWHash = new Hashtable(); //创建hash表 int intLength; char[] chrBuffer = new char[TMP_BUFFER_SIZE]; String resWord; int resCounter = 0; try { if (ReserveFile.exists()) { //文件存在 //创建读文件对象 resFileReader = new Java.io.FileReader(ReserveFile);